Changeset 10557


Ignore:
Timestamp:
04/30/10 22:58:03 (6 years ago)
Author:
livings124
Message:

#3041 remove the code to skip lines with unreadable characters (this was skipping valid lines); add temporary extra debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/blocklist.c

    r10540 r10557  
    265265    while( !fggets( &line, in ) )
    266266    {
    267         const char * pch;
    268267        char * rangeBegin;
    269268        char * rangeEnd;
     
    274273        ++inCount;
    275274
    276         for( pch=line; pch && *pch; ++pch )
    277             if( !isprint( *pch ) && ( *pch != '\r' ) && ( *pch != '\n' ) )
    278                 break;
    279         if( !pch || *pch ) {
    280             tr_err( "skipping line #%d which contains nonprintable characters\n", inCount );
    281             free( line );
    282             continue;
    283         }
    284 
    285275        rangeBegin = strrchr( line, ':' );
    286276        if( !rangeBegin ){ free( line ); continue; }
     
    294284
    295285        if( !tr_pton( rangeBegin, &addr ) )
    296             tr_err( "blocklist skipped invalid address [%s]\n", rangeBegin );
     286        {
     287            printf( "error rangeBegin: %s", line );
     288            tr_err( _( "blocklist skipped invalid address at line %d" ), inCount );
     289            free( line );
     290            continue;
     291        }
    297292        range.begin = ntohl( addr.addr.addr4.s_addr );
    298293
    299294        if( !tr_pton( rangeEnd, &addr ) )
    300             tr_err( "blocklist skipped invalid address [%s]\n", rangeEnd );
     295        {
     296            printf( "error rangeEnd: %s", line );
     297            tr_err( _( "blocklist skipped invalid address at line %d" ), inCount );
     298            free( line );
     299            continue;
     300        }
    301301        range.end = ntohl( addr.addr.addr4.s_addr );
    302 
    303         free( line );
    304302
    305303        if( fwrite( &range, sizeof( struct tr_ip_range ), 1, out ) != 1 )
     
    320318    }
    321319
    322 
    323320    fclose( out );
    324321    fclose( in );
Note: See TracChangeset for help on using the changeset viewer.