mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-10 05:59:45 -05:00
Account for new evhttp behaviour on failed incoming connections
The evcon associated with a request is freed by evhttp when the connection fails. Protect against a NULL evcon when handling the connection failure.
This commit is contained in:
@@ -129,7 +129,8 @@ static pthread_t tid_httpd;
|
||||
static void
|
||||
stream_end(struct stream_ctx *st, int failed)
|
||||
{
|
||||
evhttp_connection_set_closecb(st->req->evcon, NULL, NULL);
|
||||
if (st->req->evcon)
|
||||
evhttp_connection_set_closecb(st->req->evcon, NULL, NULL);
|
||||
|
||||
if (!failed)
|
||||
evhttp_send_reply_end(st->req);
|
||||
|
||||
Reference in New Issue
Block a user