diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-07-28 15:11:28 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-07-28 15:11:28 +0000 |
commit | 84c2a6c16b00a78fc3329b7f717cfe6989fe3f28 (patch) | |
tree | 5330aba931cd21a3f7f27599b62508d2bac07937 | |
parent | 85f381153ba6a3c87e3e43e2640b313c27d9b2ff (diff) | |
download | tor-84c2a6c16b00a78fc3329b7f717cfe6989fe3f28.tar.gz tor-84c2a6c16b00a78fc3329b7f717cfe6989fe3f28.zip |
r6950@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.
svn:r6935
-rw-r--r-- | doc/TODO | 12 | ||||
-rw-r--r-- | src/or/or.h | 11 |
2 files changed, 15 insertions, 8 deletions
@@ -58,21 +58,23 @@ N . Improve memory usage on tight-memory machines. 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 diff --git a/src/or/or.h b/src/or/or.h index d05475617c..02290eb59c 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -607,6 +607,10 @@ typedef struct connection_t { 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 @@ typedef struct connection_t { 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 @@ typedef struct or_circuit_t { */ 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.*/ |