[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Possible bug in http.c



Thanks Nick. We have been testing it for the last few days and it seems to work well. What do you mean in terms of testing? Is there any automated set of tests that need to be made for proper verification?


On Sat, Mar 1, 2014 at 2:09 PM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:
On Wed, Feb 26, 2014 at 10:29 AM, Ronen Mizrahi <ronen@xxxxxxxxxxxx> wrote:
> Hi,
>
> I have come across what seems to be a bug in http implementation, where an
> http server does not detect closed connections until the next time it
> attempts to write something.
>
> After some investigation I found the issue in evhttp_write_buffer() from
> http.c. There is a comment there that says:
> "We don't disable reading, since we *do* want to learn about any close
> events"
>
> However reading is already disabled so it needs to be enabled for close
> events to be sent. Once I enabled reading the above problem was solved and
> the http server was able to properly detect connections closed by the client
> and send a close event.
>
> I am new to libevent, happy to send a patch if desirable but first wanted to
> run it by someone.

Yeah, if that's the behavior, that does indeed sound wrong.  We should
learn about close events where the other side closes the socket.

I'd be happy to take a patch for that; the important thing for a such
a patch IMO would be that the patch should be tested.  (For example,
what should happen if, instead of closing, the other side sends more
data, or some HTTP protocol stuff, or something? Whatever the right
answer is, we need to make sure that the code really does that.)

Please let me know if there's any more I can do to help get a patch in here.

best wishes,
--
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.