mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
configurable UPnP name
This commit is contained in:
parent
340c73cbdf
commit
77493d0d09
|
@ -134,6 +134,7 @@ namespace config {
|
|||
options_description upnp("UPnP options");
|
||||
upnp.add_options()
|
||||
("upnp.enabled", value<bool>()->default_value(upnp_default), "Enable or disable UPnP: automatic port forwarding")
|
||||
("upnp.name", value<std::string>()->default_value("I2Pd"), "Name i2pd appears in UPnP forwardings list")
|
||||
;
|
||||
|
||||
options_description precomputation("Precomputation options");
|
||||
|
|
3
UPnP.cpp
3
UPnP.cpp
|
@ -13,6 +13,7 @@
|
|||
#include "NetDb.h"
|
||||
#include "util.h"
|
||||
#include "RouterInfo.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include <miniupnpc/miniupnpc.h>
|
||||
#include <miniupnpc/upnpcommands.h>
|
||||
|
@ -143,7 +144,7 @@ namespace transport
|
|||
{
|
||||
std::string strType (GetProto (address)), strPort (std::to_string (address->port));
|
||||
int r;
|
||||
std::string strDesc = "I2Pd";
|
||||
std::string strDesc; i2p::config::GetOption("upnp.name", strDesc);
|
||||
r = UPNP_AddPortMapping (m_upnpUrls.controlURL, m_upnpData.first.servicetype, strPort.c_str (), strPort.c_str (), m_NetworkAddr, strDesc.c_str (), strType.c_str (), 0, "0");
|
||||
if (r!=UPNPCOMMAND_SUCCESS)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue