~ubuntu-branches/ubuntu/trusty/aria2/trusty-proposed

« back to all changes in this revision

Viewing changes to src/DHTPeerAnnounceStorage.cc

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry
  • Date: 2013-12-16 18:41:03 UTC
  • mfrom: (2.5.21 sid)
  • Revision ID: package-import@ubuntu.com-20131216184103-xzah3019zwut429g
Tags: 1.18.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
{
70
70
  std::shared_ptr<DHTPeerAnnounceEntry> entry(new DHTPeerAnnounceEntry(infoHash));
71
71
 
72
 
  DHTPeerAnnounceEntrySet::iterator i = entries_.lower_bound(entry);
 
72
  auto i = entries_.lower_bound(entry);
73
73
 
74
74
  if(i != entries_.end() &&
75
75
     memcmp(infoHash, (*i)->getInfoHash(), DHT_ID_LENGTH) == 0) {
102
102
{
103
103
  std::shared_ptr<DHTPeerAnnounceEntry> entry(new DHTPeerAnnounceEntry(infoHash));
104
104
 
105
 
  DHTPeerAnnounceEntrySet::iterator i = entries_.find(entry);
 
105
  auto i = entries_.find(entry);
106
106
  if(i != entries_.end()) {
107
107
    (*i)->getPeers(peers);
108
108
  }
124
124
  A2_LOG_DEBUG(fmt("Now purge peer announces(%lu entries) which are timed out.",
125
125
                   static_cast<unsigned long>(entries_.size())));
126
126
  std::for_each(entries_.begin(), entries_.end(), RemoveStalePeerAddrEntry());
127
 
  for(DHTPeerAnnounceEntrySet::iterator i = entries_.begin(),
 
127
  for(auto i = entries_.begin(),
128
128
        eoi = entries_.end(); i != eoi;) {
129
129
    if((*i)->empty()) {
130
130
      entries_.erase(i++);