mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-29 00:44:08 +02:00
depends: miniupnpc 2.2.7
Includes a temporary patch to fix the Windows Autotools build. See https://miniupnp.tuxfamily.org/files/changelog.php?file=miniupnpc-2.2.7.tar.gz.
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
commit 8815452257437ba36607d0e2381c01142d1c7bb0
|
||||
commit 51f6dd991c29af66fb4f64c6feb2787cce23a1a7
|
||||
Author: fanquake <fanquake@gmail.com>
|
||||
Date: Thu Nov 19 10:51:19 2020 +0800
|
||||
Date: Mon Jan 8 11:21:40 2024 +0000
|
||||
|
||||
Don't leak OS and miniupnpc version info in User-Agent
|
||||
|
||||
diff --git a//minisoap.c b/minisoap.c
|
||||
index 7860667..775580b 100644
|
||||
--- a/minisoap.c
|
||||
+++ b/minisoap.c
|
||||
diff --git a/src/minisoap.c b/src/minisoap.c
|
||||
index 903ac5f..046e0ea 100644
|
||||
--- a/src/minisoap.c
|
||||
+++ b/src/minisoap.c
|
||||
@@ -90,7 +90,7 @@ int soapPostSubmit(SOCKET fd,
|
||||
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"
|
||||
+ "User-Agent: " UPNP_VERSION_STRING "\r\n"
|
||||
"Content-Length: %d\r\n"
|
||||
#if (UPNP_VERSION_MAJOR == 1) && (UPNP_VERSION_MINOR == 0)
|
||||
"Content-Type: text/xml\r\n"
|
||||
"SOAPAction: \"%s\"\r\n"
|
||||
diff --git a/miniwget.c b/miniwget.c
|
||||
index d5b7970..05aeb9c 100644
|
||||
--- a/miniwget.c
|
||||
+++ b/miniwget.c
|
||||
diff --git a/src/miniwget.c b/src/miniwget.c
|
||||
index e76a5e5..0cc36fe 100644
|
||||
--- a/src/miniwget.c
|
||||
+++ b/src/miniwget.c
|
||||
@@ -444,7 +444,7 @@ miniwget3(const char * host,
|
||||
"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"
|
||||
- "User-Agent: " OS_STRING " " UPNP_VERSION_STRING " MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
|
||||
+ "User-Agent: " UPNP_VERSION_STRING "\r\n"
|
||||
|
||||
"\r\n",
|
||||
|
143
depends/patches/miniupnpc/fix_windows_build.patch
Normal file
143
depends/patches/miniupnpc/fix_windows_build.patch
Normal file
@@ -0,0 +1,143 @@
|
||||
build: Temporary patch to make Windows compile
|
||||
|
||||
--- a/Makefile.mingw
|
||||
+++ b/Makefile.mingw
|
||||
@@ -9,10 +9,12 @@
|
||||
#
|
||||
SRCDIR = src
|
||||
INCDIR = include
|
||||
+BUILD = build
|
||||
|
||||
CC ?= gcc
|
||||
SETUP_COMPILER_FLAG?=
|
||||
DLLWRAP = dllwrap
|
||||
+MKDIR = mkdir -p
|
||||
WINDRES = windres
|
||||
SH = /bin/sh
|
||||
ZIP = zip
|
||||
@@ -26,24 +28,25 @@ CFLAGS ?= -Os
|
||||
CFLAGS += -Wall
|
||||
CFLAGS += -W -Wstrict-prototypes
|
||||
|
||||
-CPPFLAGS += -DNDEBUG -D_WIN32_WINNT=0x501
|
||||
+CPPFLAGS += -DNDEBUG -D_WIN32_WINNT=0x601
|
||||
CPPFLAGS += -Iinclude
|
||||
CPPFLAGS += -I.
|
||||
+CPPFLAGS += -I$(BUILD)
|
||||
|
||||
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()
|
||||
LDLIBS = -lws2_32 -liphlpapi
|
||||
|
||||
PYTHON=\utils\python25\python
|
||||
-OBJS=miniwget.o minixml.o igd_desc_parse.o minisoap.o \
|
||||
+OBJS=$(addprefix $(BUILD)/,miniwget.o minixml.o igd_desc_parse.o minisoap.o \
|
||||
minissdpc.o \
|
||||
miniupnpc.o upnpreplyparse.o upnpcommands.o upnperrors.o \
|
||||
connecthostport.o portlistingparse.o receivedata.o \
|
||||
- upnpdev.o addr_is_reserved.o
|
||||
+ upnpdev.o addr_is_reserved.o)
|
||||
OBJSDLL=$(addprefix dll-, $(OBJS)) winres.o
|
||||
-BINARIES=upnpc-static.exe upnpc-shared.exe \
|
||||
+BINARIES=$(addprefix $(BUILD)/,upnpc-static.exe upnpc-shared.exe \
|
||||
upnp-listdevices-static.exe upnp-listdevices-shared.exe \
|
||||
miniupnpc.dll libminiupnpc.a \
|
||||
- testminixml.exe
|
||||
+ testminixml.exe)
|
||||
ifneq ($(GITHUB_SHA),)
|
||||
COMMITREF=$(GITHUB_SHA)
|
||||
else
|
||||
@@ -76,11 +79,12 @@ clean:
|
||||
$(RM) miniupnpc.dll miniupnpc.lib miniupnpc.dll.def
|
||||
$(RM) libminiupnpc.a
|
||||
$(RM) $(DISTFILE)
|
||||
+ $(RM) -r build/
|
||||
|
||||
$(DISTFILE): $(BINARIES)
|
||||
$(ZIP) $@ *.exe *.dll *.lib *.def *.a LICENSE README Changelog.txt
|
||||
|
||||
-libminiupnpc.a: $(OBJS)
|
||||
+$(BUILD)/libminiupnpc.a: $(OBJS)
|
||||
$(AR) cr $@ $?
|
||||
|
||||
pythonmodule: libminiupnpc.a
|
||||
@@ -97,13 +101,13 @@ miniupnpc.dll: miniupnpc.def $(OBJSDLL)
|
||||
|
||||
miniupnpc.lib: miniupnpc.dll
|
||||
|
||||
-%.o: $(SRCDIR)/%.c
|
||||
+$(BUILD)/%.o: $(SRCDIR)/%.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -DMINIUPNP_STATICLIB -c -o $@ $<
|
||||
|
||||
-dll-%.o: $(SRCDIR)/%.c
|
||||
+$(BUILD)/dll-%.o: $(SRCDIR)/%.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -DMINIUPNP_EXPORTS -c -o $@ $<
|
||||
|
||||
-%-shared.o: $(SRCDIR)/%.c
|
||||
+$(BUILD)/%-shared.o: $(SRCDIR)/%.c
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||
|
||||
# --enable-stdcall-fixup
|
||||
@@ -131,7 +135,8 @@ miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings.exe VERSION
|
||||
|
||||
rc_version.h: miniupnpcstrings.h
|
||||
else
|
||||
-miniupnpcstrings.h: miniupnpcstrings.h.in VERSION
|
||||
+$(BUILD)/miniupnpcstrings.h: miniupnpcstrings.h.in VERSION
|
||||
+ @$(MKDIR) $(@D)
|
||||
sed 's|OS_STRING ".*"|OS_STRING "Windows/Mingw32"|' $< | \
|
||||
sed 's|MINIUPNPC_VERSION_STRING ".*"|MINIUPNPC_VERSION_STRING "$(shell cat VERSION)"|' > $@
|
||||
|
||||
@@ -143,7 +148,7 @@ rc_version.h: VERSION
|
||||
mv $@.tmp $@
|
||||
endif
|
||||
|
||||
-miniupnpc.pc: VERSION
|
||||
+$(BUILD)/miniupnpc.pc: VERSION
|
||||
$(RM) $@
|
||||
echo "prefix=$(INSTALLPREFIX)" >> $@
|
||||
echo "exec_prefix=\$${prefix}" >> $@
|
||||
@@ -156,32 +161,32 @@ miniupnpc.pc: VERSION
|
||||
echo "Libs: -L\$${libdir} -lminiupnpc" >> $@
|
||||
echo "Cflags: -I\$${includedir}" >> $@
|
||||
|
||||
-winres.o: miniupnpc.rc rc_version.h
|
||||
+$(BUILD)/winres.o: miniupnpc.rc rc_version.h
|
||||
$(WINDRES) -D INTERNAL_NAME=\\\"miniupnpc.dll\\0\\\" -i $< -o $@
|
||||
|
||||
testminixml.exe: testminixml.o minixml.o igd_desc_parse.o
|
||||
$(CC) -static -o $@ $^
|
||||
|
||||
-minixml.o: $(SRCDIR)/minixml.c $(SRCDIR)/minixml.h
|
||||
+$(BUILD)/minixml.o: $(SRCDIR)/minixml.c $(SRCDIR)/minixml.h
|
||||
|
||||
-upnpc.o: include/miniwget.h $(SRCDIR)/minisoap.h include/miniupnpc.h include/igd_desc_parse.h
|
||||
-upnpc.o: include/upnpreplyparse.h include/upnpcommands.h include/upnperrors.h miniupnpcstrings.h
|
||||
+$(BUILD)/upnpc.o: include/miniwget.h $(SRCDIR)/minisoap.h include/miniupnpc.h include/igd_desc_parse.h
|
||||
+$(BUILD)/upnpc.o: include/upnpreplyparse.h include/upnpcommands.h include/upnperrors.h miniupnpcstrings.h
|
||||
|
||||
-miniwget.o: $(SRCDIR)/miniwget.c include/miniwget.h miniupnpcstrings.h $(SRCDIR)/connecthostport.h
|
||||
+$(BUILD)/miniwget.o: $(SRCDIR)/miniwget.c include/miniwget.h $(BUILD)/miniupnpcstrings.h $(SRCDIR)/connecthostport.h
|
||||
|
||||
-minisoap.o: $(SRCDIR)/minisoap.c $(SRCDIR)/minisoap.h miniupnpcstrings.h
|
||||
+$(BUILD)/minisoap.o: $(SRCDIR)/minisoap.c $(SRCDIR)/minisoap.h $(BUILD)/miniupnpcstrings.h
|
||||
|
||||
-miniupnpc.o: $(SRCDIR)/miniupnpc.c include/miniupnpc.h $(SRCDIR)/minisoap.h \
|
||||
+$(BUILD)/miniupnpc.o: $(SRCDIR)/miniupnpc.c include/miniupnpc.h $(SRCDIR)/minisoap.h \
|
||||
include/miniwget.h $(SRCDIR)/minixml.h $(SRCDIR)/addr_is_reserved.h
|
||||
|
||||
-igd_desc_parse.o: $(SRCDIR)/igd_desc_parse.c include/igd_desc_parse.h
|
||||
+$(BUILD)/igd_desc_parse.o: $(SRCDIR)/igd_desc_parse.c include/igd_desc_parse.h
|
||||
|
||||
-upnpreplyparse.o: $(SRCDIR)/upnpreplyparse.c include/upnpreplyparse.h $(SRCDIR)/minixml.h
|
||||
+$(BUILD)/upnpreplyparse.o: $(SRCDIR)/upnpreplyparse.c include/upnpreplyparse.h $(SRCDIR)/minixml.h
|
||||
|
||||
-upnpcommands.o: $(SRCDIR)/upnpcommands.c include/upnpcommands.h include/upnpreplyparse.h \
|
||||
+$(BUILD)/upnpcommands.o: $(SRCDIR)/upnpcommands.c include/upnpcommands.h include/upnpreplyparse.h \
|
||||
include/miniupnpc.h include/portlistingparse.h
|
||||
|
||||
-minissdpc.o: $(SRCDIR)/minissdpc.c $(SRCDIR)/minissdpc.h $(SRCDIR)/receivedata.h
|
||||
+$(BUILD)/minissdpc.o: $(SRCDIR)/minissdpc.c $(SRCDIR)/minissdpc.h $(SRCDIR)/receivedata.h
|
||||
|
||||
-upnpdev.o: $(SRCDIR)/upnpdev.c include/upnpdev.h
|
||||
+$(BUILD)/upnpdev.o: $(SRCDIR)/upnpdev.c include/upnpdev.h
|
||||
|
@@ -1,23 +0,0 @@
|
||||
commit fec515a7ac9991a0ee91068fda046b54b191155e
|
||||
Author: fanquake <fanquake@gmail.com>
|
||||
Date: Wed Jul 27 15:52:37 2022 +0100
|
||||
|
||||
build: respect CFLAGS in makefile.mingw
|
||||
|
||||
Similar to the other Makefile.
|
||||
|
||||
Cherry-pick of https://github.com/miniupnp/miniupnp/pull/619.
|
||||
|
||||
diff --git a/Makefile.mingw b/Makefile.mingw
|
||||
index 2bff7bd..88430d2 100644
|
||||
--- a/Makefile.mingw
|
||||
+++ b/Makefile.mingw
|
||||
@@ -19,7 +19,7 @@ else
|
||||
RM = rm -f
|
||||
endif
|
||||
#CFLAGS = -Wall -g -DDEBUG -D_WIN32_WINNT=0X501
|
||||
-CFLAGS = -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501
|
||||
+CFLAGS ?= -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501
|
||||
LDLIBS = -lws2_32 -liphlpapi
|
||||
# -lwsock32
|
||||
# -liphlpapi is needed for GetBestRoute() and GetIpAddrTable()
|
Reference in New Issue
Block a user