Removed upstreamed patches. Refreshed npupnp patch. Signed-off-by: Rosen Penev <rosenp@gmail.com>lilik-openwrt-22.03
@ -1,36 +0,0 @@ | |||||
From 77cae5ff9b8dff22bfebac905f1579562609dd35 Mon Sep 17 00:00:00 2001 | |||||
From: Rosen Penev <rosenp@gmail.com> | |||||
Date: Mon, 4 May 2020 12:44:34 -0700 | |||||
Subject: [PATCH] remove iconv casting | |||||
iconv_t is sometimes a pointer and other times an int. Remove casting | |||||
to make it work with the latter. | |||||
Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||||
--- | |||||
src/util/string_converter.cc | 6 +++--- | |||||
1 file changed, 3 insertions(+), 3 deletions(-) | |||||
diff --git a/src/util/string_converter.cc b/src/util/string_converter.cc | |||||
index 272787ad..e1724b39 100644 | |||||
--- a/src/util/string_converter.cc | |||||
+++ b/src/util/string_converter.cc | |||||
@@ -41,15 +41,15 @@ StringConverter::StringConverter(const std::string& from, const std::string& to) | |||||
dirty = false; | |||||
cd = iconv_open(to.c_str(), from.c_str()); | |||||
- if (cd == reinterpret_cast<iconv_t>(-1)) { | |||||
- cd = static_cast<iconv_t>(nullptr); | |||||
+ if (!cd) { | |||||
+ cd = {}; | |||||
throw_std_runtime_error(std::string("iconv: ") + strerror(errno)); | |||||
} | |||||
} | |||||
StringConverter::~StringConverter() | |||||
{ | |||||
- if (cd != static_cast<iconv_t>(nullptr)) | |||||
+ if (cd) | |||||
iconv_close(cd); | |||||
} | |||||
@ -0,0 +1,156 @@ | |||||
From 664b9970687b3d888999f24ef55444add016ba95 Mon Sep 17 00:00:00 2001 | |||||
From: Rosen Penev <rosenp@gmail.com> | |||||
Date: Fri, 24 Jul 2020 19:53:08 -0700 | |||||
Subject: [PATCH] treewide: include upnp/upnp.h instead of upnp.h | |||||
pupnp installs in include/upnp. npupnp installs in include/npupnp/upnp. | |||||
This commit helps with compatibility between the two. | |||||
Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||||
--- | |||||
src/action_request.h | 2 +- | |||||
src/iohandler/buffered_io_handler.h | 2 +- | |||||
src/iohandler/curl_io_handler.h | 2 +- | |||||
src/iohandler/io_handler.h | 2 +- | |||||
src/iohandler/io_handler_buffer_helper.h | 2 +- | |||||
src/subscription_request.h | 2 +- | |||||
src/transcoding/transcode_ext_handler.h | 2 +- | |||||
src/transcoding/transcode_handler.h | 2 +- | |||||
src/util/upnp_clients.cc | 2 +- | |||||
src/util/upnp_headers.h | 2 +- | |||||
10 files changed, 10 insertions(+), 10 deletions(-) | |||||
diff --git a/src/action_request.h b/src/action_request.h | |||||
index 4f57bf22..28c9f66e 100644 | |||||
--- a/src/action_request.h | |||||
+++ b/src/action_request.h | |||||
@@ -35,7 +35,7 @@ | |||||
#include <memory> | |||||
#include <pugixml.hpp> | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include "common.h" | |||||
diff --git a/src/iohandler/buffered_io_handler.h b/src/iohandler/buffered_io_handler.h | |||||
index f110a9b2..d8ec1157 100644 | |||||
--- a/src/iohandler/buffered_io_handler.h | |||||
+++ b/src/iohandler/buffered_io_handler.h | |||||
@@ -33,7 +33,7 @@ | |||||
#define __BUFFERED_IO_HANDLER_H__ | |||||
#include <memory> | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include "common.h" | |||||
#include "io_handler_buffer_helper.h" | |||||
diff --git a/src/iohandler/curl_io_handler.h b/src/iohandler/curl_io_handler.h | |||||
index 809274dd..d87ceefc 100644 | |||||
--- a/src/iohandler/curl_io_handler.h | |||||
+++ b/src/iohandler/curl_io_handler.h | |||||
@@ -35,7 +35,7 @@ | |||||
#define __CURL_IO_HANDLER_H__ | |||||
#include <curl/curl.h> | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include "common.h" | |||||
#include "io_handler_buffer_helper.h" | |||||
diff --git a/src/iohandler/io_handler.h b/src/iohandler/io_handler.h | |||||
index 2dc03118..0b2b962a 100644 | |||||
--- a/src/iohandler/io_handler.h | |||||
+++ b/src/iohandler/io_handler.h | |||||
@@ -32,7 +32,7 @@ | |||||
#ifndef __IO_HANDLER_H__ | |||||
#define __IO_HANDLER_H__ | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include "common.h" | |||||
diff --git a/src/iohandler/io_handler_buffer_helper.h b/src/iohandler/io_handler_buffer_helper.h | |||||
index 660ee9d0..9c3b0c94 100644 | |||||
--- a/src/iohandler/io_handler_buffer_helper.h | |||||
+++ b/src/iohandler/io_handler_buffer_helper.h | |||||
@@ -35,7 +35,7 @@ | |||||
#include <condition_variable> | |||||
#include <mutex> | |||||
#include <pthread.h> | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include "common.h" | |||||
#include "io_handler.h" | |||||
diff --git a/src/subscription_request.h b/src/subscription_request.h | |||||
index 4c15d85b..17d6f7d5 100644 | |||||
--- a/src/subscription_request.h | |||||
+++ b/src/subscription_request.h | |||||
@@ -33,7 +33,7 @@ | |||||
#ifndef __SUBSCRIPTION_REQUEST_H__ | |||||
#define __SUBSCRIPTION_REQUEST_H__ | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include "common.h" | |||||
diff --git a/src/transcoding/transcode_ext_handler.h b/src/transcoding/transcode_ext_handler.h | |||||
index 64b5081b..aa197e5a 100644 | |||||
--- a/src/transcoding/transcode_ext_handler.h | |||||
+++ b/src/transcoding/transcode_ext_handler.h | |||||
@@ -33,7 +33,7 @@ | |||||
#define __TRANSCODE_EXTERNAL_HANDLER_H__ | |||||
#include <memory> | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include "common.h" | |||||
#include "transcode_handler.h" | |||||
diff --git a/src/transcoding/transcode_handler.h b/src/transcoding/transcode_handler.h | |||||
index 295f2262..3ba2ba93 100644 | |||||
--- a/src/transcoding/transcode_handler.h | |||||
+++ b/src/transcoding/transcode_handler.h | |||||
@@ -34,7 +34,7 @@ | |||||
#include <memory> | |||||
#include <string> | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include "common.h" | |||||
diff --git a/src/util/upnp_clients.cc b/src/util/upnp_clients.cc | |||||
index 2033cf31..e866e456 100644 | |||||
--- a/src/util/upnp_clients.cc | |||||
+++ b/src/util/upnp_clients.cc | |||||
@@ -29,7 +29,7 @@ | |||||
#include "config/config.h" | |||||
#include "util/tools.h" | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
// table of supported clients (sequence of entries matters!) | |||||
std::vector<struct ClientInfo> Clients::clientInfo = std::vector<struct ClientInfo> { | |||||
diff --git a/src/util/upnp_headers.h b/src/util/upnp_headers.h | |||||
index 306ebfdf..c9896acb 100644 | |||||
--- a/src/util/upnp_headers.h | |||||
+++ b/src/util/upnp_headers.h | |||||
@@ -28,7 +28,7 @@ | |||||
#include <map> | |||||
#include <memory> | |||||
-#include <upnp.h> | |||||
+#include <upnp/upnp.h> | |||||
#include <vector> | |||||
class Headers { | |||||
-- | |||||
2.26.2 | |||||
@ -1,41 +0,0 @@ | |||||
From 59d37af2d6afd3d0ab6e8c5f3ea099435150c349 Mon Sep 17 00:00:00 2001 | |||||
From: Rosen Penev <rosenp@gmail.com> | |||||
Date: Tue, 2 Jun 2020 15:55:25 -0700 | |||||
Subject: [PATCH] add missing unistd header | |||||
Error with pid_t. | |||||
Found with musl + libcxx. | |||||
Signed-off-by: Rosen Penev <rosenp@gmail.com> | |||||
--- | |||||
src/util/process.h | 2 ++ | |||||
src/util/process_executor.h | 2 ++ | |||||
2 files changed, 4 insertions(+) | |||||
diff --git a/src/util/process.h b/src/util/process.h | |||||
index e79e016c..8778aa34 100644 | |||||
--- a/src/util/process.h | |||||
+++ b/src/util/process.h | |||||
@@ -35,6 +35,8 @@ | |||||
#include <memory> | |||||
#include <string> | |||||
+#include <unistd.h> | |||||
+ | |||||
// forward declaration | |||||
class Config; | |||||
diff --git a/src/util/process_executor.h b/src/util/process_executor.h | |||||
index eaccf451..2a724087 100644 | |||||
--- a/src/util/process_executor.h | |||||
+++ b/src/util/process_executor.h | |||||
@@ -35,6 +35,8 @@ | |||||
#include <string> | |||||
#include <vector> | |||||
+#include <unistd.h> | |||||
+ | |||||
#include "executor.h" | |||||
class ProcessExecutor : public Executor { |
@ -1,74 +0,0 @@ | |||||
From 89b289cde29c731f995642a341dc5fd3b47ec7a0 Mon Sep 17 00:00:00 2001 | |||||
From: Jean-Francois Dockes <jf@dockes.org> | |||||
Date: Mon, 4 May 2020 16:32:23 +0200 | |||||
Subject: [PATCH] The access() system call needs unistd.h, at least on Focal | |||||
--- | |||||
src/file_request_handler.cc | 2 +- | |||||
src/iohandler/io_handler_chainer.cc | 2 +- | |||||
src/serve_request_handler.cc | 2 +- | |||||
src/util/upnp_quirks.cc | 2 +- | |||||
4 files changed, 4 insertions(+), 4 deletions(-) | |||||
diff --git a/src/file_request_handler.cc b/src/file_request_handler.cc | |||||
index e8579b06..cfa3eaed 100644 | |||||
--- a/src/file_request_handler.cc | |||||
+++ b/src/file_request_handler.cc | |||||
@@ -30,9 +30,9 @@ | |||||
/// \file file_request_handler.cc | |||||
#include "file_request_handler.h" // API | |||||
- | |||||
#include <filesystem> | |||||
#include <sys/stat.h> | |||||
+#include <unistd.h> | |||||
#include <utility> | |||||
#include "config/config_manager.h" | |||||
diff --git a/src/iohandler/io_handler_chainer.cc b/src/iohandler/io_handler_chainer.cc | |||||
index e8701cd7..beaa9d03 100644 | |||||
--- a/src/iohandler/io_handler_chainer.cc | |||||
+++ b/src/iohandler/io_handler_chainer.cc | |||||
@@ -30,8 +30,8 @@ | |||||
/// \file io_handler_chainer.cc | |||||
#include "io_handler_chainer.h" // API | |||||
- | |||||
#include <cstdlib> | |||||
+#include <unistd.h> | |||||
#include "exceptions.h" | |||||
diff --git a/src/serve_request_handler.cc b/src/serve_request_handler.cc | |||||
index 8eaf46af..210140a3 100644 | |||||
--- a/src/serve_request_handler.cc | |||||
+++ b/src/serve_request_handler.cc | |||||
@@ -30,8 +30,8 @@ | |||||
/// \file serve_request_handler.cc | |||||
#include "serve_request_handler.h" | |||||
- | |||||
#include <sys/stat.h> | |||||
+#include <unistd.h> | |||||
#include <utility> | |||||
#include "config/config_manager.h" | |||||
diff --git a/src/util/upnp_quirks.cc b/src/util/upnp_quirks.cc | |||||
index df137370..e6f510b4 100644 | |||||
--- a/src/util/upnp_quirks.cc | |||||
+++ b/src/util/upnp_quirks.cc | |||||
@@ -24,13 +24,13 @@ | |||||
/// \file upnp_quirks.cc | |||||
#include "upnp_quirks.h" // API | |||||
- | |||||
#include "cds_objects.h" | |||||
#include "config/config_manager.h" | |||||
#include "server.h" | |||||
#include "util/tools.h" | |||||
#include "util/upnp_clients.h" | |||||
#include "util/upnp_headers.h" | |||||
+#include <unistd.h> | |||||
Quirks::Quirks(std::shared_ptr<Config> config, const struct sockaddr_storage* addr, const std::string& userAgent) | |||||
: config(std::move(config)) |
@ -1,11 +0,0 @@ | |||||
--- a/src/upnp_cds.cc | |||||
+++ b/src/upnp_cds.cc | |||||
@@ -83,7 +83,7 @@ void ContentDirectoryService::doBrowse(const std::unique_ptr<ActionRequest>& req | |||||
if (BrowseFlag == "BrowseDirectChildren") | |||||
flag |= BROWSE_DIRECT_CHILDREN; | |||||
else if (BrowseFlag != "BrowseMetadata") | |||||
- throw UpnpException(UPNP_SOAP_E_INVALID_ARGS, | |||||
+ throw UpnpException(UPNP_E_INVALID_ARGUMENT, | |||||
"invalid browse flag: " + BrowseFlag); | |||||
auto parent = storage->loadObject(objectID); |