Giter Site home page Giter Site logo

anyevent-http-server-ii's People

Contributors

bif-kun avatar kotleta avatar mons avatar nikolo avatar tchernicum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anyevent-http-server-ii's Issues

Processing POST-data doesn't work

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.

cpan

it would be nice to be on CPAN

Module doesn't work under 5.20.1

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.