mons / anyevent-http-server-ii Goto Github PK
View Code? Open in Web Editor NEWFast Asynchronous HTTP/1.1 Server
License: Other
Fast Asynchronous HTTP/1.1 Server
License: Other
Suggesting following patch to make form work. Example code:
return {
# There will be a request-object as 1st parameter, but it cannot be used.
form => sub { my (undef, $body) = @_; return do_post($request, $body) }
};
Patch:
--- lib/AnyEvent/HTTP/Server.pm 2015-01-27 08:19:47.000000000 +0000
+++ perl-5.15.5/lib/site_perl/5.15.5/AnyEvent/HTTP/Server.pm 2015-01-27 15:15:44.000000000 +0000
@@ -490,6 +490,7 @@
elsif ( exists $rv[0]{form} ) {
my $body = '';
+ my $rq = $req;
$r{on_body} = sub {
my ($last,$part) = @_;
if ( length($body) + length($$part) > $self->{max_body_size} ) {
@@ -497,7 +498,7 @@
}
$body .= $$part;
if ($last) {
- $rv[0]{form}( $req->form($body), $body );
+ $rv[0]{form}( $rq->form($body), $body );
delete $r{on_body};
}
};
This will fix the run-time error of $req being unset. The $req will be set to cb-code, but it is stale and really doesn't function.
it would be nice to be on CPAN
support any json serialising/deserialising in replyjs
Hi there,
I tried using this module under 5.20.1 and I get the following errors:
Parse error at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 84.
syntax error at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 84, near "$;"
syntax error at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 84, near "{ no strict "
Parse error at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 86.
syntax error at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 86, near "$;"
syntax error at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 86, near ";my"
Global symbol "$s" requires explicit package name at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 86.
Global symbol "$s" requires explicit package name at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 87.
Global symbol "@A" requires explicit package name at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 87.
Global symbol "@A" requires explicit package name at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 87.
Global symbol "@A" requires explicit package name at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 87.
Global symbol "$s" requires explicit package name at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 88.
syntax error at /opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm line 89, near ";}"
/opt/perl/lib/site_perl/5.20.1/AnyEvent/HTTP/Server/Kit.pm has too many errors.
Is this something you could look into supporting? I suspect this is related to the function prototypes?
method vars like https://metacpan.org/pod/AnyEvent::HTTPD::Request#vars
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.