changeset 4014:db2eaef22393

Update MiniUPnPc to version 2.2.8
author eMTee <emtee11@gmail.com>
date Mon, 30 Sep 2024 14:29:44 +0200
parents 1f38a55b03b3
children e6a1d534bb38
files changelog.txt dcpp/Mapper_MiniUPnPc.cpp miniupnpc/Changelog.txt miniupnpc/LICENSE miniupnpc/VERSION miniupnpc/addr_is_reserved.c miniupnpc/minisoap.c miniupnpc/minissdpc.c miniupnpc/miniupnpc.c miniupnpc/miniupnpc.h miniupnpc/miniupnpcstrings.h miniupnpc/miniwget.c miniupnpc/upnperrors.c miniupnpc/win32_snprintf.h
diffstat 14 files changed, 147 insertions(+), 130 deletions(-) [+]
line wrap: on
line diff
--- a/changelog.txt	Tue Jul 23 14:30:27 2024 +0200
+++ b/changelog.txt	Mon Sep 30 14:29:44 2024 +0200
@@ -12,6 +12,7 @@
 * Remove TLSv1.2 DHE-RSA-AES128-SHA256 ciphersuite support (cologic)
 * Increase minimum transfer segment size to 512KiB (cologic)
 * Update zlib to version 1.3.1
+* Update MiniUPnPc to version 2.2.8
 
 -- 0.881 2023-11-06 --
 * Require SSE4.2 for 64-bit builds (cologic)
--- a/dcpp/Mapper_MiniUPnPc.cpp	Tue Jul 23 14:30:27 2024 +0200
+++ b/dcpp/Mapper_MiniUPnPc.cpp	Mon Sep 30 14:29:44 2024 +0200
@@ -46,7 +46,7 @@
 	UPNPUrls urls;
 	IGDdatas data;
 
