Changeset 7741


Ignore:
Timestamp:
Jan 17, 2009, 11:34:00 PM (12 years ago)
Author:
charles
Message:

(1.5x) copy r7739 and r7740 to 1.5x

Location:
branches/1.5x
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/configure.ac

    r7728 r7741  
    2020AC_PROG_LIBTOOL
    2121
    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])
     22if 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])
     27else
    2428  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
    3136fi
    3237AM_CONDITIONAL(TR_UNSTABLE, test "x$supported_build" = "xno")
     
    9499    )
    95100])
    96 
    97 
    98 dnl ----------------------------------------------------------------------------
    99 dnl
    100 dnl  debugging support
    101 AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug],[build with debugging support]),,,)
    102 if test "x$enable_debug" = "xyes" ; then
    103         CFLAGS="$CFLAGS -g -O0"
    104         CXXFLAGS="$CXXFLAGS -g -O0"
    105 else
    106         CFLAGS="$CFLAGS -g -O3 -funroll-loops -DNDEBUG "
    107         CXXFLAGS="$CXXFLAGS -g -O3 -funroll-loops -DNDEBUG "
    108 fi
    109 
    110101
    111102dnl ----------------------------------------------------------------------------
     
    336327        Source code location:       ${srcdir}
    337328        Compiler:                   ${CXX}
    338         Debugging support           ${enable_debug}
    339329        Build Command-Line client:  ${build_cli}
    340330        Build Daemon:               ${build_daemon}
  • branches/1.5x/libtransmission/net.c

    r7729 r7741  
    5858    { { { { INADDR_ANY, 0x00, 0x00, 0x00 } } } } };
    5959
    60 
    6160#ifdef WIN32
    6261static const char *
     
    463462}
    464463
     464static tr_bool
     465isMulticastAddress( 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
     476tr_bool
     477tr_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
    465488int
    466489tr_netOpenTCP( tr_session        * session,
     
    475498    assert( tr_isAddress( addr ) );
    476499
    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 ) )
    481501        return -EINVAL;
    482502
  • branches/1.5x/libtransmission/net.h

    r7722 r7741  
    8989void tr_normalizeV4Mapped( tr_address * const addr );
    9090
     91tr_bool tr_isValidPeerAddress( const tr_address * addr, tr_port port );
     92
    9193void tr_suspectAddress( const tr_address * a, const char * source );
    9294
  • branches/1.5x/libtransmission/peer-mgr.c

    r7722 r7741  
    13161316
    13171317        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 );
    13191320
    13201321        managerUnlock( t->manager );
  • branches/1.5x/libtransmission/web.c

    r7722 r7741  
    126126        }
    127127
    128         curl_easy_setopt( easy, CURLOPT_DNS_CACHE_TIMEOUT, 3600L );
    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 );
    130130        curl_easy_setopt( easy, CURLOPT_FOLLOWLOCATION, 1L );
    131131        curl_easy_setopt( easy, CURLOPT_FORBID_REUSE, 1L );
     132        curl_easy_setopt( easy, CURLOPT_MAXREDIRS, 16L );
    132133        curl_easy_setopt( easy, CURLOPT_NOSIGNAL, 1L );
    133134        curl_easy_setopt( easy, CURLOPT_PRIVATE, task );
     
    200201remove_finished_tasks( tr_web * g )
    201202{
    202     for( ;; )
     203    CURL * easy;
     204
     205    do
    203206    {
    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 ) {
    214219            long code;
    215220            struct tr_web_task * task;
    216221            curl_easy_getinfo( easy, CURLINFO_PRIVATE, (void*)&task );
    217222            curl_easy_getinfo( easy, CURLINFO_RESPONSE_CODE, &code );
    218             task_finish( task, code );
    219223            curl_multi_remove_handle( g->multi, easy );
    220224            curl_easy_cleanup( easy );
    221         }
    222     }
     225            task_finish( task, code );
     226        }
     227    }
     228    while ( easy );
    223229
    224230    g->prev_running = g->still_running;
Note: See TracChangeset for help on using the changeset viewer.