--- /dev/null
+From 5057f1332e02d9c2582b5887ff7bb4ba28060903 Mon Sep 17 00:00:00 2001
+Message-Id: <5057f1332e02d9c2582b5887ff7bb4ba28060903.1354464698.git.striper@gmx.de>
+From: Yonathan Yusim <yonathan@boxee.tv>
+Date: Mon, 4 Jul 2011 17:34:12 +0300
+Subject: [PATCH] fixed crash
+
+---
+ djmount/device_list.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/djmount/device_list.c b/djmount/device_list.c
+index b3cb08f..b5c2103 100644
+--- a/djmount/device_list.c
++++ b/djmount/device_list.c
+@@ -426,7 +426,7 @@ AddDevice (const char* deviceId,
+ } else {
+ // If SSDP target specified, check that the device
+ // matches it.
+- if (strstr (g_ssdp_target, ":service:")) {
++ if (g_ssdp_target && strstr (g_ssdp_target, ":service:")) {
+ const Service* serv = Device_GetServiceFrom
+ (devnode->d, g_ssdp_target,
+ FROM_SERVICE_TYPE, false);
+--
+1.7.3.4
+
+++ /dev/null
-From b5531b3126edd57764e5380bbc8d25980db78641 Mon Sep 17 00:00:00 2001
-From: Unknown User <unknown@unknown.user>
-Date: Wed, 8 Jun 2022 22:17:51 +0200
-Subject: [PATCH] upnp_util.h: fix build
-
-Signed-off-by: Thilo Graf <dbt@novatux.de>
----
- djmount/upnp_util.h | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/djmount/upnp_util.h b/djmount/upnp_util.h
-index 93b85eb..ba20287 100644
---- a/djmount/upnp_util.h
-+++ b/djmount/upnp_util.h
-@@ -26,7 +26,7 @@
- #ifndef UPNP_UTIL_H_INCLUDED
- #define UPNP_UTIL_H_INCLUDED
-
--
-+#include <upnp/upnp.h>
- #include <upnp/upnptools.h>
-
-
-@@ -46,8 +46,8 @@ extern "C" {
- *****************************************************************************/
- char*
- UpnpUtil_GetEventString (void* talloc_context,
-- IN Upnp_EventType eventType,
-- IN const void* event);
-+ Upnp_EventType eventType,
-+ const void* event);
-
-
- /*****************************************************************************
-@@ -55,7 +55,7 @@ UpnpUtil_GetEventString (void* talloc_context,
- * @return a static constant string, or NULL if unknown event type.
- *****************************************************************************/
- const char*
--UpnpUtil_GetEventTypeString (IN Upnp_EventType e);
-+UpnpUtil_GetEventTypeString (Upnp_EventType e);
-
-
-
---
-2.35.1
-
--- /dev/null
+From 5ee82020984ada3c20c523490f637bba3fc08b79 Mon Sep 17 00:00:00 2001
+Message-Id: <5ee82020984ada3c20c523490f637bba3fc08b79.1354462423.git.striper@gmx.de>
+From: Yonathan Yusim <yonathan@boxee.tv>
+Date: Tue, 23 Aug 2011 17:33:21 +0300
+Subject: [PATCH] fixed crash when using UTF-8 charset
+
+---
+ djmount/charset.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/djmount/charset.c b/djmount/charset.c
+index 993fac0..4c255ca 100644
+--- a/djmount/charset.c
++++ b/djmount/charset.c
+@@ -491,7 +491,7 @@ Charset_Finish()
+ for (i = 0; i < NB_CONVERTERS; i++) {
+ Converter* const cvt = g_converters + i;
+ ithread_mutex_destroy (&cvt->mutex);
+- if (iconv_close (cvt->cd))
++ if (cvt->cd != (iconv_t)-1 && iconv_close (cvt->cd))
+ rc = errno;
+ cvt->cd = (iconv_t) -1;
+ }
+--
+1.7.3.4
+
--- /dev/null
+From b4ef6638dcd47703079f1d55519dbfdad44b9cee Mon Sep 17 00:00:00 2001
+Message-Id: <b4ef6638dcd47703079f1d55519dbfdad44b9cee.1354462407.git.striper@gmx.de>
+From: Yonathan Yusim <yonathan@boxee.tv>
+Date: Wed, 4 Jan 2012 16:07:07 +0200
+Subject: [PATCH] fix hang with asset upnp
+
+---
+ djmount/device_list.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/djmount/device_list.c b/djmount/device_list.c
+index b5c2103..22beb01 100644
+--- a/djmount/device_list.c
++++ b/djmount/device_list.c
+@@ -230,7 +230,9 @@ DeviceList_RemoveDevice (const char* deviceId)
+ ListDelNode (&GlobalDeviceList, node, /*freeItem=>*/ 0);
+ // Do the notification while the global list is still locked
+ NotifyUpdate (E_DEVICE_REMOVED, devnode);
++ ithread_mutex_unlock (&DeviceListMutex);
+ talloc_free (devnode);
++ ithread_mutex_lock (&DeviceListMutex);
+ } else {
+ Log_Printf (LOG_WARNING, "RemoveDevice can't find Id=%s",
+ NN(deviceId));
+--
+1.7.3.4
+
--- /dev/null
+From ebb90c54d9af735f9561aefeb1e0959e29d6ea95 Mon Sep 17 00:00:00 2001
+Message-Id: <ebb90c54d9af735f9561aefeb1e0959e29d6ea95.1354465991.git.striper@gmx.de>
+From: striper <striper@gmx.de>
+Date: Sun, 2 Dec 2012 17:33:03 +0100
+Subject: [PATCH] - fix incorrect range when retrieving content via HTTP
+
+---
+ djmount/file_buffer.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/djmount/file_buffer.c b/djmount/file_buffer.c
+index 80a9e34..9d3e8ae 100644
+--- a/djmount/file_buffer.c
++++ b/djmount/file_buffer.c
+@@ -199,7 +199,7 @@ FileBuffer_Read (FileBuffer* file, char* buffer,
+ int rc = UpnpOpenHttpGetEx (file->url, &handle,
+ &contentType, &contentLength,
+ &httpStatus,
+- offset, offset + size,
++ offset, offset + size - 1,
+ HTTP_DEFAULT_TIMEOUT
+ );
+ if (rc != UPNP_E_SUCCESS)
+--
+1.7.3.4
+
--- /dev/null
+commit e505f2db5ea8f449d413f8a74453a7668a78a156
+Author: Mattia Barbon <mattia.barbon@libero.it>
+Date: Sat May 21 20:37:45 2011 +0200
+
+ Fixes for new autotools versions.
+
+diff --git a/configure.ac b/configure.ac
+index dd9dbfd..762f0df 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -13,9 +13,7 @@ AC_INIT(djmount, 0.71, r3mi@users.sourceforge.net)
+
+ # share auxiliary files with sub-configure in "libupnp"
+ AC_CONFIG_AUX_DIR(libupnp/config.aux)
+-AC_CONFIG_MACRO_DIR(libupnp/m4)
+ AC_CONFIG_MACRO_DIR(m4)
+-AC_CONFIG_MACRO_DIR(gl/m4)
+
+ AC_CONFIG_SRCDIR(djmount/djfs.c)
+
+diff --git a/libupnp/m4/rt_bool_arg_enable.m4 b/libupnp/m4/rt_bool_arg_enable.m4
+index efed41a..71bd7e8 100644
+--- a/libupnp/m4/rt_bool_arg_enable.m4
++++ b/libupnp/m4/rt_bool_arg_enable.m4
+@@ -34,7 +34,7 @@ AC_DEFUN([RT_BOOL_ARG_ENABLE],[
+ )])
+ test "x$enable_[$1]" != [x]m4_if([$2],[yes],[no],[yes]) dnl
+ && enable_[]Name=[$2]
+- AC_MSG_RESULT($enable_[]Name)dnl
++ AC_MSG_RESULT($enable_[]Name)
+ AM_CONDITIONAL([ENABLE_]NAME, test x"$enable_[]Name" = xyes)
+ dnl
+ m4_popdef([NAME])dnl
--- /dev/null
+diff --git a/libupnp/upnp/src/genlib/net/http/webserver.c b/libupnp/upnp/src/genlib/net/http/webserver.c
+index f5dc1c9..70c7993 100644
+--- a/libupnp/upnp/src/genlib/net/http/webserver.c
++++ b/libupnp/upnp/src/genlib/net/http/webserver.c
+@@ -280,7 +280,7 @@ search_extension( IN const char *extension,
+ * 0 - On Sucess
+ * UPNP_E_OUTOF_MEMORY - on memory allocation failures
+ ************************************************************************/
+-XINLINE int
++static XINLINE int
+ get_content_type( IN const char *filename,
+ OUT DOMString * content_type )
+ {
--- /dev/null
+Description: Support /etc/fstab mounting
+Forwarded: https://sourceforge.net/tracker/?func=detail&aid=3514280&group_id=142039&atid=751317
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=660098
+Author: Kevin Vargo <vargok@yahoo.com>
+Last-Update: 2012-04-02
+--- djmount-0.71.orig/djmount/fuse_main.c 2006-08-27 16:12:20.000000000 -0400
++++ djmount-0.71/djmount/fuse_main.c 2011-12-23 15:39:29.000000000 -0500
+@@ -529,6 +529,7 @@
+ " --version print version number, then exit\n"
+ " -o [options] mount options (see below)\n"
+ " -d[levels] enable debug output (implies -f)\n"
++ " -s sloppy -- ignore unknown options\n"
+ " -f foreground operation (default: daemonized)\n"
+ "\n"
+ "Mount options (one or more comma separated options) :\n"
+@@ -538,6 +539,7 @@
+ " playlists use playlists for AV files, instead of plain files\n"
+ " search_history=<size> number of remembered searches (default: %d)\n"
+ " (set to 0 to disable search)\n"
++ " sloppy ignore unknown options (e.g., for /etc/fstab)\n"
+ "\n", DEFAULT_SEARCH_HISTORY_SIZE);
+ fprintf
+ (stream,
+@@ -635,6 +637,9 @@
+ Log_Printf (LOG_DEBUG, " Fuse option = %s", fuse_argv[fuse_argc]); \
+ fuse_argc++
+
++ //Ignore unknown options "sloppy" -- mount -s
++ bool options_sloppy = false;
++
+ int opt = 1;
+ char* o;
+ while ((o = argv[opt++])) {
+@@ -646,6 +651,9 @@
+
+ } else if (strcmp(o, "-f") == 0) {
+ background = false;
++
++ } else if (strcmp(o, "-s") == 0) {
++ options_sloppy = true;
+
+ } else if (*o != '-') {
+ // mount point
+@@ -657,6 +665,10 @@
+ char* options_copy = strdup (options);
+ char* tokptr = 0;
+ char* s;
++
++ char** unknown_options = talloc_size(tmp_ctx, sizeof(char) * strlen(options_copy));
++ int unknown_ptr = -1;
++
+ for (s = strtok_r (options_copy, ",", &tokptr);
+ s != NULL;
+ s = strtok_r (NULL, ",", &tokptr)) {
+@@ -669,16 +681,39 @@
+ } else if (strncmp(s, "search_history=", 15)
+ == 0) {
+ search_history_size = atoi (s+15);
++ //check for '-s|-o sloppy' -- ignore unknown options
++ } else if (strncmp(s, "sloppy", 15) == 0 ||
++ (strlen(s) == 1 && strncmp(s, "s", 1) == 0)) {
++ options_sloppy = true;
+ } else if (strncmp(s, "fsname=", 7) == 0 ||
+ strstr (FUSE_ALLOWED_OPTIONS, s)) {
+ FUSE_ARG ("-o");
+ FUSE_ARG (talloc_strdup (tmp_ctx, s));
+ } else {
++ //Record unknown options for analysis, after we're sure
++ //we don't see '-o sloppy'
++ unknown_options[++unknown_ptr] = strdup(s);
++ }
++ }
++
++ //Now, we should know if we have invalid option(s), or can
++ //ignore:
++ if (unknown_ptr >= 0) {
++ //If debug...
++ int i = 0;
++ for (i = 0; i <= unknown_ptr; i++) {
++ Log_Printf (LOG_WARNING, "Found unknown option = %s%s",
++ unknown_options[i], (options_sloppy ? "; ignoring" : ""));
++ }
++ //If 'sloppy' is not enabled...
++ if (! options_sloppy) {
+ bad_usage (argv[0],
+- "unknown mount option '%s'",
+- s); // ---------->
++ "unknown mount option '%s' (and [-s|-o sloppy] not provided)",
++ unknown_options[0]); // ---------->
+ }
+ }
++ talloc_free(unknown_options);
++
+ free (options_copy);
+ Log_Printf (LOG_INFO, " Mount options = %s", options);
+
--- /dev/null
+From fbe644e0d4abebee4c5d7459efe6791504e0fe18 Mon Sep 17 00:00:00 2001
+Message-Id: <fbe644e0d4abebee4c5d7459efe6791504e0fe18.1354462414.git.striper@gmx.de>
+From: Yonathan Yusim <yonathan@boxee.tv>
+Date: Wed, 31 Aug 2011 18:46:47 +0300
+Subject: [PATCH] support seeking in large > 2gb files
+
+---
+ djmount/file_buffer.h | 2 +-
+ djmount/media_file.c | 2 +-
+ libupnp/upnp/inc/upnp.h | 4 ++--
+ libupnp/upnp/src/api/upnpapi.c | 4 ++--
+ libupnp/upnp/src/genlib/net/http/httpreadwrite.c | 6 +++---
+ libupnp/upnp/src/inc/httpreadwrite.h | 4 ++--
+ 6 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/djmount/file_buffer.h b/djmount/file_buffer.h
+index 215e017..9434efb 100644
+--- a/djmount/file_buffer.h
++++ b/djmount/file_buffer.h
+@@ -60,7 +60,7 @@ typedef struct _FileBuffer FileBuffer;
+ *
+ *****************************************************************************/
+
+-#define FILE_BUFFER_MAX_CONTENT_LENGTH ((uintmax_t) INT_MAX)
++#define FILE_BUFFER_MAX_CONTENT_LENGTH ((uintmax_t) ~0ULL)
+
+
+ /*****************************************************************************
+diff --git a/djmount/media_file.c b/djmount/media_file.c
+index 44b4ffe..761f715 100644
+--- a/djmount/media_file.c
++++ b/djmount/media_file.c
+@@ -284,7 +284,7 @@ MediaFile_GetResSize (const MediaFile* const file)
+ {
+ const char* const str = ixmlElement_getAttribute (file->res, "size");
+ off_t res;
+- STRING_TO_INT (str, res, -1);
++ STRING_TO_INT (str, res, 8ULL * 1024 * 1024 * 1024);
+ return res;
+ }
+
+diff --git a/libupnp/upnp/inc/upnp.h b/libupnp/upnp/inc/upnp.h
+index aac43ee..34cb188 100644
+--- a/libupnp/upnp/inc/upnp.h
++++ b/libupnp/upnp/inc/upnp.h
+@@ -2262,9 +2262,9 @@ int UpnpOpenHttpGetEx(
+ IN OUT int *httpStatus, /** The status returned on receiving a
+ response message from the remote
+ server. */
+- IN int lowRange, /** An integer value representing the low
++ IN unsigned long long lowRange, /** An integer value representing the low
+ end of a range to retrieve. */
+- IN int highRange, /** An integer value representing the high
++ IN unsigned long long highRange, /** An integer value representing the high
+ end of a range to retrieve. */
+ IN int timeout /** A time out value sent with the request
+ during which a response is expected
+diff --git a/libupnp/upnp/src/api/upnpapi.c b/libupnp/upnp/src/api/upnpapi.c
+index ea5460b..8642060 100644
+--- a/libupnp/upnp/src/api/upnpapi.c
++++ b/libupnp/upnp/src/api/upnpapi.c
+@@ -3117,8 +3117,8 @@ UpnpOpenHttpGetEx( IN const char *url_str,
+ IN OUT char **contentType,
+ OUT int *contentLength,
+ OUT int *httpStatus,
+- IN int lowRange,
+- IN int highRange,
++ IN unsigned long long lowRange,
++ IN unsigned long long highRange,
+ IN int timeout )
+ {
+ return http_OpenHttpGetEx( url_str,
+diff --git a/libupnp/upnp/src/genlib/net/http/httpreadwrite.c b/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
+index 838b3be..bb03419 100644
+--- a/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
++++ b/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
+@@ -2072,8 +2072,8 @@ http_OpenHttpGetEx( IN const char *url_str,
+ IN OUT char **contentType,
+ OUT int *contentLength,
+ OUT int *httpStatus,
+- IN int lowRange,
+- IN int highRange,
++ IN unsigned long long lowRange,
++ IN unsigned long long highRange,
+ IN int timeout )
+ {
+ int http_error_code;
+@@ -2107,7 +2107,7 @@ http_OpenHttpGetEx( IN const char *url_str,
+ }
+
+ memset( &rangeBuf, 0, sizeof( rangeBuf ) );
+- sprintf( rangeBuf.RangeHeader, "Range: bytes=%d-%d\r\n",
++ sprintf( rangeBuf.RangeHeader, "Range: bytes=%llu-%llu\r\n",
+ lowRange, highRange );
+
+ membuffer_init( &request );
+diff --git a/libupnp/upnp/src/inc/httpreadwrite.h b/libupnp/upnp/src/inc/httpreadwrite.h
+index a657320..e583858 100644
+--- a/libupnp/upnp/src/inc/httpreadwrite.h
++++ b/libupnp/upnp/src/inc/httpreadwrite.h
+@@ -494,8 +494,8 @@ int http_OpenHttpGetEx(IN const char *url_str,
+ IN OUT char **contentType,
+ OUT int *contentLength,
+ OUT int *httpStatus,
+- IN int lowRange,
+- IN int highRange,
++ IN unsigned long long lowRange,
++ IN unsigned long long highRange,
+ IN int timeout);
+
+ /************************************************************************
+--
+1.7.3.4
+
--- /dev/null
+--- djmount-0.71/libupnp/threadutil/inc/ithread.h
++++ djmount-0.71/libupnp/threadutil/inc/ithread.h
+@@ -179,7 +179,7 @@
+ * Returns EINVAL if the kind is not supported.
+ * See man page for pthread_mutexattr_setkind_np
+ *****************************************************************************/
+-#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
++#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
+
+
+ /****************************************************************************
+
--- /dev/null
+--- a/configure.ac
++++ b/configure.ac
+@@ -17,7 +17,7 @@ AC_CONFIG_MACRO_DIR(m4)
+
+ AC_CONFIG_SRCDIR(djmount/djfs.c)
+
+-AM_INIT_AUTOMAKE([1.9 -Wall std-options gnu])
++AM_INIT_AUTOMAKE([1.9 -Wall subdir-objects std-options gnu foreign])
+
+ AC_CONFIG_HEADERS(config.h)
+
+@@ -191,7 +191,8 @@ if test x"$enable_charset" = xyes; then
+ # Checks for function in C library or libiconv
+ # (AM macros from "gettext" package)
+ AM_ICONV
+- AM_LANGINFO_CODESET
++# AM_LANGINFO_CODESET
++ AM_GNU_GETTEXT([external])
+ # TBD print warning if no setlocale or nl_langinfo(CODESET) implemented
+ fi
+ AM_CONDITIONAL(WANT_ICONV,
--- /dev/null
+From e955996e3f0eae9c518d4e6e036ba3e1636a4698 Mon Sep 17 00:00:00 2001
+From: Unknown User <unknown@unknown.user>
+Date: Thu, 9 Jun 2022 20:42:09 +0200
+Subject: [PATCH 11/14] djmount: libupnp-1.6.6
+
+Signed-off-by: Thilo Graf <dbt@novatux.de>
+---
+ djmount/fuse_main.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/djmount/fuse_main.c b/djmount/fuse_main.c
+index f47a6e8..ae74cb3 100644
+--- a/djmount/fuse_main.c
++++ b/djmount/fuse_main.c
+@@ -618,7 +618,7 @@ main (int argc, char *argv[])
+ }
+ Log_Colorize (true);
+ #if UPNP_HAVE_DEBUG
+- SetLogFileNames ("/dev/null", "/dev/null");
++ UpnpSetLogFileNames ("/dev/null", "/dev/null");
+ #endif
+
+ /*
+@@ -745,10 +745,10 @@ main (int argc, char *argv[])
+ Log_SetMaxLevel (LOG_ERROR);
+ #if UPNP_HAVE_DEBUG
+ } else if (strcmp (s, "upnperr") == 0) {
+- SetLogFileNames ("/dev/stdout",
++ UpnpSetLogFileNames ("/dev/stdout",
+ "/dev/null");
+ } else if (strcmp (s, "upnpall") == 0) {
+- SetLogFileNames ("/dev/stdout",
++ UpnpSetLogFileNames ("/dev/stdout",
+ "/dev/stdout");
+ #endif
+ } else {
+--
+2.35.1
+
+++ /dev/null
---- a/configure.ac
-+++ b/configure.ac
-@@ -17,7 +17,7 @@ AC_CONFIG_MACRO_DIR(m4)
-
- AC_CONFIG_SRCDIR(djmount/djfs.c)
-
--AM_INIT_AUTOMAKE([1.9 -Wall std-options gnu])
-+AM_INIT_AUTOMAKE([1.9 -Wall subdir-objects std-options gnu foreign])
-
- AC_CONFIG_HEADERS(config.h)
-
-@@ -191,7 +191,8 @@ if test x"$enable_charset" = xyes; then
- # Checks for function in C library or libiconv
- # (AM macros from "gettext" package)
- AM_ICONV
-- AM_LANGINFO_CODESET
-+# AM_LANGINFO_CODESET
-+ AM_GNU_GETTEXT([external])
- # TBD print warning if no setlocale or nl_langinfo(CODESET) implemented
- fi
- AM_CONDITIONAL(WANT_ICONV,
--- /dev/null
+From 946b88a69a57c59231aeda2394dcb7a463360412 Mon Sep 17 00:00:00 2001
+From: Unknown User <unknown@unknown.user>
+Date: Thu, 9 Jun 2022 20:43:45 +0200
+Subject: [PATCH 12/14] djmount: libupnp-1.6.13
+
+Signed-off-by: Thilo Graf <dbt@novatux.de>
+---
+ djmount/upnp_util.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/djmount/upnp_util.h b/djmount/upnp_util.h
+index 93b85eb..f3703f9 100644
+--- a/djmount/upnp_util.h
++++ b/djmount/upnp_util.h
+@@ -28,6 +28,7 @@
+
+
+ #include <upnp/upnptools.h>
++#include <upnp/upnp.h>
+
+
+ #ifdef __cplusplus
+--
+2.35.1
+
--- /dev/null
+From 520eecce9c13d5310aee5d4033feb1a6053235f3 Mon Sep 17 00:00:00 2001
+From: Thilo Graf <dbt@novatux.de>
+Date: Thu, 9 Jun 2022 20:47:30 +0200
+Subject: [PATCH 13/14] djmount: avoid crash-by using size_t
+
+---
+ djmount/file_buffer.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/djmount/file_buffer.c b/djmount/file_buffer.c
+index 9d3e8ae..4a927ac 100644
+--- a/djmount/file_buffer.c
++++ b/djmount/file_buffer.c
+@@ -212,7 +212,7 @@ FileBuffer_Read (FileBuffer* file, char* buffer,
+ * to return the exact number of bytes requested.
+ */
+ do {
+- unsigned int read_size = size - n;
++ size_t read_size = size - n;
+ if (n > 0) {
+ Log_Printf (LOG_DEBUG,
+ "UpnpReadHttpGet loop ! url '%s' "
+--
+2.35.1
+
--- /dev/null
+From 24d4d43702a76f2bae72200a96e1527faa149afc Mon Sep 17 00:00:00 2001
+From: Thilo Graf <dbt@novatux.de>
+Date: Thu, 9 Jun 2022 20:49:11 +0200
+Subject: [PATCH 14/14] djmount: enable bigfiles
+
+---
+ djmount/media_file.c | 2 +-
+ libupnp/upnp/src/genlib/net/http/httpreadwrite.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/djmount/media_file.c b/djmount/media_file.c
+index 3352763..65394c7 100644
+--- a/djmount/media_file.c
++++ b/djmount/media_file.c
+@@ -282,7 +282,7 @@ MediaFile_GetResSize (const MediaFile* const file)
+ {
+ const char* const str = ixmlElement_getAttribute (file->res, "size");
+ off_t res;
+- STRING_TO_INT (str, res, 8ULL * 1024 * 1024 * 1024);
++ STRING_TO_INT (str, res, 8ULL << 30);
+ return res;
+ }
+
+diff --git a/libupnp/upnp/src/genlib/net/http/httpreadwrite.c b/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
+index bb03419..4fbb186 100644
+--- a/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
++++ b/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
+@@ -2107,7 +2107,7 @@ http_OpenHttpGetEx( IN const char *url_str,
+ }
+
+ memset( &rangeBuf, 0, sizeof( rangeBuf ) );
+- sprintf( rangeBuf.RangeHeader, "Range: bytes=%llu-%llu\r\n",
++ sprintf( rangeBuf.RangeHeader, "Range: bytes=%llu-%llu\r\n",
+ lowRange, highRange );
+
+ membuffer_init( &request );
+--
+2.35.1
+++ /dev/null
-From b4ef6638dcd47703079f1d55519dbfdad44b9cee Mon Sep 17 00:00:00 2001
-Message-Id: <b4ef6638dcd47703079f1d55519dbfdad44b9cee.1354462407.git.striper@gmx.de>
-From: Yonathan Yusim <yonathan@boxee.tv>
-Date: Wed, 4 Jan 2012 16:07:07 +0200
-Subject: [PATCH] fix hang with asset upnp
-
----
- djmount/device_list.c | 2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
-
-diff --git a/djmount/device_list.c b/djmount/device_list.c
-index b5c2103..22beb01 100644
---- a/djmount/device_list.c
-+++ b/djmount/device_list.c
-@@ -230,7 +230,9 @@ DeviceList_RemoveDevice (const char* deviceId)
- ListDelNode (&GlobalDeviceList, node, /*freeItem=>*/ 0);
- // Do the notification while the global list is still locked
- NotifyUpdate (E_DEVICE_REMOVED, devnode);
-+ ithread_mutex_unlock (&DeviceListMutex);
- talloc_free (devnode);
-+ ithread_mutex_lock (&DeviceListMutex);
- } else {
- Log_Printf (LOG_WARNING, "RemoveDevice can't find Id=%s",
- NN(deviceId));
---
-1.7.3.4
-
+++ /dev/null
-From ebb90c54d9af735f9561aefeb1e0959e29d6ea95 Mon Sep 17 00:00:00 2001
-Message-Id: <ebb90c54d9af735f9561aefeb1e0959e29d6ea95.1354465991.git.striper@gmx.de>
-From: striper <striper@gmx.de>
-Date: Sun, 2 Dec 2012 17:33:03 +0100
-Subject: [PATCH] - fix incorrect range when retrieving content via HTTP
-
----
- djmount/file_buffer.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/djmount/file_buffer.c b/djmount/file_buffer.c
-index 80a9e34..9d3e8ae 100644
---- a/djmount/file_buffer.c
-+++ b/djmount/file_buffer.c
-@@ -199,7 +199,7 @@ FileBuffer_Read (FileBuffer* file, char* buffer,
- int rc = UpnpOpenHttpGetEx (file->url, &handle,
- &contentType, &contentLength,
- &httpStatus,
-- offset, offset + size,
-+ offset, offset + size - 1,
- HTTP_DEFAULT_TIMEOUT
- );
- if (rc != UPNP_E_SUCCESS)
---
-1.7.3.4
-
+++ /dev/null
-commit e505f2db5ea8f449d413f8a74453a7668a78a156
-Author: Mattia Barbon <mattia.barbon@libero.it>
-Date: Sat May 21 20:37:45 2011 +0200
-
- Fixes for new autotools versions.
-
-diff --git a/configure.ac b/configure.ac
-index dd9dbfd..762f0df 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -13,9 +13,7 @@ AC_INIT(djmount, 0.71, r3mi@users.sourceforge.net)
-
- # share auxiliary files with sub-configure in "libupnp"
- AC_CONFIG_AUX_DIR(libupnp/config.aux)
--AC_CONFIG_MACRO_DIR(libupnp/m4)
- AC_CONFIG_MACRO_DIR(m4)
--AC_CONFIG_MACRO_DIR(gl/m4)
-
- AC_CONFIG_SRCDIR(djmount/djfs.c)
-
-diff --git a/libupnp/m4/rt_bool_arg_enable.m4 b/libupnp/m4/rt_bool_arg_enable.m4
-index efed41a..71bd7e8 100644
---- a/libupnp/m4/rt_bool_arg_enable.m4
-+++ b/libupnp/m4/rt_bool_arg_enable.m4
-@@ -34,7 +34,7 @@ AC_DEFUN([RT_BOOL_ARG_ENABLE],[
- )])
- test "x$enable_[$1]" != [x]m4_if([$2],[yes],[no],[yes]) dnl
- && enable_[]Name=[$2]
-- AC_MSG_RESULT($enable_[]Name)dnl
-+ AC_MSG_RESULT($enable_[]Name)
- AM_CONDITIONAL([ENABLE_]NAME, test x"$enable_[]Name" = xyes)
- dnl
- m4_popdef([NAME])dnl
+++ /dev/null
-diff --git a/libupnp/upnp/src/genlib/net/http/webserver.c b/libupnp/upnp/src/genlib/net/http/webserver.c
-index f5dc1c9..70c7993 100644
---- a/libupnp/upnp/src/genlib/net/http/webserver.c
-+++ b/libupnp/upnp/src/genlib/net/http/webserver.c
-@@ -280,7 +280,7 @@ search_extension( IN const char *extension,
- * 0 - On Sucess
- * UPNP_E_OUTOF_MEMORY - on memory allocation failures
- ************************************************************************/
--XINLINE int
-+static XINLINE int
- get_content_type( IN const char *filename,
- OUT DOMString * content_type )
- {
+++ /dev/null
-From 5ee82020984ada3c20c523490f637bba3fc08b79 Mon Sep 17 00:00:00 2001
-Message-Id: <5ee82020984ada3c20c523490f637bba3fc08b79.1354462423.git.striper@gmx.de>
-From: Yonathan Yusim <yonathan@boxee.tv>
-Date: Tue, 23 Aug 2011 17:33:21 +0300
-Subject: [PATCH] fixed crash when using UTF-8 charset
-
----
- djmount/charset.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/djmount/charset.c b/djmount/charset.c
-index 993fac0..4c255ca 100644
---- a/djmount/charset.c
-+++ b/djmount/charset.c
-@@ -491,7 +491,7 @@ Charset_Finish()
- for (i = 0; i < NB_CONVERTERS; i++) {
- Converter* const cvt = g_converters + i;
- ithread_mutex_destroy (&cvt->mutex);
-- if (iconv_close (cvt->cd))
-+ if (cvt->cd != (iconv_t)-1 && iconv_close (cvt->cd))
- rc = errno;
- cvt->cd = (iconv_t) -1;
- }
---
-1.7.3.4
-
+++ /dev/null
-From 5057f1332e02d9c2582b5887ff7bb4ba28060903 Mon Sep 17 00:00:00 2001
-Message-Id: <5057f1332e02d9c2582b5887ff7bb4ba28060903.1354464698.git.striper@gmx.de>
-From: Yonathan Yusim <yonathan@boxee.tv>
-Date: Mon, 4 Jul 2011 17:34:12 +0300
-Subject: [PATCH] fixed crash
-
----
- djmount/device_list.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/djmount/device_list.c b/djmount/device_list.c
-index b3cb08f..b5c2103 100644
---- a/djmount/device_list.c
-+++ b/djmount/device_list.c
-@@ -426,7 +426,7 @@ AddDevice (const char* deviceId,
- } else {
- // If SSDP target specified, check that the device
- // matches it.
-- if (strstr (g_ssdp_target, ":service:")) {
-+ if (g_ssdp_target && strstr (g_ssdp_target, ":service:")) {
- const Service* serv = Device_GetServiceFrom
- (devnode->d, g_ssdp_target,
- FROM_SERVICE_TYPE, false);
---
-1.7.3.4
-
+++ /dev/null
---- djmount-0.71/libupnp/threadutil/inc/ithread.h
-+++ djmount-0.71/libupnp/threadutil/inc/ithread.h
-@@ -179,7 +179,7 @@
- * Returns EINVAL if the kind is not supported.
- * See man page for pthread_mutexattr_setkind_np
- *****************************************************************************/
--#define ithread_mutexattr_setkind_np pthread_mutexattr_setkind_np
-+#define ithread_mutexattr_setkind_np pthread_mutexattr_settype
-
-
- /****************************************************************************
-
+++ /dev/null
-Description: Support /etc/fstab mounting
-Forwarded: https://sourceforge.net/tracker/?func=detail&aid=3514280&group_id=142039&atid=751317
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=660098
-Author: Kevin Vargo <vargok@yahoo.com>
-Last-Update: 2012-04-02
---- djmount-0.71.orig/djmount/fuse_main.c 2006-08-27 16:12:20.000000000 -0400
-+++ djmount-0.71/djmount/fuse_main.c 2011-12-23 15:39:29.000000000 -0500
-@@ -529,6 +529,7 @@
- " --version print version number, then exit\n"
- " -o [options] mount options (see below)\n"
- " -d[levels] enable debug output (implies -f)\n"
-+ " -s sloppy -- ignore unknown options\n"
- " -f foreground operation (default: daemonized)\n"
- "\n"
- "Mount options (one or more comma separated options) :\n"
-@@ -538,6 +539,7 @@
- " playlists use playlists for AV files, instead of plain files\n"
- " search_history=<size> number of remembered searches (default: %d)\n"
- " (set to 0 to disable search)\n"
-+ " sloppy ignore unknown options (e.g., for /etc/fstab)\n"
- "\n", DEFAULT_SEARCH_HISTORY_SIZE);
- fprintf
- (stream,
-@@ -635,6 +637,9 @@
- Log_Printf (LOG_DEBUG, " Fuse option = %s", fuse_argv[fuse_argc]); \
- fuse_argc++
-
-+ //Ignore unknown options "sloppy" -- mount -s
-+ bool options_sloppy = false;
-+
- int opt = 1;
- char* o;
- while ((o = argv[opt++])) {
-@@ -646,6 +651,9 @@
-
- } else if (strcmp(o, "-f") == 0) {
- background = false;
-+
-+ } else if (strcmp(o, "-s") == 0) {
-+ options_sloppy = true;
-
- } else if (*o != '-') {
- // mount point
-@@ -657,6 +665,10 @@
- char* options_copy = strdup (options);
- char* tokptr = 0;
- char* s;
-+
-+ char** unknown_options = talloc_size(tmp_ctx, sizeof(char) * strlen(options_copy));
-+ int unknown_ptr = -1;
-+
- for (s = strtok_r (options_copy, ",", &tokptr);
- s != NULL;
- s = strtok_r (NULL, ",", &tokptr)) {
-@@ -669,16 +681,39 @@
- } else if (strncmp(s, "search_history=", 15)
- == 0) {
- search_history_size = atoi (s+15);
-+ //check for '-s|-o sloppy' -- ignore unknown options
-+ } else if (strncmp(s, "sloppy", 15) == 0 ||
-+ (strlen(s) == 1 && strncmp(s, "s", 1) == 0)) {
-+ options_sloppy = true;
- } else if (strncmp(s, "fsname=", 7) == 0 ||
- strstr (FUSE_ALLOWED_OPTIONS, s)) {
- FUSE_ARG ("-o");
- FUSE_ARG (talloc_strdup (tmp_ctx, s));
- } else {
-+ //Record unknown options for analysis, after we're sure
-+ //we don't see '-o sloppy'
-+ unknown_options[++unknown_ptr] = strdup(s);
-+ }
-+ }
-+
-+ //Now, we should know if we have invalid option(s), or can
-+ //ignore:
-+ if (unknown_ptr >= 0) {
-+ //If debug...
-+ int i = 0;
-+ for (i = 0; i <= unknown_ptr; i++) {
-+ Log_Printf (LOG_WARNING, "Found unknown option = %s%s",
-+ unknown_options[i], (options_sloppy ? "; ignoring" : ""));
-+ }
-+ //If 'sloppy' is not enabled...
-+ if (! options_sloppy) {
- bad_usage (argv[0],
-- "unknown mount option '%s'",
-- s); // ---------->
-+ "unknown mount option '%s' (and [-s|-o sloppy] not provided)",
-+ unknown_options[0]); // ---------->
- }
- }
-+ talloc_free(unknown_options);
-+
- free (options_copy);
- Log_Printf (LOG_INFO, " Mount options = %s", options);
-
+++ /dev/null
-From fbe644e0d4abebee4c5d7459efe6791504e0fe18 Mon Sep 17 00:00:00 2001
-Message-Id: <fbe644e0d4abebee4c5d7459efe6791504e0fe18.1354462414.git.striper@gmx.de>
-From: Yonathan Yusim <yonathan@boxee.tv>
-Date: Wed, 31 Aug 2011 18:46:47 +0300
-Subject: [PATCH] support seeking in large > 2gb files
-
----
- djmount/file_buffer.h | 2 +-
- djmount/media_file.c | 2 +-
- libupnp/upnp/inc/upnp.h | 4 ++--
- libupnp/upnp/src/api/upnpapi.c | 4 ++--
- libupnp/upnp/src/genlib/net/http/httpreadwrite.c | 6 +++---
- libupnp/upnp/src/inc/httpreadwrite.h | 4 ++--
- 6 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/djmount/file_buffer.h b/djmount/file_buffer.h
-index 215e017..9434efb 100644
---- a/djmount/file_buffer.h
-+++ b/djmount/file_buffer.h
-@@ -60,7 +60,7 @@ typedef struct _FileBuffer FileBuffer;
- *
- *****************************************************************************/
-
--#define FILE_BUFFER_MAX_CONTENT_LENGTH ((uintmax_t) INT_MAX)
-+#define FILE_BUFFER_MAX_CONTENT_LENGTH ((uintmax_t) ~0ULL)
-
-
- /*****************************************************************************
-diff --git a/djmount/media_file.c b/djmount/media_file.c
-index 44b4ffe..761f715 100644
---- a/djmount/media_file.c
-+++ b/djmount/media_file.c
-@@ -284,7 +284,7 @@ MediaFile_GetResSize (const MediaFile* const file)
- {
- const char* const str = ixmlElement_getAttribute (file->res, "size");
- off_t res;
-- STRING_TO_INT (str, res, -1);
-+ STRING_TO_INT (str, res, 8ULL * 1024 * 1024 * 1024);
- return res;
- }
-
-diff --git a/libupnp/upnp/inc/upnp.h b/libupnp/upnp/inc/upnp.h
-index aac43ee..34cb188 100644
---- a/libupnp/upnp/inc/upnp.h
-+++ b/libupnp/upnp/inc/upnp.h
-@@ -2262,9 +2262,9 @@ int UpnpOpenHttpGetEx(
- IN OUT int *httpStatus, /** The status returned on receiving a
- response message from the remote
- server. */
-- IN int lowRange, /** An integer value representing the low
-+ IN unsigned long long lowRange, /** An integer value representing the low
- end of a range to retrieve. */
-- IN int highRange, /** An integer value representing the high
-+ IN unsigned long long highRange, /** An integer value representing the high
- end of a range to retrieve. */
- IN int timeout /** A time out value sent with the request
- during which a response is expected
-diff --git a/libupnp/upnp/src/api/upnpapi.c b/libupnp/upnp/src/api/upnpapi.c
-index ea5460b..8642060 100644
---- a/libupnp/upnp/src/api/upnpapi.c
-+++ b/libupnp/upnp/src/api/upnpapi.c
-@@ -3117,8 +3117,8 @@ UpnpOpenHttpGetEx( IN const char *url_str,
- IN OUT char **contentType,
- OUT int *contentLength,
- OUT int *httpStatus,
-- IN int lowRange,
-- IN int highRange,
-+ IN unsigned long long lowRange,
-+ IN unsigned long long highRange,
- IN int timeout )
- {
- return http_OpenHttpGetEx( url_str,
-diff --git a/libupnp/upnp/src/genlib/net/http/httpreadwrite.c b/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
-index 838b3be..bb03419 100644
---- a/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
-+++ b/libupnp/upnp/src/genlib/net/http/httpreadwrite.c
-@@ -2072,8 +2072,8 @@ http_OpenHttpGetEx( IN const char *url_str,
- IN OUT char **contentType,
- OUT int *contentLength,
- OUT int *httpStatus,
-- IN int lowRange,
-- IN int highRange,
-+ IN unsigned long long lowRange,
-+ IN unsigned long long highRange,
- IN int timeout )
- {
- int http_error_code;
-@@ -2107,7 +2107,7 @@ http_OpenHttpGetEx( IN const char *url_str,
- }
-
- memset( &rangeBuf, 0, sizeof( rangeBuf ) );
-- sprintf( rangeBuf.RangeHeader, "Range: bytes=%d-%d\r\n",
-+ sprintf( rangeBuf.RangeHeader, "Range: bytes=%llu-%llu\r\n",
- lowRange, highRange );
-
- membuffer_init( &request );
-diff --git a/libupnp/upnp/src/inc/httpreadwrite.h b/libupnp/upnp/src/inc/httpreadwrite.h
-index a657320..e583858 100644
---- a/libupnp/upnp/src/inc/httpreadwrite.h
-+++ b/libupnp/upnp/src/inc/httpreadwrite.h
-@@ -494,8 +494,8 @@ int http_OpenHttpGetEx(IN const char *url_str,
- IN OUT char **contentType,
- OUT int *contentLength,
- OUT int *httpStatus,
-- IN int lowRange,
-- IN int highRange,
-+ IN unsigned long long lowRange,
-+ IN unsigned long long highRange,
- IN int timeout);
-
- /************************************************************************
---
-1.7.3.4
-
--- /dev/null
+From b5531b3126edd57764e5380bbc8d25980db78641 Mon Sep 17 00:00:00 2001
+From: Unknown User <unknown@unknown.user>
+Date: Wed, 8 Jun 2022 22:17:51 +0200
+Subject: [PATCH] upnp_util.h: fix build
+
+Signed-off-by: Thilo Graf <dbt@novatux.de>
+---
+ djmount/upnp_util.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/djmount/upnp_util.h b/djmount/upnp_util.h
+index 93b85eb..ba20287 100644
+--- a/djmount/upnp_util.h
++++ b/djmount/upnp_util.h
+@@ -46,8 +46,8 @@ extern "C" {
+ *****************************************************************************/
+ char*
+ UpnpUtil_GetEventString (void* talloc_context,
+- IN Upnp_EventType eventType,
+- IN const void* event);
++ Upnp_EventType eventType,
++ const void* event);
+
+
+ /*****************************************************************************
+@@ -55,7 +55,7 @@ UpnpUtil_GetEventString (void* talloc_context,
+ * @return a static constant string, or NULL if unknown event type.
+ *****************************************************************************/
+ const char*
+-UpnpUtil_GetEventTypeString (IN Upnp_EventType e);
++UpnpUtil_GetEventTypeString (Upnp_EventType e);
+
+
+
+--
+2.35.1
+
$(REMOVE)/motion-3.2.12
$(TOUCH)
-DJMOUNT_PATCH = 0001-upnp_util.h-fix-build.patch
-DJMOUNT_PATCH += djmount-fixed-crash.patch
-DJMOUNT_PATCH += djmount-fixed-crash-when-using-UTF-8-charset.patch
-DJMOUNT_PATCH += djmount-fix-hang-with-asset-upnp.patch
-DJMOUNT_PATCH += djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch
-DJMOUNT_PATCH += djmount-fix-new-autotools.patch
-DJMOUNT_PATCH += djmount-fix-newer-gcc.patch
-DJMOUNT_PATCH += djmount-support-fstab-mounting.patch
-DJMOUNT_PATCH += djmount-support-seeking-in-large-2gb-files.patch
-DJMOUNT_PATCH += djmount-pthread-fix.patch
+DJMOUNT_PATCH = 0001-djmount-fixed-crash.patch
+DJMOUNT_PATCH += 0002-djmount-fixed-crash-when-using-UTF-8-charset.patch
+DJMOUNT_PATCH += 0003-djmount-fix-hang-with-asset-upnp.patch
+DJMOUNT_PATCH += 0004-djmount-fix-incorrect-range-when-retrieving-content-via-HTTP.patch
+DJMOUNT_PATCH += 0005-djmount-Fix-for-new-autotools-versions.patch
+DJMOUNT_PATCH += 0006-djmount-fix-newer-gcc.patch
+DJMOUNT_PATCH += 0007-djmount-support-fstab-mounting.patch
+DJMOUNT_PATCH += 0008-djmount-support-seeking-in-large-2gb-files.patch
+DJMOUNT_PATCH += 0009-djmount-pthread-fix.patch
+DJMOUNT_PATCH += 0010-djmount-fix-build-with-gettext-0.20.x.patch
+DJMOUNT_PATCH += 0011-djmount-libupnp-1.6.6.patch
+DJMOUNT_PATCH += 0012-djmount-libupnp-1.6.13.patch
+DJMOUNT_PATCH += 0013-djmount-avoid-crash-by-using-size_t.patch
+DJMOUNT_PATCH += 0014-djmount-enable-bigfiles.patch
DJMOUNT_PATCH += djmount-codeset.patch
-DJMOUNT_PATCH += 0011-fix-build-with-gettext-0.20.x.patch
+DJMOUNT_PATCH += djmount-upnp_util.h-fix-build.patch
# works with libupnp 1.6.25, laters maybe!
$(D)/djmount: $(D)/libfuse $(ARCHIVE)/djmount-0.71.tar.gz | $(TARGETPREFIX)
$(START_BUILD)
$(REMOVE)/djmount-0.71
- cp -fr $(ARCHIVE)/djmount-0.71 $(BUILD_TMP)
+ $(UNTAR)/djmount-0.71.tar.gz
pushd $(BUILD_TMP)/djmount-0.71 && \
$(call apply_patches, $(addprefix djmount/, $(DJMOUNT_PATCH))); \
touch libupnp/config.aux/config.rpath; \