Permalink
Browse files

Fixed a couple of potential exceptions thrown by rak::priority_queue_…

…insert(...).
  • Loading branch information...
1 parent c669a9b commit e0e654f1e1943eb834c2f5fbf37db8dc34786e74 @rakshasa rakshasa committed Dec 10, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/data/hash_torrent.cc
  2. +2 −1 src/torrent/peer/connection_list.cc
View
2 src/data/hash_torrent.cc
@@ -188,7 +188,7 @@ HashTorrent::queue(bool quick) {
m_errno = handle.error_number().value();
- // rak::priority_queue_erase(&taskScheduler, &m_delayChecked);
+ rak::priority_queue_erase(&taskScheduler, &m_delayChecked);
rak::priority_queue_insert(&taskScheduler, &m_delayChecked, cachedTime);
return;
}
View
3 src/torrent/peer/connection_list.cc
@@ -116,7 +116,8 @@ ConnectionList::erase(iterator pos, int flags) {
if (flags & disconnect_delayed) {
m_disconnectQueue.push_back((*pos)->id());
- priority_queue_insert(&taskScheduler, &m_download->delay_disconnect_peers(), cachedTime);
+ if (!m_download->delay_disconnect_peers().is_queued())
+ priority_queue_insert(&taskScheduler, &m_download->delay_disconnect_peers(), cachedTime);
return pos;
}

0 comments on commit e0e654f

Please sign in to comment.