-	auto ret = UPNP_GetValidIGD(devices, &urls, &data, 0, 0);
+	auto ret = UPNP_GetValidIGD(devices, &urls, &data, 0, 0, 0, 0);
 
 	bool ok = ret == 1;
 	if(ok) {
--- a/miniupnpc/Changelog.txt	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/Changelog.txt	Mon Sep 30 14:29:44 2024 +0200
@@ -1,6 +1,37 @@
-$Id: Changelog.txt,v 1.256 2023/06/11 23:23:29 nanard Exp $
+$Id: Changelog.txt,v 1.268 2024/06/08 22:09:20 nanard Exp $
 miniUPnP client Changelog.
 
+VERSION 2.2.8 : released 2024/06/09
+
+2024/05/16:
+  IPv6: try site-local before link-local
+
+2024/05/08:
+  upnpc.c: Add -f option to upnpc program (delete multiple port redirections)
+  UPNP_GetValidIGD(): distinguish between not connected and connected to a
+    "private" network (with a reserved IP address).
+  Increments API_VERSION to 18
+
+VERSION 2.2.7 : released 2024/03/20
+
+2024/01/15:
+  listdevices.c: exit with status code 1 if no UPNP device is found
+
+2024/01/07:
+  upnpc.c: reformat Usage
+
+VERSION 2.2.6 : released 2024/01/04
+
+2024/01/04:
+  includes charset="utf-8" in Content-Type
+  fix memory allocation error in minissdpc.c
+
+2023/06/15:
+  Make User-Agent compliant.
+  listdevices => upnp-listdevices
+
+VERSION 2.2.5 : released 2023/06/12
+
 2023/06/05:
   GetListOfPortMappings NewStartPort 0 => 1
 
--- a/miniupnpc/LICENSE	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/LICENSE	Mon Sep 30 14:29:44 2024 +0200
@@ -1,6 +1,6 @@
 BSD 3-Clause License
 
-Copyright (c) 2005-2023, Thomas BERNARD
+Copyright (c) 2005-2024, Thomas BERNARD
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
--- a/miniupnpc/VERSION	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/VERSION	Mon Sep 30 14:29:44 2024 +0200
@@ -1,1 +1,1 @@
-2.2.5
+2.2.8
--- a/miniupnpc/addr_is_reserved.c	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/addr_is_reserved.c	Mon Sep 30 14:29:44 2024 +0200
@@ -1,9 +1,9 @@
-/* $Id: addr_is_reserved.c,v 1.5 2021/05/10 20:53:02 nanard Exp $ */
+/* $Id: addr_is_reserved.c,v 1.6 2024/05/08 15:58:08 nanard Exp $ */
 /* vim: tabstop=4 shiftwidth=4 noexpandtab
  * Project : miniupnp
  * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
  * Author : Thomas BERNARD
- * copyright (c) 2005-2021 Thomas Bernard
+ * copyright (c) 2005-2024 Thomas Bernard
  * This software is subjet to the conditions detailed in the
  * provided LICENSE file. */
 #ifdef _WIN32
@@ -21,6 +21,9 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #endif /* _WIN32 */
+#ifdef DEBUG
+#include <stdio.h>
+#endif
 
 /* List of IP address blocks which are private / reserved and therefore not suitable for public external IP addresses */
 #define IP(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
@@ -71,8 +74,12 @@
 	address = ntohl(addr_n);
 
 	for (i = 0; i < sizeof(reserved)/sizeof(reserved[0]); ++i) {
-		if ((address >> reserved[i].rmask) == (reserved[i].address >> reserved[i].rmask))
+		if ((address >> reserved[i].rmask) == (reserved[i].address >> reserved[i].rmask)) {
+#ifdef DEBUG
+			printf("IP address %s is reserved\n", addr_str);
+#endif
 			return 1;
+		}
 	}
 
 	return 0;
--- a/miniupnpc/minisoap.c	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/minisoap.c	Mon Sep 30 14:29:44 2024 +0200
@@ -1,8 +1,8 @@
-/* $Id: minisoap.c,v 1.30 2020/11/09 19:27:42 nanard Exp $ */
+/* $Id: minisoap.c,v 1.34 2024/06/04 23:50:49 nanard Exp $ */
 /* vim: tabstop=4 shiftwidth=4 noexpandtab
  * Project : miniupnp
  * Author : Thomas Bernard
- * Copyright (c) 2005-2020 Thomas Bernard
+ * Copyright (c) 2005-2024 Thomas Bernard
  * This software is subject to the conditions detailed in the
  * LICENCE file provided in this distribution.
  *
@@ -83,20 +83,23 @@
 	 * Using HTTP/1.1 means we need to support chunked transfer-encoding :
 	 * When using HTTP/1.1, the router "BiPAC 7404VNOX" always use chunked
 	 * transfer encoding. */
-    /* Connection: Close is normally there only in HTTP/1.1 but who knows */
+    /* Connection: close is normally there only in HTTP/1.1 but who knows */
 	portstr[0] = '\0';
 	if(port != 80)
 		snprintf(portstr, sizeof(portstr), ":%hu", port);
 	headerssize = snprintf(headerbuf, sizeof(headerbuf),
                        "POST %s HTTP/%s\r\n"
 	                   "Host: %s%s\r\n"
-					   "User-Agent: " OS_STRING ", " UPNP_VERSION_STRING ", MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
+					   "User-Agent: " OS_STRING " " UPNP_VERSION_STRING " MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
 	                   "Content-Length: %d\r\n"
+#if (UPNP_VERSION_MAJOR == 1) && (UPNP_VERSION_MINOR == 0)
 					   "Content-Type: text/xml\r\n"
+#else
+					   "Content-Type: text/xml; charset=\"utf-8\"\r\n"
+#endif
 					   "SOAPAction: \"%s\"\r\n"
-					   "Connection: Close\r\n"
+					   "Connection: close\r\n"
 					   "Cache-Control: no-cache\r\n"	/* ??? */
-					   "Pragma: no-cache\r\n"
 					   "\r\n",
 					   url, httpversion, host, portstr, bodysize, action);
 	if ((unsigned int)headerssize >= sizeof(headerbuf))
--- a/miniupnpc/minissdpc.c	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/minissdpc.c	Mon Sep 30 14:29:44 2024 +0200
@@ -1,9 +1,9 @@
-/* $Id: minissdpc.c,v 1.49 2021/05/13 11:00:36 nanard Exp $ */
+/* $Id: minissdpc.c,v 1.51 2024/05/16 00:12:05 nanard Exp $ */
 /* vim: tabstop=4 shiftwidth=4 noexpandtab
  * Project : miniupnp
  * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
  * Author : Thomas BERNARD
- * copyright (c) 2005-2021 Thomas Bernard
+ * copyright (c) 2005-2024 Thomas Bernard
  * This software is subjet to the conditions detailed in the
  * provided LICENCE file. */
 #include <stdio.h>
@@ -338,7 +338,7 @@
 #ifdef DEBUG
 		printf("   usnsize=%u\n", usnsize);
 #endif /* DEBUG */
-		tmp = (struct UPNPDev *)malloc(sizeof(struct UPNPDev)+urlsize+stsize+usnsize);
+		tmp = (struct UPNPDev *)malloc(sizeof(struct UPNPDev)+urlsize+stsize+usnsize+3);
 		if(tmp == NULL) {
 			if (error)
 				*error = MINISSDPC_MEMORY_ERROR;
@@ -548,7 +548,7 @@
 #ifdef _WIN32
 	unsigned long _ttl = (unsigned long)ttl;
 #endif
-	int linklocal = 1;
+	int linklocal = 0;	/* try first with site-local multicast */
 	int sentok;
 
 	if(error)
@@ -1007,9 +1007,10 @@
 			/* switch linklocal flag */
 			if(linklocal) {
 				linklocal = 0;
+			} else {
+				/* try again with linklocal multicast */
+				linklocal = 1;
 				--deviceIndex;
-			} else {
-				linklocal = 1;
 			}
 		}
 	}
