Changeset 12323


Ignore:
Timestamp:
Apr 5, 2011, 9:14:44 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) more heap pruning: avoid an unnecessary malloc() + free() when reading PadD during an outbound encrypted handshake

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/handshake.c

    r12322 r12323  
    572572{
    573573    const size_t needlen = handshake->pad_d_len;
    574     uint8_t *    tmp;
    575574
    576575    dbgmsg( handshake, "pad d: need %zu, got %zu",
     
    579578        return READ_LATER;
    580579
    581     tmp = tr_new( uint8_t, needlen );
    582     tr_peerIoReadBytes( handshake->io, inbuf, tmp, needlen );
    583     tr_free( tmp );
     580    tr_peerIoDrain( handshake->io, inbuf, needlen );
    584581
    585582    tr_peerIoSetEncryption( handshake->io, handshake->crypto_select );
Note: See TracChangeset for help on using the changeset viewer.