I believe everything is working as designed. :) In that example, a response is sent to the client after the headers have been parsed. The connection is closed by the time the parser reaches the request body, and this is causing an error. To read the body, you should look at implementing an http_parser_settings.on_body callback.
For more info on the parser, check out: https://github.com/joyent/http-parser On Thu, Jul 26, 2012 at 9:24 AM, Felix Halim <[email protected]> wrote: > I think this is the updated example for the Ryan Dahl's tutorial on libuv: > > https://gist.github.com/1249783 > > I tried running that example, then I tried sending a normal HTTP POST > request (via a simple web form) to it and it crashes: > > > listening on port 8000 > [ 1 ] new connection > [ 1 ] http message parsed > parse error > [ 1 ] connection closed > Assertion failed: (!(handle->flags & UV_CLOSED)), function > uv__finish_close, file src/unix/core.c, line 130. > Abort trap: 6 > > > The error comes from libuv's core (not http-parser's). > > So I guess this is a bug in libuv? > > > The web form I used is a simple html: > > <form method="POST" action="http://127.0.0.1:8000/blabla"> > <input name="hello" value="world"> > <input type="submit" value="here"> > </form> > > Run it on a browser and click the button. > > > > Felix Halim > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Kevin Swiber Projects: https://github.com/kevinswiber Twitter: @kevinswiber -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
