Ignore:
Timestamp:
Mar 10, 2011, 12:35:23 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) Add an enumeration for the peer id length. Use that enum for the peer_id fields in tr_session and tr_torrent.

This also avoids an extra malloc/free per-torrent and per-session, but mostly this tweak is for the extra readability of the PEER_ID_LEN=20 enum.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r12096 r12121  
    15091509    tr_free( tor->downloadDir );
    15101510    tr_free( tor->incompleteDir );
    1511     tr_free( tor->peer_id );
    15121511
    15131512    if( tor == session->torrentList )
     
    16181617     * change the peerid. It would help sometimes if a stopped event
    16191618     * was missed to ensure that we didn't think someone was cheating. */
    1620     tr_free( tor->peer_id );
    1621     tor->peer_id = tr_peerIdNew( );
     1619    tr_peerIdInit( tor->peer_id );
    16221620    tor->isRunning = 1;
    16231621    tr_torrentSetDirty( tor );
Note: See TracChangeset for help on using the changeset viewer.