upmpdcli: fix compilation with newer libmicrohttpd
authorRosen Penev <rosenp@gmail.com>
Fri, 24 Jul 2020 21:47:58 +0000 (14:47 -0700)
committerRosen Penev <rosenp@gmail.com>
Fri, 24 Jul 2020 23:18:48 +0000 (16:18 -0700)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
sound/upmpdcli/Makefile
sound/upmpdcli/patches/010-libmicrohttpd.patch [new file with mode: 0644]

index d803602be0bdaf06a1fb569d334c5ff5baf83948..84a7698ed11d1b2766f8974b1f3da559ff785501 100644 (file)
@@ -1,3 +1,4 @@
+
 #
 # Copyright (C) 2016 OpenWrt.org
 #
@@ -9,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=upmpdcli
 PKG_VERSION:=1.4.12
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.lesbonscomptes.com/upmpdcli/downloads
diff --git a/sound/upmpdcli/patches/010-libmicrohttpd.patch b/sound/upmpdcli/patches/010-libmicrohttpd.patch
new file mode 100644 (file)
index 0000000..f81e1c9
--- /dev/null
@@ -0,0 +1,74 @@
+--- a/src/mediaserver/cdplugins/streamproxy.cpp
++++ b/src/mediaserver/cdplugins/streamproxy.cpp
+@@ -155,7 +155,7 @@ public:
+     ~Internal();
+     bool startMHD();
+-    int answerConn(
++    enum MHD_Result answerConn(
+         struct MHD_Connection *connection, const char *url, 
+         const char *method, const char *version, 
+         const char *upload_data, size_t *upload_data_size,
+@@ -202,7 +202,7 @@ StreamProxy::Internal::Internal(int _listenport, UrlTransFunc _urltrans)
+ }
+-static int answer_to_connection(
++static enum MHD_Result answer_to_connection(
+     void *cls, struct MHD_Connection *conn, 
+     const char *url, const char *method, const char *version, 
+     const char *upload_data, size_t *upload_data_size,
+@@ -214,7 +214,7 @@ static int answer_to_connection(
+         return internal->answerConn(
+             conn, url, method, version, upload_data, upload_data_size, con_cls);
+     } else {
+-        return -1;
++        return MHD_NO;
+     }
+ }
+@@ -238,7 +238,7 @@ static int print_out_key (void *cls, enum MHD_ValueKind kind,
+ }
+ #endif /* PRINT_KEYS */
+-static int mapvalues_cb(void *cls, enum MHD_ValueKind kind, 
++static enum MHD_Result mapvalues_cb(void *cls, enum MHD_ValueKind kind, 
+                         const char *key, const char *value)
+ {
+     unordered_map<string,string> *mp = (unordered_map<string,string> *)cls;
+@@ -307,7 +307,7 @@ static bool processRange(struct MHD_Connection *mhdconn, uint64_t& offset)
+     return true;
+ }
+-int StreamProxy::Internal::answerConn(
++enum MHD_Result StreamProxy::Internal::answerConn(
+     struct MHD_Connection *mhdconn, const char *_url,
+     const char *method, const char *version, 
+     const char *upload_data, size_t *upload_data_size,
+@@ -352,7 +352,7 @@ int StreamProxy::Internal::answerConn(
+                 return MHD_NO;
+             }
+             MHD_add_response_header (response, "Location", url.c_str());
+-            int ret = MHD_queue_response(mhdconn, 302, response);
++            enum MHD_Result ret = MHD_queue_response(mhdconn, 302, response);
+             MHD_destroy_response(response);
+             return ret;
+         }
+@@ -393,7 +393,7 @@ int StreamProxy::Internal::answerConn(
+         int code = httpcode ? httpcode : MHD_HTTP_INTERNAL_SERVER_ERROR;
+         struct MHD_Response *response =
+             MHD_create_response_from_buffer(0, 0, MHD_RESPMEM_PERSISTENT);
+-        int ret = MHD_queue_response(mhdconn, code, response);
++        enum MHD_Result ret = MHD_queue_response(mhdconn, code, response);
+         MHD_destroy_response(response);
+         LOGINF("StreamProxy::answerConn (1): return with http code: " <<
+                code << endl);
+@@ -434,7 +434,7 @@ int StreamProxy::Internal::answerConn(
+     if (reader->fetcher->fetchDone(&fetchcode, &httpcode)) {
+         code = httpcode ? httpcode : MHD_HTTP_INTERNAL_SERVER_ERROR;
+     }
+-    int ret = MHD_queue_response(mhdconn, code, response);
++    enum MHD_Result ret = MHD_queue_response(mhdconn, code, response);
+     MHD_destroy_response(response);
+     return ret;
+ }