Changeset 2427
- Timestamp:
- Jul 19, 2007, 10:37:30 AM (15 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/internal.h
r2377 r2427 88 88 /* Convenient macros to perform uint32_t endian conversions with 89 89 char pointers */ 90 #define TR_NTOHL(p,a) (a) = tr_ntohl((p))91 90 #define TR_HTONL(a,p) tr_htonl((a), ( uint8_t * )(p)) 92 91 static inline uint32_t tr_ntohl( uint8_t * p ) -
trunk/libtransmission/peeraz.h
r2358 r2427 285 285 } 286 286 /* message length */ 287 TR_NTOHL( buf, msglen);287 msglen = tr_ntohl( buf ); 288 288 msglen += 4; 289 289 off = 4; … … 298 298 } 299 299 /* name length */ 300 TR_NTOHL( buf + off, namelen);300 namelen = tr_ntohl( buf + off ); 301 301 off += 4; 302 302 if( off + namelen + 1 > msglen ) -
trunk/libtransmission/peerparse.h
r2374 r2427 114 114 } 115 115 116 TR_NTOHL( p, piece);116 piece = tr_ntohl( p ); 117 117 if( ( uint32_t )inf->pieceCount <= piece ) 118 118 { … … 215 215 } 216 216 217 TR_NTOHL( p, index);218 TR_NTOHL( &p[4], begin);219 TR_NTOHL( &p[8], length);217 index = tr_ntohl( p ); 218 begin = tr_ntohl( &p[4] ); 219 length = tr_ntohl( &p[8] ); 220 220 221 221 if( inf->pieceCount <= index ) … … 294 294 } 295 295 296 TR_NTOHL( p, index);297 TR_NTOHL( &p[4], begin);296 index = tr_ntohl( p ); 297 begin = tr_ntohl( &p[4] ); 298 298 299 299 if( inf->pieceCount <= index ) … … 397 397 } 398 398 399 TR_NTOHL( p, index);400 TR_NTOHL( &p[4], begin);401 TR_NTOHL( &p[8], length);399 index = tr_ntohl( p ); 400 begin = tr_ntohl( &p[4] ); 401 length = tr_ntohl( &p[8] ); 402 402 403 403 if( inf->pieceCount <= index ) … … 454 454 455 455 /* Get payload size */ 456 TR_NTOHL( buf, *msglen);456 *msglen = tr_ntohl( buf ); 457 457 458 458 if( 4 + *msglen > buflen )
Note: See TracChangeset
for help on using the changeset viewer.