Show
Ignore:
Timestamp:
05/05/08 15:16:26 (4 years ago)
Author:
rakshasa
Message:

* Initial seeding support added. Patch by Josef Drexler.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/libtorrent/src/torrent/download.cc

    r1035 r1058  
    107107  file_list()->open(flags & ~FileList::open_no_create); 
    108108 
     109  if (m_ptr->connection_type() == CONNECTION_INITIAL_SEED) { 
     110    if (!m_ptr->main()->start_initial_seeding())  
     111      set_connection_type(CONNECTION_SEED); 
     112  } 
     113 
    109114  m_ptr->main()->start(); 
    110115  m_ptr->main()->tracker_manager()->set_active(true); 
     
    502507    m_ptr->main()->connection_list()->slot_new_connection(&createPeerConnectionSeed); 
    503508    break; 
     509  case CONNECTION_INITIAL_SEED: 
     510    if (is_active() && m_ptr->main()->initial_seeding() == NULL) 
     511      throw input_error("Can't switch to initial seeding: download is active."); 
     512    m_ptr->main()->connection_list()->slot_new_connection(&createPeerConnectionInitialSeed); 
     513    break; 
    504514  default: 
    505515    throw input_error("torrent::Download::set_connection_type(...) received an unknown type.");