From: Azat Khuzhin Date: Fri, 11 Mar 2016 10:55:41 +0000 (+0300) Subject: be_sock: unfreeze buffers on fd changing X-Git-Tag: release-2.1.6-beta~61 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=255525dd741df04f8497396b8035c5d2bdabd269;p=libevent be_sock: unfreeze buffers on fd changing Only bufferevent_sock have evbuffer_freeze()/evbuffer_unfreeze() & ctrl ops, so we don't need to fix other bufferevents (be_pair doesn't have ctrl op). Found during draining buffers in http layer, and hence 501-not-implemented error in regress http/.. (with some custom hacking). --- diff --git a/bufferevent_sock.c b/bufferevent_sock.c index a2b381ac..5ffd2ab3 100644 --- a/bufferevent_sock.c +++ b/bufferevent_sock.c @@ -630,6 +630,9 @@ be_socket_setfd(struct bufferevent *bufev, evutil_socket_t fd) event_del(&bufev->ev_read); event_del(&bufev->ev_write); + evbuffer_unfreeze(bufev->input, 0); + evbuffer_unfreeze(bufev->output, 1); + event_assign(&bufev->ev_read, bufev->ev_base, fd, EV_READ|EV_PERSIST|EV_FINALIZE, bufferevent_readcb, bufev); event_assign(&bufev->ev_write, bufev->ev_base, fd,