Changeset 2772 for trunk/libtransmission/peer.c
- Timestamp:
- Aug 15, 2007, 9:26:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer.c
r2769 r2772 112 112 /* #define DISABLE_AZPROTO */ 113 113 114 /* uncomment this to use the new reserved bits proposed here: 115 http://www.azureuswiki.com/index.php/Extension_negotiation_protocol */ 116 /* #define NEW_AZ_BITS */ 117 114 118 #define HANDSHAKE_NAME "\023BitTorrent protocol" 115 119 #define HANDSHAKE_NAME_LEN 20 … … 120 124 #define HANDSHAKE_SIZE ( HANDSHAKE_PEERID_OFF + TR_ID_LEN ) 121 125 126 /* these macros test and set the bit indicating extended messaging support */ 122 127 #ifdef DISABLE_EXTMSGS 123 128 #define HANDSHAKE_HAS_EXTMSGS( bits ) ( 0 ) … … 128 133 #endif 129 134 135 /* these macros test and set the bit indicating azureus protocol support */ 130 136 #ifdef DISABLE_AZPROTO 131 137 #define HANDSHAKE_HAS_AZPROTO( bits ) ( 0 ) … … 135 141 #define HANDSHAKE_SET_AZPROTO( bits ) ( (bits)[0] |= 0x80 ) 136 142 #endif 143 144 /* these macros are to be used if both extended messaging and the 145 azureus protocol is supported, they indicate which protocol is preferred */ 146 #ifdef NEW_AZ_BITS 147 #define HANDSHAKE_GET_EXTPREF( bits ) ( (bits)[5] & 0x03 ) 148 #define HANDSHAKE_SET_EXTPREF( bits, val ) ( (bits)[5] |= 0x03 & (val) ) 149 #else 150 #define HANDSHAKE_GET_EXTPREF( bits ) ( 0 ) 151 #define HANDSHAKE_SET_EXTPREF( bits, val ) ( (void)0 ) 152 #endif 153 #define HANDSHAKE_EXTPREF_FORCE_EXT ( 0x00 ) 154 #define HANDSHAKE_EXTPREF_WANT_EXT ( 0x01 ) 155 #define HANDSHAKE_EXTPREF_WANT_AZ ( 0x10 ) 156 #define HANDSHAKE_EXTPREF_FORCE_AZ ( 0x11 ) 137 157 138 158 #define PEER_MSG_CHOKE 0 … … 559 579 HANDSHAKE_SET_EXTMSGS( buf + HANDSHAKE_FLAGS_OFF ); 560 580 HANDSHAKE_SET_AZPROTO( buf + HANDSHAKE_FLAGS_OFF ); 581 HANDSHAKE_SET_EXTPREF( buf + HANDSHAKE_FLAGS_OFF, 582 HANDSHAKE_EXTPREF_WANT_EXT ); 561 583 memcpy( buf + HANDSHAKE_HASH_OFF, inf->hash, SHA_DIGEST_LENGTH ); 562 584 memcpy( buf + HANDSHAKE_PEERID_OFF, tor->peer_id, TR_ID_LEN );
Note: See TracChangeset
for help on using the changeset viewer.