Changeset 2837
- Timestamp:
- Aug 18, 2007, 8:28:57 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r2819 r2837 1 AC_INIT([Transmission],[0.80 ],[http://transmission.m0k.org/trac/newticket])2 PEERID_PREFIX="-TR080 0-"3 USERAGENT_PREFIX="0.80 "1 AC_INIT([Transmission],[0.80+],[http://transmission.m0k.org/trac/newticket]) 2 PEERID_PREFIX="-TR080Z-" 3 USERAGENT_PREFIX="0.80+" 4 4 5 5 AC_PREREQ(2.54) -
trunk/libtransmission/tracker.c
r2835 r2837 53 53 54 54 /* the length of the 'key' argument passed in tracker requests */ 55 #define TR_KEY_LEN 2055 #define TR_KEY_LEN 10 56 56 57 57 … … 151 151 const Torrent * b = (const Torrent*) vb; 152 152 return memcmp( a->hash, b->hash, SHA_DIGEST_LENGTH ); 153 } 154 155 /*** 156 **** 157 ***/ 158 159 typedef struct 160 { 161 char * address; 162 int port; 163 struct evhttp_connection * evconn; 164 } 165 connection_key_t; 166 167 static int 168 connectionCompare( const void * va, const void * vb ) 169 { 170 const connection_key_t * a = (const connection_key_t *) va; 171 const connection_key_t * b = (const connection_key_t *) vb; 172 int ret = strcmp( a->address, b->address ); 173 if( ret ) return ret; 174 return a->port - b->port; 175 } 176 177 static struct evhttp_connection* 178 getConnection( const char * address, int port ) 179 { 180 connection_key_t *val, tmp; 181 182 static tr_ptrArray_t * connections = NULL; 183 if( !connections ) 184 connections = tr_ptrArrayNew( ); 185 186 tmp.address = (char*) address; 187 tmp.port = port; 188 val = tr_ptrArrayFindSorted( connections, &tmp, connectionCompare ); 189 190 if( !val ) 191 { 192 val = tr_new( connection_key_t, 1 ); 193 val->address = tr_strdup( address ); 194 val->port = port; 195 val->evconn = evhttp_connection_new( address, port ); 196 tr_ptrArrayInsertSorted( connections, val, connectionCompare ); 197 } 198 199 return val->evconn; 153 200 } 154 201 … … 598 645 t->multiscrapeMax = numResponses; 599 646 } 647 else if( !req ) 648 { 649 int i, n; 650 Torrent ** torrents = (Torrent**) 651 tr_ptrArrayPeek( t->scraping, &n ); 652 for( i=0; i<n; ++i ) { 653 fprintf( stderr, "null req -- torent #%d is %s\n", i, torrents[i]->torrent->info.name ); 654 torrents[i]->scrapeTag = tr_timerNew( t->handle, 655 onTorrentScrapeNow, 656 torrents[i], NULL, 657 t->scrapeIntervalMsec ); 658 } 659 tr_ptrArrayClear( t->scraping ); 660 661 t->multiscrapeMax = INT_MAX; 662 } 600 663 601 664 if (( errmsg = updateAddresses( t, req ) )) { … … 668 731 /* ping the tracker */ 669 732 tr_inf( "scrape to %s:%d: %s", address->address, address->port, uri ); 670 evcon = evhttp_connection_new( address->address, address->port );733 evcon = getConnection( address->address, address->port ); 671 734 assert( evcon != NULL ); 672 735 evhttp_connection_set_timeout( evcon, SCRAPE_TIMEOUT_INTERVAL_SEC ); … … 861 924 else 862 925 { 863 tr_inf( "Bad response from tracker '%s' on request '%s' "926 tr_inf( "Bad response from tracker '%s' on request '%s' " 864 927 "for torrent '%s'... trying again in 30 seconds", 865 928 tor->tracker->primaryAddress, … … 905 968 tr_timerFree( &tor->reannounceTag ); 906 969 907 evcon = evhttp_connection_new( address->address, address->port );970 evcon = getConnection( address->address, address->port ); 908 971 if ( !evcon ) 909 972 tr_err( "Can't make a connection to %s:%d", address->address, address->port ); … … 917 980 } 918 981 919 tr_free( uri );920 921 982 return FALSE; 922 983 } -
trunk/libtransmission/version.h.in
r2526 r2837 3 3 #define SVN_REVISION "@SVN_REVISION@" 4 4 #define SHORT_VERSION_STRING "@USERAGENT_PREFIX@" 5 #define LONG_VERSION_STRING "@USERAGENT_PREFIX@ r(@SVN_REVISION@)"5 #define LONG_VERSION_STRING "@USERAGENT_PREFIX@ (r@SVN_REVISION@)"
Note: See TracChangeset
for help on using the changeset viewer.