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/protocol/peer_connection_leech.h

    r1043 r1058  
    4444namespace torrent { 
    4545 
     46// Type-specific data. 
     47template<Download::ConnectionType type> struct PeerConnectionData; 
     48 
     49template<> struct PeerConnectionData<Download::CONNECTION_LEECH> { }; 
     50 
     51template<> struct PeerConnectionData<Download::CONNECTION_SEED> { }; 
     52 
     53template<> struct PeerConnectionData<Download::CONNECTION_INITIAL_SEED> { 
     54  PeerConnectionData() : lastIndex(~uint32_t()) { } 
     55  uint32_t lastIndex; 
     56  uint32_t bytesLeft; 
     57}; 
     58 
    4659template<Download::ConnectionType type> 
    4760class PeerConnection : public PeerConnectionBase { 
     
    6073  void                read_have_chunk(uint32_t index); 
    6174 
     75  void                offer_chunk(); 
     76  bool                should_upload(); 
     77 
    6278  inline void         fill_write_buffer(); 
     79 
     80  PeerConnectionData<type> m_data; 
    6381}; 
    6482