Changeset 10694
- Timestamp:
- May 26, 2010, 3:23:21 PM (12 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-common.h
r10500 r10694 12 12 13 13 #ifndef __TRANSMISSION__ 14 #error only libtransmission should #include this header.14 #error only libtransmission should #include this header. 15 15 #endif 16 16 … … 34 34 batch them together to send enough requests to 35 35 meet our bandwidth goals for the next N seconds */ 36 REQUEST_BUF_SECS = 10 36 REQUEST_BUF_SECS = 10, 37 38 /** this is the maximum size of a block request. 39 most bittorrent clients will reject requests 40 larger than this size. */ 41 MAX_BLOCK_SIZE = ( 1024 * 16 ) 42 37 43 }; 38 44 -
trunk/libtransmission/peer-io.c
r10671 r10694 32 32 #include "list.h" 33 33 #include "net.h" 34 #include "peer-common.h" /* MAX_BLOCK_SIZE */ 34 35 #include "peer-io.h" 35 36 #include "trevent.h" /* tr_runInEventThread() */ … … 721 722 * or a few blocks, whichever is bigger. 722 723 * It's okay to tweak this as needed */ 723 const double maxBlockSize = 16 * 1024; /* 16 KiB is from BT spec */724 724 const double currentSpeed = tr_bandwidthGetPieceSpeed( &io->bandwidth, now, TR_UP ); 725 725 const double period = 15; /* arbitrary */ 726 726 const double numBlocks = 3.5; /* the 3 is arbitrary; the .5 is to leave room for messages */ 727 return MAX( maxBlockSize*numBlocks, currentSpeed*1024*period );727 return MAX( MAX_BLOCK_SIZE*numBlocks, currentSpeed*1024*period ); 728 728 } 729 729 -
trunk/libtransmission/peer-msgs.c
r10553 r10694 82 82 83 83 METADATA_REQQ = 64, 84 85 MAX_BLOCK_SIZE = ( 1024 * 16 ),86 84 87 85 /* used in lowering the outMessages queue period */ -
trunk/libtransmission/torrent.c
r10692 r10694 36 36 #include "magnet.h" 37 37 #include "metainfo.h" 38 #include "peer-common.h" /* MAX_BLOCK_SIZE */ 38 39 #include "peer-mgr.h" 39 40 #include "platform.h" /* TR_PATH_DELIMITER_STR */ … … 46 47 #include "verify.h" 47 48 #include "version.h" 48 49 enum50 {51 MAX_BLOCK_SIZE = 1024 * 1652 };53 49 54 50 /***
Note: See TracChangeset
for help on using the changeset viewer.