- Timestamp:
- Sep 7, 2009, 6:19:26 AM (13 years ago)
- Location:
- branches/1.7x
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.7x/configure.ac
r8997 r9051 26 26 CXXFLAGS="$CXXFLAGS -g -O3 " 27 27 fi 28 CPPFLAGS="$CPPFLAGS -NDEBUG" 28 29 else 29 30 supported_build=no -
branches/1.7x/libtransmission/bencode.c
r8903 r9051 1340 1340 UTF32 * u32 = &buf; 1341 1341 ConversionResult result = ConvertUTF8toUTF32( &tmp, end, &u32, &buf + 1, 0 ); 1342 if( ( result != conversionOK ) && ( tmp == it ) ) 1343 ++it; /* it's beyond help; skip it */ 1344 else { 1342 if((( result==conversionOK ) || (result==targetExhausted)) && (tmp!=it)) { 1345 1343 evbuffer_add_printf( data->out, "\\u%04x", (unsigned int)buf ); 1346 1344 it = tmp - 1; -
branches/1.7x/libtransmission/peer-mgr.c
r8912 r9051 2475 2475 { 2476 2476 int n = tr_ptrArraySize( &t->peers ); 2477 const int max = tr_ sessionGetPeerLimitPerTorrent( t->tor->session);2477 const int max = tr_torrentGetPeerLimit( t->tor ); 2478 2478 if( n > max ) 2479 2479 { … … 2608 2608 tor = NULL; 2609 2609 while(( tor = tr_torrentNext( mgr->session, tor ))) 2610 if( tor->isRunning && ( ( tor->error == TR_STAT_TRACKER_ERROR ) || ( tor->error == TR_STAT_LOCAL_ERROR )))2610 if( tor->isRunning && ( tor->error == TR_STAT_LOCAL_ERROR )) 2611 2611 tr_torrentStop( tor ); 2612 2612 -
branches/1.7x/libtransmission/torrent.c
r8948 r9051 720 720 didParse = tr_metainfoParse( session, setmeInfo, metainfo ); 721 721 doFree = didParse && ( setmeInfo == &tmp ); 722 723 if( !didParse ) 724 result = TR_PARSE_ERR; 722 725 723 726 if( didParse && !getBlockSize( setmeInfo->pieceSize ) ) -
branches/1.7x/libtransmission/tracker.c
r8905 r9051 525 525 tr_webGetResponseStr( responseCode ) ); 526 526 tr_strlcpy( t->lastAnnounceStr, buf, sizeof( t->lastAnnounceStr ) ); 527 publishWarning( t, buf ); 527 528 /* if the repsonse may require intervention, notify the user; otherwise, just log it */ 529 if( responseCode >= 400 ) 530 publishWarning( t, buf ); 531 tr_ninf( t->name, "%s", buf ); 532 528 533 tr_free( buf ); 529 534 } -
branches/1.7x/libtransmission/verify.c
r8931 r9051 36 36 ***/ 37 37 38 enum 39 { 40 MSEC_TO_SLEEP_PER_SECOND_DURING_VERIFY = 200 41 }; 42 38 43 /* #define STOPWATCH */ 39 44 … … 46 51 tr_bool changed = 0; 47 52 tr_bool hadPiece = 0; 53 time_t lastSleptAt = 0; 48 54 uint32_t piecePos = 0; 49 55 uint32_t pieceBytesRead = 0; … … 53 59 uint8_t * buffer = tr_new( uint8_t, buflen ); 54 60 #ifdef STOPWATCH 55 time_t now= time( NULL );61 const time_t begin = time( NULL ); 56 62 #endif 57 63 … … 106 112 if( leftInPiece == 0 ) 107 113 { 114 time_t now; 108 115 tr_bool hasPiece; 109 116 uint8_t hash[SHA_DIGEST_LENGTH]; … … 122 129 } 123 130 tr_torrentSetPieceChecked( tor, pieceIndex, TRUE ); 124 tor->anyDate = time( NULL ); 125 126 /* going full-throttle on a verify can choke other processes' 127 * disk IO, so wait a fwe msec between pieces. 128 * The msec is arbitrary, and the "if" clause is to make sure we 129 * don't slow down verification of files that don't exist */ 130 if( pieceBytesRead == tr_torPieceCountBytes( tor, pieceIndex ) ) 131 tr_wait( 50 ); 131 now = time( NULL ); 132 tor->anyDate = now; 133 134 /* sleeping even just a few msec per second goes a long 135 * way towards reducing IO load... */ 136 if( lastSleptAt != now ) { 137 lastSleptAt = now; 138 tr_wait( MSEC_TO_SLEEP_PER_SECOND_DURING_VERIFY ); 139 } 132 140 133 141 SHA1_Init( &sha ); … … 154 162 #ifdef STOPWATCH 155 163 { 156 time_t now2= time( NULL );164 const time_t end = time( NULL ); 157 165 fprintf( stderr, "it took %d seconds to verify %"PRIu64" bytes (%"PRIu64" bytes per second)\n", 158 (int)( now2-now), tor->info.totalSize, (uint64_t)(tor->info.totalSize/(1+(now2-now))) );166 (int)(end-begin), tor->info.totalSize, (uint64_t)(tor->info.totalSize/(1+(end-begin))) ); 159 167 } 160 168 #endif
Note: See TracChangeset
for help on using the changeset viewer.