mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
fix the close detection problem correctly by not running close detection on the server
svn:r968
This commit is contained in:
parent
f700566cb9
commit
f1728d94eb
13
http.c
13
http.c
@ -1116,21 +1116,13 @@ evhttp_error_cb(struct bufferevent *bufev, short what, void *arg)
|
||||
*/
|
||||
if (evcon->flags & EVHTTP_CON_CLOSEDETECT) {
|
||||
evcon->flags &= ~EVHTTP_CON_CLOSEDETECT;
|
||||
if (evcon->http_server == NULL) {
|
||||
assert(evcon->http_server == NULL);
|
||||
/* For connections from the client, we just
|
||||
* reset the connection so that it becomes
|
||||
* disconnected.
|
||||
*/
|
||||
assert(evcon->state == EVCON_IDLE);
|
||||
evhttp_connection_reset(evcon);
|
||||
} else {
|
||||
/* For connections from the server, we free
|
||||
* them if there is no request working on
|
||||
* them.
|
||||
*/
|
||||
if (evcon->state == EVCON_READING_FIRSTLINE)
|
||||
evhttp_connection_free(evcon);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1919,9 +1911,6 @@ evhttp_send_done(struct evhttp_connection *evcon, void *arg)
|
||||
/* we have a persistent connection; try to accept another request. */
|
||||
if (evhttp_associate_new_request_with_connection(evcon) == -1) {
|
||||
evhttp_connection_free(evcon);
|
||||
} else {
|
||||
/* set up to watch for client close */
|
||||
evhttp_connection_start_detectclose(evcon);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user