Changeset 8217


Ignore:
Timestamp:
Apr 12, 2009, 2:52:17 PM (13 years ago)
Author:
charles
Message:

(trunk libT) more speed tweaks from valgrind

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r8092 r8217  
    181181tr_compareAddresses( const tr_address * a, const tr_address * b)
    182182{
    183     int addrlen;
     183    static const int sizes[2] = { sizeof(struct in_addr), sizeof(struct in6_addr) };
    184184
    185185    assert( tr_isAddress( a ) );
     
    190190        return a->type == TR_AF_INET ? 1 : -1;
    191191
    192     if( a->type == TR_AF_INET )
    193         addrlen = sizeof( struct in_addr );
    194     else
    195         addrlen = sizeof( struct in6_addr );
    196     return memcmp( &a->addr, &b->addr, addrlen );
     192    return memcmp( &a->addr, &b->addr, sizes[a->type] );
    197193}
    198194
  • trunk/libtransmission/peer-io.c

    r7888 r8217  
    744744
    745745        case PEER_ENCRYPTION_RC4:
    746             evbuffer_remove( inbuf, bytes, byteCount );
    747             tr_cryptoDecrypt( io->crypto, byteCount, bytes, bytes );
     746            tr_cryptoDecrypt( io->crypto, byteCount, EVBUFFER_DATA(inbuf), bytes );
     747            evbuffer_drain(inbuf, byteCount );
    748748            break;
    749749
Note: See TracChangeset for help on using the changeset viewer.