~ubuntu-branches/ubuntu/oneiric/libtorrent/oneiric

« back to all changes in this revision

Viewing changes to src/download/download_wrapper.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jose Luis Rivas
  • Date: 2007-09-11 15:12:31 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20070911151231-brompt7pecvfbaau
Tags: 0.11.8-1
* New upstream version
* debian/patches/update-changelog.patch:
 + Updated with the new changelog.
* debian/control:
 + Added the Homepage field, deleted Homepages from the descriptions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// libTorrent - BitTorrent library
2
 
// Copyright (C) 2005-2006, Jari Sundell
 
2
// Copyright (C) 2005-2007, Jari Sundell
3
3
//
4
4
// This program is free software; you can redistribute it and/or modify
5
5
// it under the terms of the GNU General Public License as published by
294
294
 
295
295
  // Every 2 minutes.
296
296
  if (ticks % 4 == 0) {
 
297
    if (info()->is_active()) {
 
298
      if (info()->is_pex_enabled()) {
 
299
        m_main.do_peer_exchange();
 
300
 
 
301
      // If PEX was disabled since the last peer exchange, deactivate it now.
 
302
      } else if (info()->is_pex_active()) {
 
303
        info()->set_pex_active(false);
 
304
        for (ConnectionList::iterator itr = m_main.connection_list()->begin(); itr != m_main.connection_list()->end(); ++itr)
 
305
          (*itr)->toggle_peer_exchange(PeerConnectionBase::PEX_DISABLE);
 
306
      }
 
307
    }
 
308
 
297
309
    for (ConnectionList::iterator itr = m_main.connection_list()->begin(); itr != m_main.connection_list()->end(); )
298
310
      if (!(*itr)->receive_keepalive())
299
311
        itr = m_main.connection_list()->erase(itr, ConnectionList::disconnect_available);