diff options
author | Stuart Cardall <developer@it-offshore.co.uk> | 2014-06-24 22:42:15 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-06-25 14:48:50 +0000 |
commit | 23416aa0131a4ac39a11b5d97497564003138966 (patch) | |
tree | bb2ff12f1d963ce0ef79231a380660e427daca38 /testing/namecoin/12-fix-miniupnpc.patch | |
parent | 0e05b58d1e8dfe579949be7ab83b4ba698214bf3 (diff) | |
download | aports-23416aa0131a4ac39a11b5d97497564003138966.tar.bz2 aports-23416aa0131a4ac39a11b5d97497564003138966.tar.xz |
testing/namecoin: update to 0.3.75 +QT5
Also patched to build with QT5
Diffstat (limited to 'testing/namecoin/12-fix-miniupnpc.patch')
-rw-r--r-- | testing/namecoin/12-fix-miniupnpc.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/testing/namecoin/12-fix-miniupnpc.patch b/testing/namecoin/12-fix-miniupnpc.patch new file mode 100644 index 000000000..c911f0a8b --- /dev/null +++ b/testing/namecoin/12-fix-miniupnpc.patch @@ -0,0 +1,61 @@ +--- namecoin-nc0.3.75/src/net.cpp ++++ namecoin-nc0.3.75/src/net.cpp.new +@@ -19,10 +19,10 @@ + #endif + + #ifdef USE_UPNP +-#include <miniwget.h> +-#include <miniupnpc.h> +-#include <upnpcommands.h> +-#include <upnperrors.h> ++#include <miniupnpc/miniwget.h> ++#include <miniupnpc/miniupnpc.h> ++#include <miniupnpc/upnpcommands.h> ++#include <miniupnpc/upnperrors.h> + #endif + + using namespace std; +@@ -1088,8 +1088,7 @@ + { + printf("ThreadMapPort started\n"); + +- char port[6]; +- sprintf(port, "%d", GetListenPort()); ++ std::string port = strprintf("%u", GetListenPort()); + + const char * rootdescurl = 0; + const char * multicastif = 0; +@@ -1113,25 +1112,26 @@ + r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr)); + if (r == 1) + { +- char intClient[16]; +- char intPort[6]; ++ string strDesc = "Namecoin " + FormatFullVersion(); + +-#if !defined(__WXMSW__) && !defined(MAC_OSX) ++#ifndef UPNPDISCOVER_SUCCESS ++ /* miniupnpc 1.5 */ + r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, +- port, port, lanaddr, 0, "TCP", 0); ++ port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0); + #else ++ /* miniupnpc 1.6 */ + r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, +- port, port, lanaddr, 0, "TCP", 0, "0"); ++ port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0"); + #endif + if(r!=UPNPCOMMAND_SUCCESS) + printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", +- port, port, lanaddr, r, strupnperror(r)); ++ port.c_str(), port.c_str(), lanaddr, r, strupnperror(r)); + else + printf("UPnP Port Mapping successful.\n"); + loop { + if (fShutdown || !fUseUPnP) + { +- r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port, "TCP", 0); ++ r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0); + printf("UPNP_DeletePortMapping() returned : %d\n", r); + freeUPNPDevlist(devlist); devlist = 0; + FreeUPNPUrls(&urls); |