From 85dd6092f67feb4033f0845f623d9e0e809f3651 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sun, 18 Dec 2022 21:39:46 +0100 Subject: [PATCH] [daap/dacp] Remove bufferevent workaround, maybe not required any more TEST --- src/httpd_daap.c | 15 +-------------- src/httpd_dacp.c | 15 +-------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/httpd_daap.c b/src/httpd_daap.c index f8683270..49b16e89 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -42,7 +42,6 @@ #include #include -#include #include "httpd_daap.h" #include "logger.h" @@ -993,7 +992,6 @@ daap_reply_update(struct httpd_request *hreq) { struct daap_update_request *ur; struct evhttp_connection *evcon; - struct bufferevent *bufev; const char *param; int reqd_rev; int ret; @@ -1073,18 +1071,7 @@ daap_reply_update(struct httpd_request *hreq) */ evcon = evhttp_request_get_connection(hreq->req); if (evcon) - { - evhttp_connection_set_closecb(evcon, update_fail_cb, ur); - - // This is a workaround for some versions of libevent (2.0, but possibly - // also 2.1) that don't detect if the client hangs up, and thus don't - // clean up and never call update_fail_cb(). See github issue #870 and - // https://github.com/libevent/libevent/issues/666. It should probably be - // removed again in the future. The workaround is also present in dacp.c - bufev = evhttp_connection_get_bufferevent(evcon); - if (bufev) - bufferevent_enable(bufev, EV_READ); - } + evhttp_connection_set_closecb(evcon, update_fail_cb, ur); return DAAP_REPLY_NONE; } diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index b60aac56..f53124f9 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -36,7 +36,6 @@ #endif #include -#include #include "httpd_dacp.h" #include "httpd_daap.h" @@ -2236,7 +2235,6 @@ dacp_reply_playstatusupdate(struct httpd_request *hreq) { struct dacp_update_request *ur; struct evhttp_connection *evcon; - struct bufferevent *bufev; const char *param; int reqd_rev; int ret; @@ -2297,18 +2295,7 @@ dacp_reply_playstatusupdate(struct httpd_request *hreq) */ evcon = evhttp_request_get_connection(hreq->req); if (evcon) - { - evhttp_connection_set_closecb(evcon, update_fail_cb, ur); - - // This is a workaround for some versions of libevent (2.0, but possibly - // also 2.1) that don't detect if the client hangs up, and thus don't - // clean up and never call update_fail_cb(). See github issue #870 and - // https://github.com/libevent/libevent/issues/666. It should probably be - // removed again in the future. The workaround is also present in daap.c - bufev = evhttp_connection_get_bufferevent(evcon); - if (bufev) - bufferevent_enable(bufev, EV_READ); - } + evhttp_connection_set_closecb(evcon, update_fail_cb, ur); return 0; }