diff options
author | Azat Khuzhin <azat@libevent.org> | 2019-01-27 15:16:39 +0300 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2019-01-28 22:20:47 +0300 |
commit | d3dcb5aca99ec5ff064b40c756f199871ef1bd45 (patch) | |
tree | 82c53db03bb74999433877fa44a4bfc0fe1e4c38 /http.c | |
parent | 5613bfb8dcd70ea1c89d04b550d9f97958cc48d2 (diff) | |
download | libevent-d3dcb5aca99ec5ff064b40c756f199871ef1bd45.tar.gz |
http: do not call deferred readcb if readcb is not set
Otherwise evhttp_read_cb can be called with invalid connection state:
http/read_on_write_error: [forking] [msg] libevent using: kqueue
FAIL ../test/regress_http.c:4079: assert(req)
FAIL ../test/regress_http.c:4087: assert(req)[err] evhttp_read_cb: illegal connection state 0
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1171,7 +1171,9 @@ static void evhttp_deferred_read_cb(struct event_callback *cb, void *data) { struct evhttp_connection *evcon = data; - evhttp_read_cb(evcon->bufev, evcon); + struct bufferevent *bev = evcon->bufev; + if (bev->readcb) + (bev->readcb)(evcon->bufev, evcon); } static void |