Changeset 1666
- Timestamp:
- Apr 5, 2007, 4:23:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peerparse.h
r1665 r1666 254 254 } 255 255 256 static inline void updateRequests( tr_torrent_t * tor, tr_peer_t * peer, 257 int index, int begin ) 256 static inline void updateRequests( tr_peer_t * peer, int index, int begin ) 258 257 { 259 258 tr_request_t * r; 260 int i , j;259 int i; 261 260 262 261 /* Find this block in the requests list */ … … 270 269 } 271 270 272 /* Usually i should be 0, but some clients don't handle multiple 273 request well and drop previous requests */ 271 /* Usually 'i' would be 0, but some clients don't handle multiple 272 requests and drop previous requests, some other clients don't 273 send blocks in the same order we sent the requests */ 274 274 if( i < peer->inRequestCount ) 275 275 { 276 if( i > 0 ) 277 { 278 peer_dbg( "not expecting this block yet (%d requests dropped)", i ); 279 } 280 i++; 281 for( j = 0; j < i; j++ ) 282 { 283 r = &peer->inRequests[j]; 284 tr_cpDownloaderRem( tor->completion, 285 tr_block( r->index, r->begin ) ); 286 } 287 peer->inRequestCount -= i; 288 memmove( &peer->inRequests[0], &peer->inRequests[i], 289 peer->inRequestCount * sizeof( tr_request_t ) ); 276 peer->inRequestCount--; 277 memmove( &peer->inRequests[i], &peer->inRequests[i+1], 278 ( peer->inRequestCount - i ) * sizeof( tr_request_t ) ); 290 279 } 291 280 else … … 328 317 index, begin, len - 8 ); 329 318 330 updateRequests( tor,peer, index, begin );319 updateRequests( peer, index, begin ); 331 320 tor->downloadedCur += len - 8; 332 321
Note: See TracChangeset
for help on using the changeset viewer.