Changeset 11718
- Timestamp:
- Jan 20, 2011, 12:31:46 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-io.c
r11709 r11718 147 147 const size_t oldLen = evbuffer_get_length( io->inbuf ); 148 148 const int ret = io->canRead( io, io->userData, &piece ); 149 150 149 const size_t used = oldLen - evbuffer_get_length( io->inbuf ); 150 const unsigned int overhead = guessPacketOverhead( used ); 151 const uint64_t now = tr_time_msec( ); 151 152 152 153 assert( tr_isPeerIo( io ) ); … … 154 155 if( piece || (piece!=used) ) 155 156 { 156 const uint64_t now = tr_time_msec( );157 158 157 if( piece ) 159 158 tr_bandwidthUsed( &io->bandwidth, TR_DOWN, piece, TRUE, now ); … … 162 161 tr_bandwidthUsed( &io->bandwidth, TR_DOWN, used - piece, FALSE, now ); 163 162 } 163 164 if( overhead > 0 ) 165 tr_bandwidthUsed( &io->bandwidth, TR_UP, overhead, FALSE, now ); 164 166 165 167 switch( ret )
Note: See TracChangeset
for help on using the changeset viewer.