Changeset 7741
- Timestamp:
- Jan 17, 2009, 11:34:00 PM (12 years ago)
- Location:
- branches/1.5x
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5x/configure.ac
r7728 r7741 20 20 AC_PROG_LIBTOOL 21 21 22 if test m4_substr(peer_id_prefix,6,1) = "X"; then 23 AC_DEFINE(TR_BETA_RELEASE, 1, [Define to 1 if this is a beta release of Transmission]) 22 if test m4_substr(peer_id_prefix,6,1) = "0"; then 23 supported_build=yes 24 CFLAGS="$CFLAGS -g -O3 -funroll-loops " 25 CXXFLAGS="$CXXFLAGS -g -O3 -funroll-loops " 26 AC_DEFINE(TR_STABLE_RELEASE, 1, [Define to 1 if this is a stable release of Transmission]) 27 else 24 28 supported_build=no 25 elif test m4_substr(peer_id_prefix,6,1) = "Z"; then 26 AC_DEFINE(TR_NIGHTLY_RELEASE, 1, [Define to 1 if this is a nightly release of Transmission]) 27 supported_build=no 28 else 29 AC_DEFINE(TR_STABLE_RELEASE, 1, [Define to 1 if this is a stable release of Transmission]) 30 supported_build=yes 29 CFLAGS="$CFLAGS -g -O0" 30 CXXFLAGS="$CXXFLAGS -g -O0" 31 if test m4_substr(peer_id_prefix,6,1) = "X"; then 32 AC_DEFINE(TR_BETA_RELEASE, 1, [Define to 1 if this is a beta release of Transmission]) 33 else 34 AC_DEFINE(TR_NIGHTLY_RELEASE, 1, [Define to 1 if this is a nightly release of Transmission]) 35 fi 31 36 fi 32 37 AM_CONDITIONAL(TR_UNSTABLE, test "x$supported_build" = "xno") … … 94 99 ) 95 100 ]) 96 97 98 dnl ----------------------------------------------------------------------------99 dnl100 dnl debugging support101 AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug],[build with debugging support]),,,)102 if test "x$enable_debug" = "xyes" ; then103 CFLAGS="$CFLAGS -g -O0"104 CXXFLAGS="$CXXFLAGS -g -O0"105 else106 CFLAGS="$CFLAGS -g -O3 -funroll-loops -DNDEBUG "107 CXXFLAGS="$CXXFLAGS -g -O3 -funroll-loops -DNDEBUG "108 fi109 110 101 111 102 dnl ---------------------------------------------------------------------------- … … 336 327 Source code location: ${srcdir} 337 328 Compiler: ${CXX} 338 Debugging support ${enable_debug}339 329 Build Command-Line client: ${build_cli} 340 330 Build Daemon: ${build_daemon} -
branches/1.5x/libtransmission/net.c
r7729 r7741 58 58 { { { { INADDR_ANY, 0x00, 0x00, 0x00 } } } } }; 59 59 60 61 60 #ifdef WIN32 62 61 static const char * … … 463 462 } 464 463 464 static tr_bool 465 isMulticastAddress( const tr_address * addr ) 466 { 467 if( addr->type == TR_AF_INET && IN_MULTICAST( htonl( addr->addr.addr4.s_addr ) ) ) 468 return TRUE; 469 470 if( addr->type == TR_AF_INET6 && ( addr->addr.addr6.s6_addr[0] == 0xff ) ) 471 return TRUE; 472 473 return FALSE; 474 } 475 476 tr_bool 477 tr_isValidPeerAddress( const tr_address * addr, tr_port port ) 478 { 479 if( isMulticastAddress( addr ) ) 480 return FALSE; 481 482 if( port == 0 ) 483 return FALSE; 484 485 return TRUE; 486 } 487 465 488 int 466 489 tr_netOpenTCP( tr_session * session, … … 475 498 assert( tr_isAddress( addr ) ); 476 499 477 /* don't try to connect to multicast addresses */ 478 if( addr->type == TR_AF_INET && IN_MULTICAST( htonl( addr->addr.addr4.s_addr ) ) ) 479 return -EINVAL; 480 if( addr->type == TR_AF_INET6 && ( addr->addr.addr6.s6_addr[0] == 0xff ) ) 500 if( isMulticastAddress( addr ) ) 481 501 return -EINVAL; 482 502 -
branches/1.5x/libtransmission/net.h
r7722 r7741 89 89 void tr_normalizeV4Mapped( tr_address * const addr ); 90 90 91 tr_bool tr_isValidPeerAddress( const tr_address * addr, tr_port port ); 92 91 93 void tr_suspectAddress( const tr_address * a, const char * source ); 92 94 -
branches/1.5x/libtransmission/peer-mgr.c
r7722 r7741 1316 1316 1317 1317 if( !tr_sessionIsAddressBlocked( t->manager->session, &pex->addr ) ) 1318 ensureAtomExists( t, &pex->addr, pex->port, pex->flags, from ); 1318 if( tr_isValidPeerAddress( &pex->addr, pex->port ) ) 1319 ensureAtomExists( t, &pex->addr, pex->port, pex->flags, from ); 1319 1320 1320 1321 managerUnlock( t->manager ); -
branches/1.5x/libtransmission/web.c
r7722 r7741 126 126 } 127 127 128 curl_easy_setopt( easy, CURLOPT_DNS_CACHE_TIMEOUT, 360 0L );129 curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 120L );128 curl_easy_setopt( easy, CURLOPT_DNS_CACHE_TIMEOUT, 360L ); 129 curl_easy_setopt( easy, CURLOPT_CONNECTTIMEOUT, 60L ); 130 130 curl_easy_setopt( easy, CURLOPT_FOLLOWLOCATION, 1L ); 131 131 curl_easy_setopt( easy, CURLOPT_FORBID_REUSE, 1L ); 132 curl_easy_setopt( easy, CURLOPT_MAXREDIRS, 16L ); 132 133 curl_easy_setopt( easy, CURLOPT_NOSIGNAL, 1L ); 133 134 curl_easy_setopt( easy, CURLOPT_PRIVATE, task ); … … 200 201 remove_finished_tasks( tr_web * g ) 201 202 { 202 for( ;; ) 203 CURL * easy; 204 205 do 203 206 { 204 int ignored; 205 CURLMsg * msg = curl_multi_info_read( g->multi, &ignored ); 206 207 if( msg == NULL ) 208 { 209 break; 210 } 211 else if( ( msg->msg == CURLMSG_DONE ) && ( msg->easy_handle != NULL ) ) 212 { 213 CURL * easy = msg->easy_handle; 207 CURLMsg * msg; 208 int msgs_left; 209 210 easy = NULL; 211 while(( msg = curl_multi_info_read( g->multi, &msgs_left ))) { 212 if( msg->msg == CURLMSG_DONE ) { 213 easy = msg->easy_handle; 214 break; 215 } 216 } 217 218 if( easy ) { 214 219 long code; 215 220 struct tr_web_task * task; 216 221 curl_easy_getinfo( easy, CURLINFO_PRIVATE, (void*)&task ); 217 222 curl_easy_getinfo( easy, CURLINFO_RESPONSE_CODE, &code ); 218 task_finish( task, code );219 223 curl_multi_remove_handle( g->multi, easy ); 220 224 curl_easy_cleanup( easy ); 221 } 222 } 225 task_finish( task, code ); 226 } 227 } 228 while ( easy ); 223 229 224 230 g->prev_running = g->still_running;
Note: See TracChangeset
for help on using the changeset viewer.