]> granicus.if.org Git - transmission/commitdiff
(trunk libT) copyediting: peer-io's "EncryptionMode" type had a name too similar...
authorJordan Lee <jordan@transmissionbt.com>
Thu, 31 Mar 2011 16:41:52 +0000 (16:41 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Thu, 31 Mar 2011 16:41:52 +0000 (16:41 +0000)
libtransmission/peer-io.c
libtransmission/peer-io.h

index 3cdbd573c0f75dbe7d03e8c6ab50300073c036a1..c3afd378f7f2ec5ae25709c3690ed0e2b6490c8a 100644 (file)
@@ -956,13 +956,13 @@ tr_peerIoGetWriteBufferSpace( const tr_peerIo * io, uint64_t now )
 **/
 
 void
-tr_peerIoSetEncryption( tr_peerIo * io, uint32_t encryptionMode )
+tr_peerIoSetEncryption( tr_peerIo * io, tr_encryption_type encryption_type )
 {
     assert( tr_isPeerIo( io ) );
-    assert( encryptionMode == PEER_ENCRYPTION_NONE
-         || encryptionMode == PEER_ENCRYPTION_RC4 );
+    assert( encryption_type == PEER_ENCRYPTION_NONE
+         || encryption_type == PEER_ENCRYPTION_RC4 );
 
-    io->encryptionMode = encryptionMode;
+    io->encryption_type = encryption_type;
 }
 
 /**
@@ -995,7 +995,7 @@ evbuffer_peek_all( struct evbuffer * buf, size_t * setme_vecCount )
 static void
 maybeEncryptBuffer( tr_peerIo * io, struct evbuffer * buf )
 {
-    if( io->encryptionMode == PEER_ENCRYPTION_RC4 )
+    if( io->encryption_type == PEER_ENCRYPTION_RC4 )
     {
         size_t i, n;
         struct evbuffer_iovec * iovec = evbuffer_peek_all( buf, &n );
@@ -1066,7 +1066,7 @@ tr_peerIoReadBytes( tr_peerIo * io, struct evbuffer * inbuf, void * bytes, size_
     assert( tr_isPeerIo( io ) );
     assert( evbuffer_get_length( inbuf )  >= byteCount );
 
-    switch( io->encryptionMode )
+    switch( io->encryption_type )
     {
         case PEER_ENCRYPTION_NONE:
             evbuffer_remove( inbuf, bytes, byteCount );
index 8645c1fd814a81a7a980d5171f68c168fbddb6f6..eff3ac2de6a7a7df4f6c0baed844e6ea44606976 100644 (file)
@@ -47,6 +47,15 @@ typedef enum
 }
 ReadState;
 
+typedef enum
+{
+    /* these match the values in MSE's crypto_select */
+    PEER_ENCRYPTION_NONE  = ( 1 << 0 ),
+    PEER_ENCRYPTION_RC4   = ( 1 << 1 )
+}
+tr_encryption_type;
+
+
 typedef ReadState ( *tr_can_read_cb  )( struct tr_peerIo * io,
                                         void             * user_data,
                                         size_t           * setme_piece_byte_count );
@@ -76,7 +85,7 @@ typedef struct tr_peerIo
 
     int                   magicNumber;
 
-    uint32_t              encryptionMode;
+    tr_encryption_type    encryption_type;
     bool                  isSeed;
 
     tr_port               port;
@@ -278,20 +287,12 @@ static inline struct tr_crypto * tr_peerIoGetCrypto( tr_peerIo * io )
     return io->crypto;
 }
 
-typedef enum
-{
-    /* these match the values in MSE's crypto_select */
-    PEER_ENCRYPTION_NONE  = ( 1 << 0 ),
-    PEER_ENCRYPTION_RC4   = ( 1 << 1 )
-}
-EncryptionMode;
-
-void tr_peerIoSetEncryption( tr_peerIo * io, uint32_t encryptionMode );
+void tr_peerIoSetEncryption( tr_peerIo * io, tr_encryption_type encryption_type );
 
 static inline bool
 tr_peerIoIsEncrypted( const tr_peerIo * io )
 {
-    return ( io != NULL ) && ( io->encryptionMode == PEER_ENCRYPTION_RC4 );
+    return ( io != NULL ) && ( io->encryption_type == PEER_ENCRYPTION_RC4 );
 }
 
 void evbuffer_add_uint8 ( struct evbuffer * outbuf, uint8_t byte );