mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 01:18:39 +00:00
upnp fixes
This commit is contained in:
parent
08ea29aa4c
commit
c857b1fbbf
1 changed files with 8 additions and 3 deletions
|
@ -129,7 +129,7 @@ void upnp::discover_device() try
|
||||||
catch (std::exception&)
|
catch (std::exception&)
|
||||||
{
|
{
|
||||||
disable();
|
disable();
|
||||||
}
|
};
|
||||||
|
|
||||||
void upnp::set_mappings(int tcp, int udp)
|
void upnp::set_mappings(int tcp, int udp)
|
||||||
{
|
{
|
||||||
|
@ -223,7 +223,7 @@ try
|
||||||
catch (std::exception&)
|
catch (std::exception&)
|
||||||
{
|
{
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void upnp::on_reply(udp::endpoint const& from, char* buffer
|
void upnp::on_reply(udp::endpoint const& from, char* buffer
|
||||||
|
@ -339,6 +339,8 @@ try
|
||||||
{
|
{
|
||||||
d.mapping[0].need_update = true;
|
d.mapping[0].need_update = true;
|
||||||
d.mapping[0].local_port = m_tcp_local_port;
|
d.mapping[0].local_port = m_tcp_local_port;
|
||||||
|
if (d.mapping[0].external_port == 0)
|
||||||
|
d.mapping[0].external_port = d.mapping[0].local_port;
|
||||||
#ifdef TORRENT_UPNP_LOGGING
|
#ifdef TORRENT_UPNP_LOGGING
|
||||||
m_log << time_now_string() << " *** Mapping 0 will be updated" << std::endl;
|
m_log << time_now_string() << " *** Mapping 0 will be updated" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
@ -347,6 +349,8 @@ try
|
||||||
{
|
{
|
||||||
d.mapping[1].need_update = true;
|
d.mapping[1].need_update = true;
|
||||||
d.mapping[1].local_port = m_udp_local_port;
|
d.mapping[1].local_port = m_udp_local_port;
|
||||||
|
if (d.mapping[1].external_port == 0)
|
||||||
|
d.mapping[1].external_port = d.mapping[1].local_port;
|
||||||
#ifdef TORRENT_UPNP_LOGGING
|
#ifdef TORRENT_UPNP_LOGGING
|
||||||
m_log << time_now_string() << " *** Mapping 1 will be updated" << std::endl;
|
m_log << time_now_string() << " *** Mapping 1 will be updated" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
@ -411,7 +415,7 @@ void upnp::post(upnp::rootdevice const& d, std::string const& soap
|
||||||
|
|
||||||
#ifdef TORRENT_UPNP_LOGGING
|
#ifdef TORRENT_UPNP_LOGGING
|
||||||
m_log << time_now_string()
|
m_log << time_now_string()
|
||||||
<< " ==> sending: " << soap << std::endl;
|
<< " ==> sending: " << header.str() << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -990,3 +994,4 @@ void upnp::close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue