upnp fixes

This commit is contained in:
Marcos Pinto 2007-08-07 08:07:19 +00:00
parent c06b63b027
commit 680826e969

View File

@ -659,7 +659,7 @@ void upnp::on_upnp_xml(asio::error_code const& e
d.upnp_connection.reset();
}
if (e)
if (e && e != asio::error::eof)
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
@ -672,7 +672,16 @@ void upnp::on_upnp_xml(asio::error_code const& e
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
<< " <== incomplete http message" << std::endl;
<< " <== error while fetching control url: incomplete http message" << std::endl;
#endif
return;
}
if (p.status_code() != 200)
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
<< " <== error while fetching control url: " << p.message() << std::endl;
#endif
return;
}
@ -791,7 +800,7 @@ void upnp::on_upnp_map_response(asio::error_code const& e
d.upnp_connection.reset();
}
if (e)
if (e && e != asio::error::eof)
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
@ -824,7 +833,17 @@ void upnp::on_upnp_map_response(asio::error_code const& e
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
<< " <== incomplete http message" << std::endl;
<< " <== error while adding portmap: incomplete http message" << std::endl;
#endif
m_devices.erase(d);
return;
}
if (p.status_code() != 200)
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
<< " <== error while adding portmap: " << p.message() << std::endl;
#endif
m_devices.erase(d);
return;
@ -933,7 +952,7 @@ void upnp::on_upnp_unmap_response(asio::error_code const& e
d.upnp_connection.reset();
}
if (e)
if (e && e != asio::error::eof)
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
@ -945,11 +964,21 @@ void upnp::on_upnp_unmap_response(asio::error_code const& e
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
<< " <== incomplete http message" << std::endl;
<< " <== error while deleting portmap: incomplete http message" << std::endl;
#endif
return;
}
if (p.status_code() != 200)
{
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
<< " <== error while deleting portmap: " << p.message() << std::endl;
#endif
m_devices.erase(d);
return;
}
#ifdef TORRENT_UPNP_LOGGING
m_log << time_now_string()
<< " <== unmap response: " << std::string(p.get_body().begin, p.get_body().end)