Changeset 7338 for trunk/libtransmission/inout.c
- Timestamp:
- Dec 10, 2008, 3:45:57 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/inout.c
r7249 r7338 31 31 #include "utils.h" 32 32 33 #ifdef TR_EMBEDDED 34 #define TR_HASH_BUFSIZE (16*1024) 35 #else 36 #define TR_HASH_BUFSIZE (64*1024) 37 #endif 38 33 39 /**** 34 40 ***** Low-level IO functions … … 216 222 uint8_t * setme ) 217 223 { 218 size_t bytesLeft; 224 static uint8_t * buf = NULL; 225 size_t bytesLeft; 219 226 uint32_t offset = 0; 220 int 227 int success = TRUE; 221 228 SHA_CTX sha; 229 230 if( buf == NULL ) 231 buf = tr_new( uint8_t, TR_HASH_BUFSIZE ); 222 232 223 233 assert( tor ); … … 230 240 while( bytesLeft ) 231 241 { 232 uint8_t buf[8192]; 233 const int len = MIN( bytesLeft, sizeof( buf ) ); 242 const int len = MIN( bytesLeft, TR_HASH_BUFSIZE ); 234 243 success = !tr_ioRead( tor, pieceIndex, offset, len, buf ); 235 244 if( !success )
Note: See TracChangeset
for help on using the changeset viewer.