Changeset 6991
- Timestamp:
- Oct 30, 2008, 3:41:45 AM (12 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-io.c
r6961 r6991 588 588 589 589 size_t 590 tr_peerIoGetBandwidthLeft( const tr_peerIo * io,591 tr_direction direction )592 {593 assert( io );594 assert( direction == TR_UP || direction == TR_DOWN );595 return io->bandwidth[direction].bytesLeft;596 }597 598 size_t599 590 tr_peerIoGetWriteBufferSpace( const tr_peerIo * io ) 600 591 { 601 592 const size_t desiredBufferLen = 4096; 602 const size_t currentLiveLen = 603 EVBUFFER_LENGTH( EVBUFFER_OUTPUT( io->bufev ) ); 604 605 const size_t desiredLiveLen = tr_peerIoGetBandwidthLeft( io, TR_UP ); 593 const size_t currentLiveLen = EVBUFFER_LENGTH( EVBUFFER_OUTPUT( io->bufev ) ); 594 606 595 const size_t currentLbufLen = EVBUFFER_LENGTH( io->output ); 607 596 const size_t desiredLiveLen = io->bandwidth[TR_UP].isUnlimited 597 ? INT_MAX 598 : io->bandwidth[TR_UP].bytesLeft; 599 600 const size_t currentLen = currentLiveLen + currentLbufLen; 608 601 const size_t desiredLen = desiredBufferLen + desiredLiveLen; 609 const size_t currentLen = currentLiveLen + currentLbufLen;610 602 611 603 size_t freeSpace = 0; -
trunk/libtransmission/peer-io.h
r6949 r6991 199 199 tr_direction direction ); 200 200 201 size_t tr_peerIoGetBandwidthLeft( const tr_peerIo * io,202 tr_direction direction );203 204 201 size_t tr_peerIoGetWriteBufferSpace( const tr_peerIo * io ); 205 202
Note: See TracChangeset
for help on using the changeset viewer.