forwarded 882308 https://github.com/igrigorik/em-http-request/issues/316 thanks
Jérémy Lal wrote... > Control: reassign -1 ruby-em-http-request > I took the liberty to reassign it to it. Feel free to reassign to > whichever you see it would be better assigned. Good question where to put it, you already figured this, see below. > Please try this patch on ruby-em-http-request. > > --- a/lib/em-http/http_connection.rb > +++ b/lib/em-http/http_connection.rb > @@ -131,7 +131,7 @@ > end > > @p.on_message_complete = proc do > - if !client.continue? > + if client and !client.continue? > c = @clients.shift > c.state = :finished > c.on_request_complete This does the trick. I was pretty close back in December but not close enough. > Bug or feature ? nodejs is using http-parser and has a thorough test suite, > so i suppose we're on the safe side fixing this package (but my experience > tells me i'm 80% wrong when i suppose things like that). It looks a lot like a behaviour change in http-parser. Then ruby-em-http-request cannot deal with an another on_message callback, and fails. But I'd like to see that in the sources. Good question who is to blame for this, the documentation for on_message is rather terse. Hardening ruby-em-http-request using your patch is certainly a good thing to do. To increase the noise, I've also opened an issue at ruby-em-http-request's upstream. Christoph
signature.asc
Description: PGP signature