mirror of
https://github.com/omar-polo/gmid.git
synced 2024-10-01 06:51:19 +02:00
libevent2 fix: unfreeze the client evbuffer
libevent2 has this concept of "freezeness" of a buffer. It's a way to avoid accidentally write/remove data from the wrong "edge" of the buffer. The client_tls_{read,write} functions need to add/drain data from the opposite edge, hence the need for the unfreeze call. This is the minimum change in order to work on libevent2 too. Another way would be to define evbuffer_{un,}freeze as NOP on libevent 1, but it's ugly IMHO.
This commit is contained in:
parent
efb6210d77
commit
acafce5b7d
5
server.c
5
server.c
@ -505,6 +505,11 @@ found:
|
|||||||
event_set(&c->bev->ev_write, c->fd, EV_WRITE,
|
event_set(&c->bev->ev_write, c->fd, EV_WRITE,
|
||||||
client_tls_writecb, c->bev);
|
client_tls_writecb, c->bev);
|
||||||
|
|
||||||
|
#if HAVE_LIBEVENT2
|
||||||
|
evbuffer_unfreeze(c->bev->input, 0);
|
||||||
|
evbuffer_unfreeze(c->bev->output, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
bufferevent_enable(c->bev, EV_READ);
|
bufferevent_enable(c->bev, EV_READ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user