r54063 - in /trunk/libhttp-parser-xs-perl: Changes META.yml Makefile.PL README XS.xs debian/changelog debian/copyright lib/HTTP/Parser/XS.pm picohttpparser/picohttpparser.c
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Thu Mar 11 02:24:18 UTC 2010
Author: jawnsy-guest
Date: Thu Mar 11 02:24:12 2010
New Revision: 54063
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=54063
Log:
New upstream release
Modified:
trunk/libhttp-parser-xs-perl/Changes
trunk/libhttp-parser-xs-perl/META.yml
trunk/libhttp-parser-xs-perl/Makefile.PL
trunk/libhttp-parser-xs-perl/README
trunk/libhttp-parser-xs-perl/XS.xs
trunk/libhttp-parser-xs-perl/debian/changelog
trunk/libhttp-parser-xs-perl/debian/copyright
trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm
trunk/libhttp-parser-xs-perl/picohttpparser/picohttpparser.c
Modified: trunk/libhttp-parser-xs-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/Changes?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/Changes (original)
+++ trunk/libhttp-parser-xs-perl/Changes Thu Mar 11 02:24:12 2010
@@ -1,4 +1,11 @@
Revision history for Perl extension HTTP::Parser::XS.
+
+0.07 Tue Mar 02 15:40:00 2010
+ - fix build error when using older versions of Pod::Text
+
+0.06 Tue Feb 23 06:16:00 2010
+ - fix memory leak, add more checks (thanks to charsbar)
+ - prereq Test::More (see rt.cpan.org #54358)
0.05 Fri Oct 23 21:12:00 2009
- no more (implicitly) depend on Exporter 5.63 (see http://rt.cpan.org/Public/Bug/Display.html?id=50607, thanks to ANDK for reporting)
Modified: trunk/libhttp-parser-xs-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/META.yml?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/META.yml (original)
+++ trunk/libhttp-parser-xs-perl/META.yml Thu Mar 11 02:24:12 2010
@@ -1,21 +1,14 @@
--- #YAML:1.0
-name: HTTP-Parser-XS
-version: 0.05
-abstract: a fast, primitive HTTP request parser
-author:
+name: HTTP-Parser-XS
+version: 0.07
+abstract: a fast, primitive HTTP request parser
+license: ~
+author:
- Kazuho Oku
-license: unknown
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
-build_requires:
- ExtUtils::MakeMaker: 0
-requires: {}
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.54
+generated_by: ExtUtils::MakeMaker version 6.42
+distribution_type: module
+requires:
+ Test::More: 0
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
Modified: trunk/libhttp-parser-xs-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/Makefile.PL?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/Makefile.PL (original)
+++ trunk/libhttp-parser-xs-perl/Makefile.PL Thu Mar 11 02:24:12 2010
@@ -3,10 +3,28 @@
WriteMakefile(
NAME => 'HTTP::Parser::XS',
VERSION_FROM => 'lib/HTTP/Parser/XS.pm',
- PREREQ_PM => {},
+ PREREQ_PM => {
+ 'Test::More' => 0,
+ },
ABSTRACT_FROM => 'lib/HTTP/Parser/XS.pm',
AUTHOR => 'Kazuho Oku',
LIBS => [],
DEFINE => '',
INC => '-I.',
);
+
+eval {
+ require Pod::Text;
+ my $p = Pod::Text->new;
+ $p->output_fh(do {
+ open my $fh, '>', "README.$$" or die $!;
+ $fh;
+ });
+ $p->parse_file('lib/HTTP/Parser/XS.pm');
+ undef $p;
+ rename "README.$$", 'README'
+ or die $!;
+};
+
+print "Warning: no README, please install newest Pod::Text and rerun Makefile.PL\n"
+ unless -e 'README';
Modified: trunk/libhttp-parser-xs-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/README?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/README (original)
+++ trunk/libhttp-parser-xs-perl/README Thu Mar 11 02:24:12 2010
@@ -1,1 +1,57 @@
-see lib/HTTP/Parser/XS.pm
+NAME
+ HTTP::Parser::XS - a fast, primitive HTTP request parser
+
+SYNOPSIS
+ use HTTP::Parser::XS qw(parse_http_request);
+
+ my $ret = parse_http_request(
+ "GET / HTTP/1.0\r\nHost: ...\r\n\r\n",
+ \%env,
+ );
+ if ($ret == -2) {
+ # request is incomplete
+ ...
+ } elsif ($ret == -1) {
+ # request is broken
+ ...
+ } else {
+ # $ret includes the size of the request, %env now contains a PSGI
+ # request, if it is a POST / PUT request, read request content by
+ # yourself
+ ...
+ }
+
+DESCRIPTION
+ HTTP::Parser::XS is a fast, primitive HTTP request parser that can be
+ used either for writing a synchronous HTTP server or a event-driven
+ server.
+
+METHODS
+ parse_http_request($request_string, \%env)
+ Tries to parse given request string, and if successful, inserts
+ variables into %env. For the name of the variables inserted, please
+ refer to the PSGI specification. The return values are:
+
+ >=0 length of the request (request line and the request
+ headers), in bytes
+
+ -1 given request is corrupt
+
+ -2 given request is incomplete
+
+COPYRIGHT
+ Copyright 2009- Kazuho Oku
+
+AUTHOR
+ Kazuho Oku
+
+THANKS TO
+ nothingmuch charsbar
+
+SEE ALSO
+ HTTP::Parser HTTP::HeaderParser::XS
+
+LICENSE
+ This library is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself.
+
Modified: trunk/libhttp-parser-xs-perl/XS.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/XS.xs?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/XS.xs (original)
+++ trunk/libhttp-parser-xs-perl/XS.xs Thu Mar 11 02:24:12 2010
@@ -66,8 +66,10 @@
if (s[i] == '%') {
int hi, lo;
if ((hi = hex_decode(s[i + 1])) == -1
- || (lo = hex_decode(s[i + 2])) == -1)
- return NULL;
+ || (lo = hex_decode(s[i + 2])) == -1) {
+ free(dbuf);
+ return NULL;
+ }
*d++ = hi * 16 + lo;
i += 3;
} else
@@ -120,6 +122,9 @@
if (ret < 0)
goto done;
+ if (!SvROK(envref))
+ Perl_croak(aTHX_ "second param to parse_http_request should be a hashref");
+
env = (HV*)SvRV(envref);
if (SvTYPE(env) != SVt_PVHV)
Perl_croak(aTHX_ "second param to parse_http_request should be a hashref");
Modified: trunk/libhttp-parser-xs-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/debian/changelog?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/debian/changelog (original)
+++ trunk/libhttp-parser-xs-perl/debian/changelog Thu Mar 11 02:24:12 2010
@@ -1,3 +1,9 @@
+libhttp-parser-xs-perl (0.07-1) UNRELEASED; urgency=low
+
+ * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org> Wed, 10 Mar 2010 21:48:24 -0500
+
libhttp-parser-xs-perl (0.05-1) unstable; urgency=low
* Initial Release (Closes: #570175)
Modified: trunk/libhttp-parser-xs-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/debian/copyright?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/debian/copyright (original)
+++ trunk/libhttp-parser-xs-perl/debian/copyright Thu Mar 11 02:24:12 2010
@@ -6,9 +6,6 @@
Files: *
Copyright: 2009, Kazuho Oku <kazuhooku at gmail.com>
License: Artistic or GPL-1+
-Comment: copyright information is currently extracted directly from
- the version control system and will appear in subsequent releases;
- see: http://github.com/kazuho/p5-http-parser-xs
Files: debian/*
Copyright: 2010, Jonathan Yu <jawnsy at cpan.org>
Modified: trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm (original)
+++ trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm Thu Mar 11 02:24:12 2010
@@ -11,7 +11,7 @@
our @EXPORT_OK = @{$EXPORT_TAGS{all}};
our @EXPORT = ();
-our $VERSION = '0.05';
+our $VERSION = '0.07';
require XSLoader;
XSLoader::load('HTTP::Parser::XS', $VERSION);
@@ -74,13 +74,18 @@
=back
+=head1 COPYRIGHT
+
+Copyright 2009- Kazuho Oku
+
=head1 AUTHOR
-Kazuho Oku E<lt>kazuhooku at gmail.comE<gt>
+Kazuho Oku
=head1 THANKS TO
nothingmuch
+charsbar
=head1 SEE ALSO
Modified: trunk/libhttp-parser-xs-perl/picohttpparser/picohttpparser.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/picohttpparser/picohttpparser.c?rev=54063&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/picohttpparser/picohttpparser.c (original)
+++ trunk/libhttp-parser-xs-perl/picohttpparser/picohttpparser.c Thu Mar 11 02:24:12 2010
@@ -6,7 +6,7 @@
return -2; \
}
-#define EXPECT(ch) \
+#define EXPECT_CHAR(ch) \
CHECK_EOF(); \
if (*buf++ != ch) { \
return -1; \
@@ -32,7 +32,7 @@
if (*buf == '\r') {
++buf;
CHECK_EOF();
- EXPECT('\n');
+ EXPECT_CHAR('\n');
++ret_cnt;
} else if (*buf == '\n') {
++buf;
@@ -70,7 +70,7 @@
CHECK_EOF();
if (*buf == '\r') {
++buf;
- EXPECT('\n');
+ EXPECT_CHAR('\n');
} else if (*buf == '\n') {
++buf;
}
@@ -84,8 +84,8 @@
ADVANCE_TOKEN();
*path_len = buf - *path;
++buf;
- EXPECT('H'); EXPECT('T'); EXPECT('T'); EXPECT('P'); EXPECT('/'); EXPECT('1');
- EXPECT('.');
+ EXPECT_CHAR('H'); EXPECT_CHAR('T'); EXPECT_CHAR('T'); EXPECT_CHAR('P'); EXPECT_CHAR('/'); EXPECT_CHAR('1');
+ EXPECT_CHAR('.');
*minor_version = 0;
for (; ; ++buf) {
CHECK_EOF();
@@ -97,7 +97,7 @@
}
if (*buf == '\r') {
++buf;
- EXPECT('\n');
+ EXPECT_CHAR('\n');
} else if (*buf == '\n') {
++buf;
} else {
@@ -110,7 +110,7 @@
CHECK_EOF();
if (*buf == '\r') {
++buf;
- EXPECT('\n');
+ EXPECT_CHAR('\n');
break;
} else if (*buf == '\n') {
++buf;
@@ -148,7 +148,7 @@
if (*buf == '\r') {
headers[*num_headers].value_len = buf - headers[*num_headers].value;
++buf;
- EXPECT('\n');
+ EXPECT_CHAR('\n');
break;
} else if (*buf == '\n') {
headers[*num_headers].value_len = buf - headers[*num_headers].value;
@@ -162,5 +162,5 @@
}
#undef CHECK_EOF
-#undef EXPECT
+#undef EXPECT_CHAR
#undef ADVACE_TOKEN
More information about the Pkg-perl-cvs-commits
mailing list