Changeset 7474 for trunk/libtransmission/peer-io.c
- Timestamp:
- Dec 23, 2008, 5:11:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-io.c
r7469 r7474 215 215 int res; 216 216 tr_peerIo * io = vio; 217 const size_t howmuch = tr_bandwidthClamp( io->bandwidth, TR_DOWN, io->session->so_rcvbuf ); 217 218 /* Limit the input buffer to 256K, so it doesn't grow too large */ 219 const size_t canread = 256 * 1024 - EVBUFFER_LENGTH( io->inbuf ); 220 const size_t howmuch = tr_bandwidthClamp( io->bandwidth, TR_DOWN, canread ); 218 221 const tr_direction dir = TR_DOWN; 219 222 … … 291 294 dbgmsg( io, "libevent says this peer is ready to write" ); 292 295 293 howmuch = MIN( (size_t)io->session->so_sndbuf, EVBUFFER_LENGTH( io->outbuf ) ); 294 howmuch = tr_bandwidthClamp( io->bandwidth, dir, howmuch ); 296 /* Write as much as possible, since the socket is non-blocking, write() will 297 * return if it can't write any more data without blocking */ 298 howmuch = tr_bandwidthClamp( io->bandwidth, dir, EVBUFFER_LENGTH( io->outbuf ) ); 295 299 296 300 /* if we don't have any bandwidth left, stop writing */
Note: See TracChangeset
for help on using the changeset viewer.