]> granicus.if.org Git - libevent/commit
http: fix detecting EOF without write
authorAzat Khuzhin <a3at.mail@gmail.com>
Tue, 8 Sep 2015 13:40:55 +0000 (16:40 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Wed, 9 Sep 2015 15:06:42 +0000 (18:06 +0300)
commit7ed02ac12926c7a1b004d14652deabffb7575c20
tree512482a3619c4b932b9659247c696abc7188fd2c
parent3d15aeb4fddb4ef150061eb1ddf11d66b5725960
http: fix detecting EOF without write

Before this patch http server don't knows when client disconnected until it
will try to write to it, IOW to detect is client still alive you need to write
something to client socket, however it is not convenient since it requires to
store all clients somewhere and poll them periodically, and I don't see any
regressions if we will leave EV_READ always (like libevhtp do), since we
already reset read callback in evhttp_write_buffer() (see
http/write_during_read).

Also since we don't disable EV_READ anymore we don't need some enable EV_READ,
so we will reduce number of epoll_ctl() calls.

Covered-by: http/terminate_chunked_oneshot
Covered-by: http/write_during_read
Fixes: #78
http.c