]> granicus.if.org Git - transmission/commitdiff
move tr_peer.encryptionPreference to tr_peermsgs.encryptionPreference
authorJordan Lee <jordan@transmissionbt.com>
Sun, 3 Feb 2013 22:45:32 +0000 (22:45 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sun, 3 Feb 2013 22:45:32 +0000 (22:45 +0000)
libtransmission/peer-common.h
libtransmission/peer-mgr.h
libtransmission/peer-msgs.c

index ffa6e0333f9f2678861c45eb6bbe36816d64a31a..566c128774a61d052edfcde824fc34a84c4d56b0 100644 (file)
@@ -112,8 +112,6 @@ typedef struct tr_peer
   /* number of bad pieces they've contributed to */
   uint8_t strikes;
 
-  uint8_t encryption_preference;
-
   /* how many requests the peer has made that we haven't responded to yet */
   int pendingReqsToClient;
 
@@ -121,6 +119,8 @@ typedef struct tr_peer
   int pendingReqsToPeer;
 
   struct tr_peerIo * io;
+
+  /* Hook to private peer-mgr information */
   struct peer_atom * atom;
 
   /** how complete the peer's copy of the torrent is. [0.0...1.0] */
index 12a3039e2c063ac480048361dd91d9c8f1c5445c..85aa67ab7b8b551bdb00238d29aafd010375b157 100644 (file)
@@ -69,13 +69,6 @@ tr_pex;
 struct tr_peerIo;
 struct tr_peermsgs;
 
-enum
-{
-  ENCRYPTION_PREFERENCE_UNKNOWN,
-  ENCRYPTION_PREFERENCE_YES,
-  ENCRYPTION_PREFERENCE_NO
-};
-
 /* opaque forward declaration */
 struct peer_atom;
 
index 7e61defb102997ca2fcd574fc8bfb264ca69f352..13aa78fe47e2795c117bb9446b64f077901bd51e 100644 (file)
@@ -104,6 +104,16 @@ enum
     AWAITING_BT_PIECE
 };
 
+typedef enum
+{
+  ENCRYPTION_PREFERENCE_UNKNOWN,
+  ENCRYPTION_PREFERENCE_YES,
+  ENCRYPTION_PREFERENCE_NO
+}
+encryption_preference_t;
+
+
+
 /**
 ***
 **/
@@ -179,7 +189,9 @@ struct tr_peermsgs
 
     tr_port         dht_port;
 
-    size_t          metadata_size_hint;
+    encryption_preference_t  encryption_preference;
+
+    size_t                   metadata_size_hint;
 #if 0
     size_t                 fastsetSize;
     tr_piece_index_t       fastset[MAX_FAST_SET_SIZE];
@@ -883,8 +895,8 @@ parseLtepHandshake (tr_peermsgs * msgs, int len, struct evbuffer * inbuf)
 
     /* does the peer prefer encrypted connections? */
     if (tr_variantDictFindInt (&val, TR_KEY_e, &i)) {
-        msgs->peer->encryption_preference = i ? ENCRYPTION_PREFERENCE_YES
-                                              : ENCRYPTION_PREFERENCE_NO;
+        msgs->encryption_preference = i ? ENCRYPTION_PREFERENCE_YES
+                                        : ENCRYPTION_PREFERENCE_NO;
         if (i)
             pex.flags |= ADDED_F_ENCRYPTION_FLAG;
     }