mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-13 14:26:30 -04:00
Do not crash when evhttp_send_reply_start() is called after a timeout.
This fixes the crash reported in issue #509. The "would be nice" items discussed in #509 can be addressed separately. (cherry picked from commit 99d0a952dada771b91acf63f5208b994e80a2986)
This commit is contained in:
parent
5b40744d15
commit
826f1134b8
4
http.c
4
http.c
@ -2822,6 +2822,10 @@ evhttp_send_reply_start(struct evhttp_request *req, int code,
|
||||
const char *reason)
|
||||
{
|
||||
evhttp_response_code_(req, code, reason);
|
||||
|
||||
if (req->evcon == NULL)
|
||||
return;
|
||||
|
||||
if (evhttp_find_header(req->output_headers, "Content-Length") == NULL &&
|
||||
REQ_VERSION_ATLEAST(req, 1, 1) &&
|
||||
evhttp_response_needs_body(req)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user