Changeset 7669


Ignore:
Timestamp:
Jan 11, 2009, 6:10:13 PM (12 years ago)
Author:
jhujhiti
Message:

(1.5x) remove tr_suspectAddress() debugging stuff from 1.5

Location:
branches/1.5x/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/libtransmission/net.c

    r7664 r7669  
    129129}
    130130
    131 void
    132 tr_suspectAddress( const tr_address * a, const char * source )
    133 {
    134     /* be really aggressive in what we report */
    135     if( a->type == TR_AF_INET && !( ntohl( a->addr.addr4.s_addr ) & 0xff000000 ) )
    136         tr_err(  "Funny looking address %s from %s", tr_ntop_non_ts( a ), source );
    137     /* /16s taken from ipv6 rib on 21 dec, 2008 */
    138     /* this is really, really ugly. expedience over quality */
    139     if( a->type == TR_AF_INET6 )
    140     {
    141         uint16_t slash16;
    142         uint16_t valid[] = { 0x339, 0x2002, 0x2003, 0x2400, 0x2401, 0x2402,
    143             0x2403, 0x2404, 0x2405, 0x2406, 0x2407, 0x2600, 0x2607, 0x2610,
    144             0x2620, 0x2800, 0x2801, 0x2a00, 0x2a01, 0x0a02, 0x2001, 0x0000 };
    145         uint16_t *p;
    146         tr_bool good = FALSE;
    147         p = valid;
    148         memcpy( &slash16, &a->addr, 2 );
    149         slash16 = ntohs( slash16 );
    150         while( *p )
    151         {
    152             if( slash16 == *p )
    153                 good = TRUE;
    154             p++;
    155         }
    156         if( !good && !IN6_IS_ADDR_V4MAPPED( &a->addr.addr6 ) )
    157             tr_err(  "Funny looking address %s from %s", tr_ntop_non_ts( a ), source );
    158     }
    159 }
    160 
    161131const char *
    162132tr_ntop( const tr_address * src, char * dst, int size )
  • branches/1.5x/libtransmission/net.h

    r7664 r7669  
    8989void tr_normalizeV4Mapped( tr_address * const addr );
    9090
    91 void tr_suspectAddress( const tr_address * a, const char * source );
    92 
    9391static TR_INLINE tr_bool tr_isAddress( const tr_address * a ) { return ( a != NULL ) && ( a->type==TR_AF_INET || a->type==TR_AF_INET6 ); }
    9492
  • branches/1.5x/libtransmission/peer-mgr.c

    r7664 r7669  
    13971397    for( i = 0 ; i < n ; i++ ) {
    13981398        memcpy( &pex[i].addr, walk, sizeof( tr_address ) );
    1399         tr_suspectAddress( &pex[i].addr, "tracker"  );
    14001399        memcpy( &pex[i].port, walk + sizeof( tr_address ), 2 );
    14011400        pex[i].flags = 0x00;
  • branches/1.5x/libtransmission/peer-msgs.c

    r7664 r7669  
    19811981            for( i = 0; i < diffs.addedCount; ++i )
    19821982            {
    1983                 tr_suspectAddress( &diffs.added[i].addr, "pex" );
    19841983                memcpy( walk, &diffs.added[i].addr.addr, 4 ); walk += 4;
    19851984                memcpy( walk, &diffs.added[i].port, 2 ); walk += 2;
     
    20122011            for( i = 0; i < diffs6.addedCount; ++i )
    20132012            {
    2014                 tr_suspectAddress( &diffs6.added[i].addr, "pex6" );
    20152013                memcpy( walk, &diffs6.added[i].addr.addr.addr6.s6_addr, 16 );
    20162014                walk += 16;
  • branches/1.5x/libtransmission/tracker.c

    r7664 r7669  
    260260        memcpy( &addr.addr.addr4, compactWalk, 4 );
    261261        memcpy( &port, compactWalk + 4, 2 );
    262         tr_suspectAddress( &addr, "compact" );
    263262       
    264263        memcpy( walk, &addr, sizeof( addr ) );
     
    292291        memcpy( &addr.addr.addr6, compactWalk, 16 );
    293292        memcpy( &port, compactWalk + 16, 2 );
    294         tr_suspectAddress( &addr, "compact6" );
    295293       
    296294        memcpy( walk, &addr, sizeof( addr ) );
     
    370368
    371369        memcpy( walk, &addr, sizeof( tr_address ) );
    372         tr_suspectAddress( &addr, "old tracker" );
    373370        port = htons( itmp );
    374371        memcpy( walk + sizeof( tr_address ), &port, 2 );
Note: See TracChangeset for help on using the changeset viewer.