Changeset 7267
- Timestamp:
- Dec 4, 2008, 5:31:13 AM (12 years ago)
- Location:
- branches/1.4x/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4x/libtransmission/handshake.c
r7176 r7267 205 205 int * setme_len ) 206 206 { 207 uint8_t *buf = tr_new0( uint8_t, HANDSHAKE_SIZE );208 uint8_t *walk = buf;209 const uint8_t * torrentHash = tr_cryptoGetTorrentHash(210 handshake->crypto);211 const uint8_t * peerId =tr_getPeerId( );207 uint8_t * buf = tr_new0( uint8_t, HANDSHAKE_SIZE ); 208 uint8_t * walk = buf; 209 const uint8_t * torrentHash = tr_cryptoGetTorrentHash( handshake->crypto ); 210 const tr_torrent * tor = tr_torrentFindFromHash( handshake->handle, torrentHash ); 211 const uint8_t * peerId = tor && tor->peer_id ? tor->peer_id : tr_getPeerId( ); 212 212 213 213 memcpy( walk, HANDSHAKE_NAME, HANDSHAKE_NAME_LEN ); … … 682 682 if( !tr_torrentExists( handshake->handle, hash ) ) 683 683 { 684 dbgmsg( 685 handshake, 686 "peer is trying to connect to us for a torrent we don't have." ); 684 dbgmsg( handshake, "peer is trying to connect to us for a torrent we don't have." ); 687 685 return tr_handshakeDone( handshake, FALSE ); 688 686 } … … 705 703 706 704 /** 707 *** If this is an incoming message, then we need to send a response 708 ***handshake 705 *** If it's an incoming message, we need to send a response handshake 709 706 **/ 710 707 -
branches/1.4x/libtransmission/torrent.h
r7176 r7267 182 182 uint8_t obfuscatedHash[SHA_DIGEST_LENGTH]; 183 183 184 /* If the initiator of the connection receives a handshake in which the 185 * peer_id does not match the expected peerid, then the initiator is 186 * expected to drop the connection. Note that the initiator presumably 187 * received the peer information from the tracker, which includes the 188 * peer_id that was registered by the peer. The peer_id from the tracker 189 * and in the handshake are expected to match. 190 */ 191 uint8_t * peer_id; 192 184 193 /* Where to download */ 185 char * 194 char * downloadDir; 186 195 187 196 /* How many bytes we ask for per request */ -
branches/1.4x/libtransmission/tracker.c
r7100 r7267 1076 1076 if( t && !t->isRunning ) 1077 1077 { 1078 tr_torrent * tor; 1079 1080 /* change the peer-id */ 1078 1081 tr_free( t->peer_id ); 1079 1082 t->peer_id = tr_peerIdNew( ); 1083 if(( tor = tr_torrentFindFromHash( t->session, t->hash ))) { 1084 tr_free( tor->peer_id ); 1085 tor->peer_id = (uint8_t*) tr_strdup( t->peer_id ); 1086 } 1080 1087 1081 1088 t->isRunning = 1;
Note: See TracChangeset
for help on using the changeset viewer.