]> granicus.if.org Git - libevent/commit
do not fail while sending on http connections the client closed.
authorNiels Provos <provos@gmail.com>
Wed, 3 Feb 2010 22:34:56 +0000 (14:34 -0800)
committerNiels Provos <provos@gmail.com>
Wed, 3 Feb 2010 22:34:56 +0000 (14:34 -0800)
commit93d736910616ad32e6d8c2f7f377b12f5848f5d5
tree60d592c60daa76c97fd7de56fd6fdabc2459de5b
parentda6135e356b4ff8489b7810682a70d5a70ac7197
do not fail while sending on http connections the client closed.

when sending chunked requests via multiple calls to evhttp_send_reply_chunk,
the client may close the connection before the server is done sending. this
used to cause a crash.

we introduce a new function evhttp_request_get_connection() that allows the
server to determine if the request is still associated with a connection.
If it's not, evhttp_request_free() needs to be called explicitly or the user
can call evhttp_send_reply_end() which just frees the request, too.
http.c
include/event2/http.h
include/event2/http_struct.h
test/regress_http.c