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

Re: [Libevent-users] evhttp_accept_socket_with_handle() implies LEV_CLOSE_ON_FREE on underlying evconnlistener



Hi Nick,

On Fri, Feb 11, 2011 at 9:13 PM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:
Well, something's certainly wrong here. ÂI'm not sure whether to call
it a bug in the documentation or a bug in the code. ÂMy inclination is
to call the code correct and change the doxygen comment from

Â"This function does not close the socket"

to

Â"This function closes the socket if you created the
evhttp_bound_socket using evhttp_bind_socket_with_handle or
evhttp_accept_socket_with_handle. ÂThis function frees the listener
you provided if you created the socket using evhttp_bind_listener."

My rationale is that if we change the code, we risk introducing socket
leaks to programs that previously didn't have them, whereas any
programs that followed the documentation in this case would not get
any buggier than they were before. ÂI could be wrong, though. ÂAnybody
want to talk me out of it?

Well, I agree with you(as this approach looks more flexible to me).

--
WBR,
 Constantine