fixed udp tracker race condition

This commit is contained in:
Arvid Norberg 2010-03-02 09:04:27 +00:00
parent 82b60b25c8
commit 0952dd48f6
3 changed files with 8 additions and 0 deletions

View File

@ -107,6 +107,7 @@
* improved LSD performance and made the interval configurable
* improved UDP tracker support by caching connect tokens
* fast piece optimization
* fixed udp tracker race condition
* added support for torrents with odd piece sizes
* fixed issue with disk read cache not being cleared when removing torrents
* made the DHT socket bind to the same interface as the session

View File

@ -160,6 +160,7 @@ namespace libtorrent
void set_timeout(int completion_timeout, int read_timeout);
void restart_read_timeout();
void cancel();
bool cancelled() const { return m_abort; }
virtual void on_timeout() = 0;
virtual ~timeout_handler() {}

View File

@ -131,6 +131,12 @@ namespace libtorrent
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
if (cb) cb->debug_log("*** UDP_TRACKER [ name lookup successful ]");
#endif
if (cancelled())
{
fail(-1, "aborted");
return;
}
restart_read_timeout();
// look for an address that has the same kind as the one