--- a/miniupnpc/miniupnpc.c	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/miniupnpc.c	Mon Sep 30 14:29:44 2024 +0200
@@ -1,9 +1,9 @@
-/* $Id: miniupnpc.c,v 1.159 2021/03/02 23:36:32 nanard Exp $ */
+/* $Id: miniupnpc.c,v 1.162 2024/06/05 00:06:54 nanard Exp $ */
 /* vim: tabstop=4 shiftwidth=4 noexpandtab
  * Project : miniupnp
  * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
  * Author : Thomas BERNARD
- * copyright (c) 2005-2021 Thomas Bernard
+ * copyright (c) 2005-2024 Thomas Bernard
  * This software is subjet to the conditions detailed in the
  * provided LICENSE file. */
 #include <stdlib.h>
@@ -92,15 +92,15 @@
 #endif
 }
 
-/* simpleUPnPcommand2 :
+/* simpleUPnPcommand :
  * not so simple !
  * return values :
  *   pointer - OK
  *   NULL - error */
-static char *
-simpleUPnPcommand2(SOCKET s, const char * url, const char * service,
-                   const char * action, struct UPNParg * args,
-                   int * bufsize, const char * httpversion)
+char *
+simpleUPnPcommand(int s, const char * url, const char * service,
+                  const char * action, struct UPNParg * args,
+                  int * bufsize)
 {
 	char hostname[MAXHOSTNAMELEN+1];
 	unsigned short port = 0;
@@ -197,15 +197,15 @@
 			return NULL;
 	}
 	if(!parseURL(url, hostname, &port, &path, NULL)) return NULL;
