From 18b911768cc91a8613745f5284d7c2f9ab7b349d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 19 Jul 2009 02:20:38 +0000 Subject: [PATCH] improve upnp port mapping description --- src/upnp.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/upnp.cpp b/src/upnp.cpp index 39478fc89..c7531a501 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -608,6 +608,8 @@ void upnp::create_port_mapping(http_connection& c, rootdevice& d, int i) char const* soap_action = "AddPortMapping"; + std::string local_endpoint = print_address(c.socket().local_endpoint(ec).address()); + char soap[2048]; error_code ec; snprintf(soap, sizeof(soap), "\n" @@ -620,14 +622,15 @@ void upnp::create_port_mapping(http_connection& c, rootdevice& d, int i) "%u" "%s" "1" - "%s" + "%s at %s:%d" "%u" "" , soap_action, d.service_namespace, d.mapping[i].external_port , (d.mapping[i].protocol == udp ? "UDP" : "TCP") , d.mapping[i].local_port - , print_address(c.socket().local_endpoint(ec).address()).c_str() - , m_user_agent.c_str(), d.lease_duration, soap_action); + , local_endpoint.c_str() + , m_user_agent.c_str(), local_endpoint.c_str(), d.mapping[i].local_port + , d.lease_duration, soap_action); post(d, soap, soap_action, l); }