[or-cvs] r6918: Fix comments that implied that only dir connections had a pu (tor/trunk/src/or)

nickm at seul.org nickm at seul.org
Thu Jul 27 04:10:54 UTC 2006


Author: nickm
Date: 2006-07-27 00:10:51 -0400 (Thu, 27 Jul 2006)
New Revision: 6918

Modified:
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/or.h
Log:
Fix comments that implied that only dir connections had a purpose field, and the code that believed in those comments.

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2006-07-27 03:47:11 UTC (rev 6917)
+++ tor/trunk/src/or/connection.c	2006-07-27 04:10:51 UTC (rev 6918)
@@ -2235,10 +2235,10 @@
       tor_assert(conn->purpose == EXIT_PURPOSE_CONNECT ||
                  conn->purpose == EXIT_PURPOSE_RESOLVE);
     }
+  } else if (conn->type != CONN_TYPE_DIR) {
+    /* Purpose is only used for dir and exit types currently */
+    tor_assert(!conn->purpose);
   }
-  if (conn->type != CONN_TYPE_DIR) {
-    tor_assert(!conn->purpose); /* only used for dir types currently */
-  }
 
   switch (conn->type)
     {

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-07-27 03:47:11 UTC (rev 6917)
+++ tor/trunk/src/or/or.h	2006-07-27 04:10:51 UTC (rev 6918)
@@ -605,7 +605,7 @@
 
   uint8_t type; /**< What kind of connection is this? */
   uint8_t state; /**< Current state of this connection. */
-  uint8_t purpose; /**< Only used for DIR types currently. */
+  uint8_t purpose; /**< Only used for DIR and EXIT types currently. */
   unsigned wants_to_read:1; /**< Boolean: should we start reading again once
                             * the bandwidth throttler allows it? */
   unsigned wants_to_write:1; /**< Boolean: should we start writing again once



More information about the tor-commits mailing list