-	if(ISINVALID(s)) {
+	if(ISINVALID((SOCKET)s)) {
 		s = connecthostport(hostname, port, 0);
-		if(ISINVALID(s)) {
+		if(ISINVALID((SOCKET)s)) {
 			/* failed to connect */
 			return NULL;
 		}
 	}
 
-	n = soapPostSubmit(s, path, hostname, port, soapact, soapbody, httpversion);
+	n = soapPostSubmit(s, path, hostname, port, soapact, soapbody, "1.1");
 	if(n<=0) {
 #ifdef DEBUG
 		printf("Error sending SOAP request\n");
@@ -229,33 +229,6 @@
 	return buf;
 }
 
-/* simpleUPnPcommand :
- * not so simple !
- * return values :
- *   pointer - OK
- *   NULL    - error */
-char *
-simpleUPnPcommand(int s, const char * url, const char * service,
-                  const char * action, struct UPNParg * args,
-                  int * bufsize)
-{
-	char * buf;
-
-#if 1
-	buf = simpleUPnPcommand2((SOCKET)s, url, service, action, args, bufsize, "1.1");
-#else
-	buf = simpleUPnPcommand2((SOCKET)s, url, service, action, args, bufsize, "1.0");
-	if (!buf || *bufsize == 0)
-	{
-#if DEBUG
-	    printf("Error or no result from SOAP request; retrying with HTTP/1.1\n");
-#endif
-		buf = simpleUPnPcommand2((SOCKET)s, url, service, action, args, bufsize, "1.1");
-	}
-#endif
-	return buf;
-}
-
 /* upnpDiscoverDevices() :
  * return a chained list of all devices found or NULL if
  * no devices was found.
@@ -534,9 +507,11 @@
  *    -1 = Internal error
  *     0 = NO IGD found
  *     1 = A valid connected IGD has been found
- *     2 = A valid IGD has been found but it reported as
+ *     2 = A valid connected IGD has been found but its
+ *         IP address is reserved (non routable)
+ *     3 = A valid IGD has been found but it reported as
  *         not connected
- *     3 = an UPnP device has been found but was not recognized as an IGD
+ *     4 = an UPnP device has been found but was not recognized as an IGD
  *
  * In any positive non zero return case, the urls and data structures
  * passed as parameters are set. Don't forget to call FreeUPNPUrls(urls) to
@@ -545,11 +520,13 @@
 MINIUPNP_LIBSPEC int
 UPNP_GetValidIGD(struct UPNPDev * devlist,
                  struct UPNPUrls * urls,
-				 struct IGDdatas * data,
-				 char * lanaddr, int lanaddrlen)
+                 struct IGDdatas * data,
+                 char * lanaddr, int lanaddrlen,
+                 char * wanaddr, int wanaddrlen)
 {
 	struct xml_desc {
 		char lanaddr[40];
+		char wanaddr[40];
 		char * xml;
 		int size;
 		int is_igd;
@@ -557,8 +534,8 @@
 	struct UPNPDev * dev;
 	int ndev = 0;
 	int i;
-	int state = -1; /* state 1 : IGD connected. State 2 : IGD. State 3 : anything */
-	char extIpAddr[16];
+	int state = -1; /* state 1 : IGD connected. State 2 : connected with reserved IP.
+	                 * State 3 : IGD. State 4 : anything */
 	int status_code = -1;
 
 	if(!devlist)
@@ -602,7 +579,7 @@
 		}
 	}
 	/* iterate the list to find a device depending on state */
