more size logging and potential fix for udp_tracker_connection leak

This commit is contained in:
Arvid Norberg
2010-11-16 06:41:35 +00:00
parent 8dbdd4ced4
commit 71d51b90e8
4 changed files with 58 additions and 5 deletions

View File

@@ -296,8 +296,6 @@ namespace libtorrent
// ignore packets smaller than 8 bytes
if (size < 8) return false;
restart_read_timeout();
const char* ptr = buf;
int action = detail::read_int32(ptr);
int transaction = detail::read_int32(ptr);
@@ -323,6 +321,8 @@ namespace libtorrent
// ignore packets that's not a response to our message
if (action != m_state) return false;
restart_read_timeout();
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
if (cb)
{
@@ -490,7 +490,7 @@ namespace libtorrent
if (!cb)
{
m_man.remove_request(this);
close();
return true;
}
@@ -523,7 +523,6 @@ namespace libtorrent
cb->tracker_response(tracker_req(), m_target.address(), ip_list
, peer_list, interval, min_interval, complete, incomplete, address());
m_man.remove_request(this);
close();
return true;
}
@@ -572,7 +571,6 @@ namespace libtorrent
cb->tracker_scrape_response(tracker_req()
, complete, incomplete, downloaded, -1);
m_man.remove_request(this);
close();
return true;
}