Changeset 7339 for branches/1.4x/libtransmission/inout.c
- Timestamp:
- Dec 10, 2008, 3:50:39 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4x/libtransmission/inout.c
r7142 r7339 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 … … 217 223 uint8_t * setme ) 218 224 { 219 size_t bytesLeft; 225 static uint8_t * buf = NULL; 226 size_t bytesLeft; 220 227 uint32_t offset = 0; 221 int 228 int success = TRUE; 222 229 SHA_CTX sha; 230 231 if( buf == NULL ) 232 buf = tr_new( uint8_t, TR_HASH_BUFSIZE ); 223 233 224 234 assert( tor ); … … 231 241 while( bytesLeft ) 232 242 { 233 uint8_t buf[8192]; 234 const int len = MIN( bytesLeft, sizeof( buf ) ); 243 const int len = MIN( bytesLeft, TR_HASH_BUFSIZE ); 235 244 success = !tr_ioRead( tor, pieceIndex, offset, len, buf ); 236 245 if( !success )
Note: See TracChangeset
for help on using the changeset viewer.