Changeset 12282


Ignore:
Timestamp:
Mar 31, 2011, 4:41:52 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) copyediting: peer-io's "EncryptionMode?" type had a name too similar to tr_encryption_mode... rename it to reduce potential confusion

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r12256 r12282  
    957957
    958958void
    959 tr_peerIoSetEncryption( tr_peerIo * io, uint32_t encryptionMode )
    960 {
    961     assert( tr_isPeerIo( io ) );
    962     assert( encryptionMode == PEER_ENCRYPTION_NONE
    963          || encryptionMode == PEER_ENCRYPTION_RC4 );
    964 
    965     io->encryptionMode = encryptionMode;
     959tr_peerIoSetEncryption( tr_peerIo * io, tr_encryption_type encryption_type )
     960{
     961    assert( tr_isPeerIo( io ) );
     962    assert( encryption_type == PEER_ENCRYPTION_NONE
     963         || encryption_type == PEER_ENCRYPTION_RC4 );
     964
     965    io->encryption_type = encryption_type;
    966966}
    967967
     
    996996maybeEncryptBuffer( tr_peerIo * io, struct evbuffer * buf )
    997997{
    998     if( io->encryptionMode == PEER_ENCRYPTION_RC4 )
     998    if( io->encryption_type == PEER_ENCRYPTION_RC4 )
    999999    {
    10001000        size_t i, n;
     
    10671067    assert( evbuffer_get_length( inbuf )  >= byteCount );
    10681068
    1069     switch( io->encryptionMode )
     1069    switch( io->encryption_type )
    10701070    {
    10711071        case PEER_ENCRYPTION_NONE:
  • trunk/libtransmission/peer-io.h

    r12229 r12282  
    4848ReadState;
    4949
     50typedef enum
     51{
     52    /* these match the values in MSE's crypto_select */
     53    PEER_ENCRYPTION_NONE  = ( 1 << 0 ),
     54    PEER_ENCRYPTION_RC4   = ( 1 << 1 )
     55}
     56tr_encryption_type;
     57
     58
    5059typedef ReadState ( *tr_can_read_cb  )( struct tr_peerIo * io,
    5160                                        void             * user_data,
     
    7786    int                   magicNumber;
    7887
    79     uint32_t              encryptionMode;
     88    tr_encryption_type    encryption_type;
    8089    bool                  isSeed;
    8190
     
    279288}
    280289
    281 typedef enum
    282 {
    283     /* these match the values in MSE's crypto_select */
    284     PEER_ENCRYPTION_NONE  = ( 1 << 0 ),
    285     PEER_ENCRYPTION_RC4   = ( 1 << 1 )
    286 }
    287 EncryptionMode;
    288 
    289 void tr_peerIoSetEncryption( tr_peerIo * io, uint32_t encryptionMode );
     290void tr_peerIoSetEncryption( tr_peerIo * io, tr_encryption_type encryption_type );
    290291
    291292static inline bool
    292293tr_peerIoIsEncrypted( const tr_peerIo * io )
    293294{
    294     return ( io != NULL ) && ( io->encryptionMode == PEER_ENCRYPTION_RC4 );
     295    return ( io != NULL ) && ( io->encryption_type == PEER_ENCRYPTION_RC4 );
    295296}
    296297
Note: See TracChangeset for help on using the changeset viewer.