Changeset 7136
- Timestamp:
- Nov 23, 2008, 4:30:09 PM (12 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-msgs.c
r7130 r7136 345 345 } 346 346 347 #define dbgmsg( msgs, ... ) myDebug( __FILE__, __LINE__, msgs, __VA_ARGS__ ) 347 #define dbgmsg( msgs, ... ) \ 348 do { \ 349 if( tr_deepLoggingIsActive( ) ) \ 350 myDebug( __FILE__, __LINE__, msgs, __VA_ARGS__ ); \ 351 } while( 0 ) 348 352 349 353 /** … … 911 915 **/ 912 916 913 dbgmsg( msgs, "added req for piece %lu", (unsigned long)index ); 917 dbgmsg( msgs, "adding req for %"PRIu32":%"PRIu32"->%"PRIu32" to our `will request' list", 918 index, offset, length ); 914 919 req.time_requested = time( NULL ); 915 920 reqListAppend( &msgs->clientWillAskFor, &req ); … … 923 928 struct request_list a = msgs->clientWillAskFor; 924 929 struct request_list b = msgs->clientAskedFor; 930 dbgmsg( msgs, "cancelling all requests to peer" ); 925 931 926 932 msgs->clientAskedFor = REQUEST_LIST_INIT; … … 950 956 assert( length > 0 ); 951 957 958 952 959 /* have we asked the peer for this piece? */ 953 960 req.index = pieceIndex; … … 956 963 957 964 /* if it's only in the queue and hasn't been sent yet, free it */ 958 if( reqListRemove( &msgs->clientWillAskFor, &req ) ) 965 if( reqListRemove( &msgs->clientWillAskFor, &req ) ) { 966 dbgmsg( msgs, "cancelling %"PRIu32":%"PRIu32"->%"PRIu32"\n", pieceIndex, offset, length ); 959 967 fireCancelledReq( msgs, &req ); 968 } 960 969 961 970 /* if it's already been sent, send a cancel message too */ 962 971 if( reqListRemove( &msgs->clientAskedFor, &req ) ) { 972 dbgmsg( msgs, "cancelling %"PRIu32":%"PRIu32"->%"PRIu32"\n", pieceIndex, offset, length ); 963 973 protocolSendCancel( msgs, &req ); 964 974 fireCancelledReq( msgs, &req ); … … 1034 1044 } 1035 1045 1036 dbgmsg( msgs, "here is the ltep handshake we got [%*.*s]", len, len, 1037 tmp ); 1046 dbgmsg( msgs, "here is the handshake: [%*.*s]", len, len, tmp ); 1038 1047 1039 1048 /* does the peer prefer encrypted connections? */ … … 1691 1700 1692 1701 peer->minActiveRequests = 4; 1693 peer->maxActiveRequests = peer->minActiveRequests + 1694 estimatedBlocksInNext30Seconds; 1702 peer->maxActiveRequests = peer->minActiveRequests + estimatedBlocksInNext30Seconds; 1695 1703 return TRUE; 1696 1704 } … … 1748 1756 msgs->outMessagesBatchedAt = now; 1749 1757 } 1750 else if( haveMessages 1751 && ( ( now - msgs->outMessagesBatchedAt ) > 1752 msgs->outMessagesBatchPeriod ) ) 1758 else if( ( haveMessages ) && 1759 ( ( now - msgs->outMessagesBatchedAt ) > msgs->outMessagesBatchPeriod ) ) 1753 1760 { 1754 dbgmsg( msgs, "flushing outMessages... (length is %zu)", EVBUFFER_LENGTH( msgs->outMessages ) );1761 dbgmsg( msgs, "flushing outMessages... to %p (length is %zu)", msgs->io, EVBUFFER_LENGTH( msgs->outMessages ) ); 1755 1762 tr_peerIoWriteBuf( msgs->io, msgs->outMessages, FALSE ); 1756 1763 msgs->clientSentAnythingAt = now; … … 2015 2022 tr_peerIoWriteBytes ( msgs->io, out, benc, bencLen ); 2016 2023 pokeBatchPeriod( msgs, IMMEDIATE_PRIORITY_INTERVAL_SECS ); 2017 dbgmsg( msgs, "outMessage size is now %d", 2018 (int)EVBUFFER_LENGTH( out ) ); 2024 dbgmsg( msgs, "sending a pex message; outMessage size is now %zu", EVBUFFER_LENGTH( out ) ); 2019 2025 2020 2026 /* cleanup */ -
trunk/libtransmission/ptrarray.h
r6953 r7136 37 37 tr_ptrArray * tr_ptrArrayDup( tr_ptrArray* ); 38 38 39 void tr_ptrArrayForeach( 40 tr_ptrArray*, 41 PtrArrayForeachFunc func ); 39 void tr_ptrArrayForeach( tr_ptrArray * array, 40 PtrArrayForeachFunc func ); 42 41 43 42 void tr_ptrArrayFree( tr_ptrArray * array, -
trunk/libtransmission/transmission.h
r7113 r7136 45 45 #ifndef PRIu64 46 46 #define PRIu64 "llu" 47 #endif 48 #ifndef PRIu32 49 #define PRIu32 "lu" 47 50 #endif 48 51 #include <time.h> /* time_t */
Note: See TracChangeset
for help on using the changeset viewer.