Changeset 11398


Ignore:
Timestamp:
Nov 11, 2010, 3:31:11 PM (11 years ago)
Author:
charles
Message:

(trunk libT) add some new bugs to the code so that it will crash when vraa tries to use it

Location:
trunk/libtransmission
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/blocklist.c

    r11389 r11398  
    349349
    350350        /* zap the linefeed */
    351         if(( walk = strchr( line, '\r' ))) *walk = '\0'; 
    352         if(( walk = strchr( line, '\n' ))) *walk = '\0'; 
     351        if(( walk = strchr( line, '\r' ))) *walk = '\0';
     352        if(( walk = strchr( line, '\n' ))) *walk = '\0';
    353353
    354354        if( !parseLine( line, &range ) )
  • trunk/libtransmission/cache.c

    r11184 r11398  
    304304static struct cache_block *
    305305findBlock( tr_cache           * cache,
    306            tr_torrent         * torrent, 
     306           tr_torrent         * torrent,
    307307           tr_piece_index_t     piece,
    308308           uint32_t             offset )
  • trunk/libtransmission/fdlimit.c

    r11349 r11398  
    400400#endif
    401401
    402 #if defined( SYS_DARWIN ) 
     402#if defined( SYS_DARWIN )
    403403    /**
    404404     * 1. Enable readahead for reasons described above w/POSIX_FADV_SEQUENTIAL.
     
    412412    {
    413413        const int err = errno;
    414         fcntl( file->fd, F_NOCACHE, 1 ); 
    415         fcntl( file->fd, F_RDAHEAD, 1 ); 
     414        fcntl( file->fd, F_NOCACHE, 1 );
     415        fcntl( file->fd, F_RDAHEAD, 1 );
    416416        errno = err;
    417417    }
  • trunk/libtransmission/metainfo.c

    r11248 r11398  
    4343        if( *pch == '/' )
    4444            *pch = '_';
    45    
     45
    4646    ret = tr_strdup_printf( "%s.%16.16s", name, inf->hashString );
    4747
     
    448448
    449449            /* maybe get the display name */
    450          
    451450            if( tr_bencDictFindStr( d, "display-name", &str ) ) {
    452451                tr_free( inf->name );
  • trunk/libtransmission/peer-io.c

    r11349 r11398  
    261261        }
    262262
    263         tr_net_strerror( errstr, sizeof( errstr ), e ); 
     263        tr_net_strerror( errstr, sizeof( errstr ), e );
    264264        dbgmsg( io, "event_read_cb got an error. res is %d, what is %hd, errno is %d (%s)", res, what, e, errstr );
    265265
     
    401401        maybeSetCongestionAlgorithm( socket, session->peer_congestion_algorithm );
    402402    }
    403    
     403
    404404    io = tr_new0( tr_peerIo, 1 );
    405405    io->magicNumber = MAGIC_NUMBER;
     
    946946            if( res == 0 )
    947947                what |= EVBUFFER_EOF;
    948             tr_net_strerror( errstr, sizeof( errstr ), e ); 
     948            tr_net_strerror( errstr, sizeof( errstr ), e );
    949949            dbgmsg( io, "tr_peerIoTryRead got an error. res is %d, what is %hd, errno is %d (%s)", res, what, e, errstr );
    950950            io->gotError( io, what, io->userData );
     
    975975            const short what = EVBUFFER_WRITE | EVBUFFER_ERROR;
    976976
    977             tr_net_strerror( errstr, sizeof( errstr ), e ); 
     977            tr_net_strerror( errstr, sizeof( errstr ), e );
    978978            dbgmsg( io, "tr_peerIoTryWrite got an error. res is %d, what is %hd, errno is %d (%s)", n, what, e, errstr );
    979979
  • trunk/libtransmission/ptrarray.c

    r10798 r11398  
    217217    return ret;
    218218}
    219 
  • trunk/libtransmission/rpc-server.c

    r11333 r11398  
    387387
    388388#if 0
    389             fprintf( stderr, "compressed response is %.2f of original (raw==%zu bytes; compressed==%zu)\n", 
     389            fprintf( stderr, "compressed response is %.2f of original (raw==%zu bytes; compressed==%zu)\n",
    390390                             (double)EVBUFFER_LENGTH(out)/content_len,
    391391                             content_len, EVBUFFER_LENGTH(out) );
  • trunk/libtransmission/rpcimpl.c

    r11368 r11398  
    787787    int i;
    788788    int maxTier = -1;
    789    
    790     for( i=0; i<n; ++i ) 
     789
     790    for( i=0; i<n; ++i )
    791791    {
    792792        tgt[i].tier = src[i].tier;
  • trunk/libtransmission/utils.c

    r11350 r11398  
    452452        if( ( *str == '%' ) && ( str[1] == '\'' ) )
    453453            str = str + 1;
    454  
     454
    455455    }
    456456    *out = '\0';
     
    12231223    const char zero = '\0';
    12241224    struct evbuffer * buf = evbuffer_new( );
    1225  
     1225
    12261226    while( !tr_utf8_validate( in, inlen, &end ) )
    12271227    {
     
    12331233        evbuffer_add( buf, "?", 1 );
    12341234    }
    1235  
     1235
    12361236    evbuffer_add( buf, in, inlen );
    12371237    evbuffer_add( buf, &zero, 1 );
     
    14381438    char * pt;
    14391439    char buf[128];
    1440     const int max_precision = (int) log10( 1.0 / DBL_EPSILON ) - 1; 
    1441     tr_snprintf( buf, sizeof( buf ), "%.*f", max_precision, x ); 
     1440    const int max_precision = (int) log10( 1.0 / DBL_EPSILON ) - 1;
     1441    tr_snprintf( buf, sizeof( buf ), "%.*f", max_precision, x );
    14421442    if(( pt = strstr( buf, localeconv()->decimal_point )))
    14431443        pt[precision ? precision+1 : 0] = '\0';
     
    16091609    uint64_t value;
    16101610};
    1611  
     1611
    16121612struct formatter_units
    16131613{
     
    17211721
    17221722unsigned int tr_mem_K = 0u;
    1723  
     1723
    17241724void
    17251725tr_formatter_mem_init( unsigned int kilo,
  • trunk/libtransmission/verify.c

    r11388 r11398  
    273273}
    274274
    275 static int 
    276 compareVerifyByPriorityAndSize( const void * va, const void * vb ) 
    277 { 
    278     const struct verify_node * a = va; 
    279     const struct verify_node * b = vb; 
     275static int
     276compareVerifyByPriorityAndSize( const void * va, const void * vb )
     277{
     278    const struct verify_node * a = va;
     279    const struct verify_node * b = vb;
    280280
    281281    /* higher priority comes before lower priority */
     
    289289    if( a->current_size > b->current_size ) return  1;
    290290    return 0;
    291 } 
     291}
    292292
    293293void
  • trunk/libtransmission/web.c

    r11367 r11398  
    145145    CURL * e = curl_easy_init( );
    146146    const long verbose = getenv( "TR_CURL_VERBOSE" ) != NULL;
    147     char * cookie_filename = tr_buildPath( s->configDir, "cookies.txt", NULL );         
     147    char * cookie_filename = tr_buildPath( s->configDir, "cookies.txt", NULL );
    148148
    149149    curl_easy_setopt( e, CURLOPT_AUTOREFERER, 1L );
    150     curl_easy_setopt( e, CURLOPT_COOKIEFILE, cookie_filename ); 
     150    curl_easy_setopt( e, CURLOPT_COOKIEFILE, cookie_filename );
    151151    curl_easy_setopt( e, CURLOPT_ENCODING, "gzip;q=1.0, deflate, identity" );
    152152    curl_easy_setopt( e, CURLOPT_FOLLOWLOCATION, 1L );
     
    173173        curl_easy_setopt( e, CURLOPT_RANGE, task->range );
    174174
    175     tr_free( cookie_filename ); 
     175    tr_free( cookie_filename );
    176176    return e;
    177177}
     
    233233 * On win32, any two of the parameters, readfds, writefds, or exceptfds,
    234234 * can be given as null. At least one must be non-null, and any non-null
    235  * descriptor set must contain at least one handle to a socket. 
     235 * descriptor set must contain at least one handle to a socket.
    236236 */
    237237static void
     
    253253        const int e = EVUTIL_SOCKET_ERROR( );
    254254        tr_net_strerror( errstr, sizeof( errstr ), e );
    255         dbgmsg( "Error: select (%d) %s", e, errstr ); 
     255        dbgmsg( "Error: select (%d) %s", e, errstr );
    256256    }
    257257#else
Note: See TracChangeset for help on using the changeset viewer.