mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -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:
parent
e396906fee
commit
81d09ed234
@ -129,6 +129,7 @@ static pthread_t tid_httpd;
|
||||
static void
|
||||
stream_end(struct stream_ctx *st, int failed)
|
||||
{
|
||||
if (st->req->evcon)
|
||||
evhttp_connection_set_closecb(st->req->evcon, NULL, NULL);
|
||||
|
||||
if (!failed)
|
||||
|
@ -647,6 +647,7 @@ update_fail_cb(struct evhttp_connection *evcon, void *arg)
|
||||
|
||||
DPRINTF(E_DBG, L_DAAP, "Update request: client closed connection\n");
|
||||
|
||||
if (ur->req->evcon)
|
||||
evhttp_connection_set_closecb(ur->req->evcon, NULL, NULL);
|
||||
|
||||
if (ur == update_requests)
|
||||
@ -2873,7 +2874,9 @@ daap_deinit(void)
|
||||
{
|
||||
update_requests = ur->next;
|
||||
|
||||
if (ur->req->evcon)
|
||||
evhttp_connection_set_closecb(ur->req->evcon, NULL, NULL);
|
||||
|
||||
free(ur);
|
||||
}
|
||||
}
|
||||
|
@ -351,6 +351,7 @@ update_fail_cb(struct evhttp_connection *evcon, void *arg)
|
||||
|
||||
DPRINTF(E_DBG, L_DACP, "Update request: client closed connection\n");
|
||||
|
||||
if (ur->req->evcon)
|
||||
evhttp_connection_set_closecb(ur->req->evcon, NULL, NULL);
|
||||
|
||||
if (ur == update_requests)
|
||||
@ -1703,7 +1704,9 @@ dacp_deinit(void)
|
||||
{
|
||||
update_requests = ur->next;
|
||||
|
||||
if (ur->req->evcon)
|
||||
evhttp_connection_set_closecb(ur->req->evcon, NULL, NULL);
|
||||
|
||||
free(ur);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user