From 255525dd741df04f8497396b8035c5d2bdabd269 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Fri, 11 Mar 2016 13:55:41 +0300 Subject: [PATCH] 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). --- bufferevent_sock.c | 3 +++ 1 file changed, 3 insertions(+) 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, -- 2.40.0