forked from premiere/premiere-libtorrent
upnp fix
This commit is contained in:
parent
0d03e5721a
commit
e51d9b9590
20
src/upnp.cpp
20
src/upnp.cpp
|
@ -258,7 +258,7 @@ try
|
||||||
{
|
{
|
||||||
#ifdef TORRENT_UPNP_LOGGING
|
#ifdef TORRENT_UPNP_LOGGING
|
||||||
m_log << time_now_string()
|
m_log << time_now_string()
|
||||||
<< " <== Rootdevice responded with incorrect HTTP packet. Ignoring device" << std::endl;
|
<< " <== Rootdevice responded with incorrect HTTP packet. Ignoring device (" << e.what() << ")" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -760,22 +760,8 @@ void upnp::on_upnp_map_response(asio::error_code const& e
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p.status_code() != 200)
|
// We don't want to ignore responses with return codes other than 200
|
||||||
{
|
// since those might contain valid UPnP error codes
|
||||||
#ifdef TORRENT_UPNP_LOGGING
|
|
||||||
m_log << time_now_string()
|
|
||||||
<< " <== error while adding portmap: " << p.status_code() << " " << p.message() << std::endl;
|
|
||||||
#endif
|
|
||||||
for (int i = 0; i < num_mappings; ++i)
|
|
||||||
{
|
|
||||||
if (d.mapping[i].need_update)
|
|
||||||
{
|
|
||||||
map_port(d, i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_code_parse_state s;
|
error_code_parse_state s;
|
||||||
xml_parse((char*)p.get_body().begin, (char*)p.get_body().end
|
xml_parse((char*)p.get_body().begin, (char*)p.get_body().end
|
||||||
|
|
Loading…
Reference in New Issue