-	for(state = 1; state <= 3; state++)
+	for(state = 1; state <= 4; state++)
 	{
 		for(dev = devlist, i = 0; dev; dev = dev->pNext, i++)
 		{
@@ -611,14 +588,14 @@
 				memset(data, 0, sizeof(struct IGDdatas));
 				memset(urls, 0, sizeof(struct UPNPUrls));
 				parserootdesc(desc[i].xml, desc[i].size, data);
-				if(desc[i].is_igd || state >= 3 )
+				if(desc[i].is_igd || state >= 4 )
 				{
 				  int is_connected;
 
 				  GetUPNPUrls(urls, data, dev->descURL, dev->scope_id);
 
-				  /* in state 2 and 3 we don't test if device is connected ! */
-				  if(state >= 2)
+				  /* in state 3 and 4 we don't test if device is connected ! */
+				  if(state >= 3)
 				    goto free_and_return;
 				  is_connected = UPNPIGD_IsConnected(urls, data);
 #ifdef DEBUG
@@ -626,9 +603,11 @@
 				     urls->controlURL, is_connected);
 #endif
 				  /* checks that status is connected AND there is a external IP address assigned */
-				  if(is_connected &&
-				     (UPNP_GetExternalIPAddress(urls->controlURL,  data->first.servicetype, extIpAddr) == 0)) {
-					if(!addr_is_reserved(extIpAddr))
+				  if(is_connected) {
+					if(state >= 2)
+					  goto free_and_return;
+				    if(UPNP_GetExternalIPAddress(urls->controlURL, data->first.servicetype, desc[i].wanaddr) == 0
+					   && !addr_is_reserved(desc[i].wanaddr))
 					  goto free_and_return;
 				  }
 				  FreeUPNPUrls(urls);
@@ -647,9 +626,11 @@
 				    printf("UPNPIGD_IsConnected(%s) = %d\n",
 				       urls->controlURL, is_connected);
 #endif
-				    if(is_connected &&
-				       (UPNP_GetExternalIPAddress(urls->controlURL,  data->first.servicetype, extIpAddr) == 0)) {
-					  if(!addr_is_reserved(extIpAddr))
+				    if(is_connected) {
+					  if(state >= 2)
+					    goto free_and_return;
+				      if(UPNP_GetExternalIPAddress(urls->controlURL, data->first.servicetype, desc[i].wanaddr) == 0
+					     && !addr_is_reserved(desc[i].wanaddr))
 					    goto free_and_return;
 				    }
 				    FreeUPNPUrls(urls);
@@ -661,8 +642,12 @@
 	}
 	state = 0;
 free_and_return:
-	if (lanaddr != NULL && state >= 1 && state <= 3 && i < ndev)
-		strncpy(lanaddr, desc[i].lanaddr, lanaddrlen);
+	if (state >= 1 && state <= 4 && i < ndev) {
+		if (lanaddr != NULL)
+			strncpy(lanaddr, desc[i].lanaddr, lanaddrlen);
+		if (wanaddr != NULL)
+			strncpy(wanaddr, desc[i].wanaddr, wanaddrlen);
+	}
 	for(i = 0; i < ndev; i++)
 		free(desc[i].xml);
 	free(desc);
--- a/miniupnpc/miniupnpc.h	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/miniupnpc.h	Mon Sep 30 14:29:44 2024 +0200
@@ -1,9 +1,9 @@
-/* $Id: miniupnpc.h,v 1.61 2022/10/21 21:15:02 nanard Exp $ */
+/* $Id: miniupnpc.h,v 1.65 2024/05/08 15:58:10 nanard Exp $ */
 /* vim: tabstop=4 shiftwidth=4 noexpandtab
  * Project: miniupnp
  * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
  * Author: Thomas Bernard
- * Copyright (c) 2005-2022 Thomas Bernard
+ * Copyright (c) 2005-2024 Thomas Bernard
  * This software is subjects to the conditions detailed
  * in the LICENCE file provided within this distribution */
 #ifndef MINIUPNPC_H_INCLUDED
@@ -20,8 +20,8 @@
 #define UPNPDISCOVER_MEMORY_ERROR (-102)
 
 /* versions : */
-#define MINIUPNPC_VERSION	"2.2.5"
-#define MINIUPNPC_API_VERSION	17
+#define MINIUPNPC_VERSION	"2.2.8"
+#define MINIUPNPC_API_VERSION	18
 
 /* Source port:
    Using "1" as an alias for 1900 for backwards compatibility
@@ -108,9 +108,11 @@
  * return values :
  *     0 = NO IGD found
  *     1 = A valid connected IGD has been found
- *     2 = A valid IGD has been found but it reported as
+ *     2 = A valid connected IGD has been found but its
+ *         IP address is reserved (non routable)
+ *     3 = A valid IGD has been found but it reported as
  *         not connected
- *     3 = an UPnP device has been found but was not recognized as an IGD
+ *     4 = an UPnP device has been found but was not recognized as an IGD
  *
  * In any non zero return case, the urls and data structures
  * passed as parameters are set. Donc forget to call FreeUPNPUrls(urls) to
@@ -119,8 +121,9 @@
 MINIUPNP_LIBSPEC int
 UPNP_GetValidIGD(struct UPNPDev * devlist,
                  struct UPNPUrls * urls,
-				 struct IGDdatas * data,
-				 char * lanaddr, int lanaddrlen);
+                 struct IGDdatas * data,
+                 char * lanaddr, int lanaddrlen,
+                 char * wanaddr, int wanaddrlen);
 
 /* UPNP_GetIGDFromUrl()
  * Used when skipping the discovery process.
--- a/miniupnpc/miniupnpcstrings.h	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/miniupnpcstrings.h	Mon Sep 30 14:29:44 2024 +0200
@@ -1,4 +1,4 @@
-/* $Id: miniupnpcstrings.h.in,v 1.6 2014/11/04 22:31:55 nanard Exp $ */
+/* $Id: miniupnpcstrings.h.in,v 1.7 2023/07/05 22:43:50 nanard Exp $ */
 /* Project: miniupnp
  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
  * Author: Thomas Bernard
@@ -13,13 +13,17 @@
 #else
 #define OS_STRING "Generic/1"
 #endif
-#define MINIUPNPC_VERSION_STRING "2.2.5"
+#define MINIUPNPC_VERSION_STRING "2.2.8"
 
 #if 0
 /* according to "UPnP Device Architecture 1.0" */
+#define UPNP_VERSION_MAJOR 1
+#define UPNP_VERSION_MINOR 0 
 #define UPNP_VERSION_STRING "UPnP/1.0"
 #else
 /* according to "UPnP Device Architecture 1.1" */
+#define UPNP_VERSION_MAJOR 1
+#define UPNP_VERSION_MINOR 1 
 #define UPNP_VERSION_STRING "UPnP/1.1"
 #endif
 
--- a/miniupnpc/miniwget.c	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/miniwget.c	Mon Sep 30 14:29:44 2024 +0200
@@ -1,8 +1,8 @@
-/* $Id: miniwget.c,v 1.84 2020/11/09 19:41:18 nanard Exp $ */
+/* $Id: miniwget.c,v 1.87 2024/06/04 23:52:36 nanard Exp $ */
 /* Project : miniupnp
  * Website : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
  * Author : Thomas Bernard
- * Copyright (c) 2005-2020 Thomas Bernard
+ * Copyright (c) 2005-2024 Thomas Bernard
  * This software is subject to the conditions detailed in the
  * LICENCE file provided in this distribution. */
 
@@ -446,9 +446,8 @@
 	len = snprintf(buf, sizeof(buf),
                  "GET %s HTTP/%s\r\n"
 			     "Host: %s:%d\r\n"
-				 "Connection: Close\r\n"
-				 "User-Agent: " OS_STRING ", " UPNP_VERSION_STRING ", MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
-
+				 "Connection: close\r\n"
+				 "User-Agent: " OS_STRING " " UPNP_VERSION_STRING " MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
 				 "\r\n",
 			   path, httpversion, host, port);
 	if ((unsigned int)len >= sizeof(buf))
@@ -477,41 +476,6 @@
 	return content;
 }
 
-/* miniwget2() :
- * Call miniwget3(); retry with HTTP/1.1 if 1.0 fails. */
-static void *
-miniwget2(const char * host,
-          unsigned short port, const char * path,
-          int * size, char * addr_str, int addr_str_len,
-          unsigned int scope_id, int * status_code)
-{
-	char * respbuffer;
-
-#if 1
-	respbuffer = miniwget3(host, port, path, size,
-	                       addr_str, addr_str_len, "1.1",
-	                       scope_id, status_code);
-#else
-	respbuffer = miniwget3(host, port, path, size,
-	                       addr_str, addr_str_len, "1.0",
-	                       scope_id, status_code);
-	if (*size == 0)
-	{
-#ifdef DEBUG
-		printf("Retrying with HTTP/1.1\n");
-#endif
-		free(respbuffer);
-		respbuffer = miniwget3(host, port, path, size,
-		                       addr_str, addr_str_len, "1.1",
-		                       scope_id, status_code);
-	}
-#endif
-	return respbuffer;
-}
-
-
-
-
 /* parseURL()
  * arguments :
  *   url :		source string not modified
@@ -642,7 +606,7 @@
 	printf("parsed url : hostname='%s' port=%hu path='%s' scope_id=%u\n",
 	       hostname, port, path, scope_id);
 #endif
-	return miniwget2(hostname, port, path, size, 0, 0, scope_id, status_code);
+	return miniwget3(hostname, port, path, size, 0, 0, "1.1", scope_id, status_code);
 }
 
 void *
@@ -663,5 +627,5 @@
 	printf("parsed url : hostname='%s' port=%hu path='%s' scope_id=%u\n",
 	       hostname, port, path, scope_id);
 #endif
-	return miniwget2(hostname, port, path, size, addr, addrlen, scope_id, status_code);
+	return miniwget3(hostname, port, path, size, addr, addrlen, "1.1", scope_id, status_code);
 }
--- a/miniupnpc/upnperrors.c	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/upnperrors.c	Mon Sep 30 14:29:44 2024 +0200
@@ -1,4 +1,4 @@
-/* $Id: upnperrors.c,v 1.11 2023/05/29 21:59:15 nanard Exp $ */
+/* $Id: upnperrors.c,v 1.12 2023/06/26 23:19:28 nanard Exp $ */
 /* vim: tabstop=4 shiftwidth=4 noexpandtab
  * Project : miniupnp
  * Author : Thomas BERNARD
@@ -93,7 +93,7 @@
 		s = "InvalidLayer2Address";
 		break;
 	case 709:
-		s = "NoPacketSent";
+		s = "NoTrafficReceived";
 		break;
 	case 713:
 		s = "SpecifiedArrayIndexInvalid";
@@ -122,6 +122,24 @@
 	case 727:
 		s = "ExternalPortOnlySupportsWildcard";
 		break;
+	case 728:
+		s = "NoPortMapsAvailable";
+		break;
+	case 729:
+		s = "ConflictWithOtherMechanisms";
+		break;
+	case 730:
+		s = "PortMappingNotFound";
+		break;
+	case 731:
+		s = "ReadOnly";
+		break;
+	case 732:
+		s = "WildCardNotPermittedInIntPort";
+		break;
+	case 733:
+		s = "InconsistentParameters";
+		break;
 	default:
 		s = "UnknownError";
 		break;
--- a/miniupnpc/win32_snprintf.h	Tue Jul 23 14:30:27 2024 +0200
+++ b/miniupnpc/win32_snprintf.h	Mon Sep 30 14:29:44 2024 +0200
@@ -23,9 +23,9 @@
 	(defined(_MSC_VER) && _MSC_VER < 1900) /* Visual Studio older than 2015 */ || \
 	(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) && defined(__NO_ISOCEXT)) /* mingw32 without iso c ext */ || \
 	(defined(__MINGW64_VERSION_MAJOR) && /* mingw-w64 not ... */ !( \
-		(defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO != 0)) /* ... with ansi stdio */ || \
+		(defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO != 0) /* ... with ansi stdio */ || \
 		(__MINGW64_VERSION_MAJOR >= 6 && defined(_UCRT)) /* ... at least 6.0.0 with ucrt */ || \
-		(__MINGW64_VERSION_MAJOR >= 8 && !defined(__NO_ISOCEXT)) /* ... at least 8.0.0 with iso c ext */ || \
+		(__MINGW64_VERSION_MAJOR >= 8 && !defined(__NO_ISOCEXT))) /* ... at least 8.0.0 with iso c ext */ || \
 	0) || \
 0)