[or-cvs] r6935: Document split fields better. Now, I think we can take a bre (in tor/trunk: . doc src/or)

nickm at seul.org nickm at seul.org
Fri Jul 28 15:11:29 UTC 2006


Author: nickm
Date: 2006-07-28 11:11:28 -0400 (Fri, 28 Jul 2006)
New Revision: 6935

Modified:
   tor/trunk/
   tor/trunk/doc/TODO
   tor/trunk/src/or/or.h
Log:
 r6950 at Kushana:  nickm | 2006-07-28 10:32:08 -0400
 Document split fields better. Now, I think we can take a break from type splitting for a bit.



Property changes on: tor/trunk
___________________________________________________________________
Name: svk:merge
   - c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6949
   + c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6950

Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO	2006-07-28 15:11:20 UTC (rev 6934)
+++ tor/trunk/doc/TODO	2006-07-28 15:11:28 UTC (rev 6935)
@@ -58,21 +58,23 @@
           o Mmap cached-routers file; when building it, go oldest-to-newest.
           - More unit tests and asserts for cached-routers file: ensure digest
             for the right router.  Verify dl by digest, fp, etc.
-          - Make sure cached-routers values and offsets are correct in the
+          . Make sure cached-routers values and offsets are correct in the
             presence of windows FS insanity.
-          - Save and mmap v1 directories; store them zipped, not uncompressed.
+          - Save and mmap v1 directories; store them zipped, not
+            uncompressed.
           - Store networkstatus docs zipped, not uncompressed.  Maaaybe mmap
             them too.
-        - Be a little more OO to save memory in frequently
+        o Be a little more OO to save memory in frequently
           replicated structs.
           o Split circuit_t into origin circuits and or circuits
-            . Move as many fields as reasonable out of base class.
+            o Move as many fields as reasonable out of base class.
             o Re-pack structs to avoid wasted bytes.
           o Split connection_t based on type field.
 
     - "bandwidth classes", for incoming vs initiated-here conns.
     o Asynchronous DNS
-      - and test it
+      . and test it
+      - Make it work on windows.
       - make it the default on platforms where it works
 
   - Security improvements

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-07-28 15:11:20 UTC (rev 6934)
+++ tor/trunk/src/or/or.h	2006-07-28 15:11:28 UTC (rev 6935)
@@ -607,6 +607,10 @@
   uint8_t type; /**< What kind of connection is this? */
   uint8_t state; /**< Current state of this connection. */
   uint8_t purpose; /**< Only used for DIR and EXIT types currently. */
+
+  /* The next fields are all one-bit booleans. Some are only applicable
+   * to connection subtypes, but we hold them here anyway, to save space.
+   * (Currently, they all fit into a single byte.) */
   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
@@ -614,18 +618,19 @@
   unsigned hold_open_until_flushed:1; /**< Despite this connection's being
                                       * marked for close, do we flush it
                                       * before closing it? */
+  unsigned int inbuf_reached_eof:1; /**< Boolean: did read() return 0 on this
+                                     * conn? */
   unsigned edge_has_sent_end:1; /**< For debugging; only used on edge
                          * connections.  Set once we've set the stream end,
                          * and check in circuit_about_to_close_connection(). */
   /** For control connections only. If set, we send extended info with control
    * events as appropriate. */
   unsigned int control_events_are_extended:1;
-  /** Used for OR conns that shouldn't get any new circs attached to them. !!*/
+  /** Used for OR conns that shouldn't get any new circs attached to them. */
   unsigned int or_is_obsolete:1;
   /** For AP connections only. If 1, and we fail to reach the chosen exit,
    * stop requiring it. */
   unsigned int chosen_exit_optional:1;
-  int inbuf_reached_eof:1; /**< Boolean: did read() return 0 on this conn? */
 
   int s; /**< Our socket; -1 if this connection is closed. */
   int conn_array_index; /**< Index into the global connection array. */
@@ -1281,7 +1286,7 @@
    */
   char rend_token[REND_TOKEN_LEN];
 
-  char handshake_digest[DIGEST_LEN]; /**< Stores KH for intermediate hops. */
+  char handshake_digest[DIGEST_LEN]; /**< Stores KH for the handshake. */
 } or_circuit_t;
 
 /** Convert a circuit subtype to a circuit_t.*/



More information about the tor-commits mailing list