summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-11 20:45:26 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-11 20:45:26 +0000
commitb62d379f9274c219615520d6805a4fa985970faf (patch)
tree6664addacf93cd83f0d9c6414ac13719f8273ba6 /src/or/or.h
parent375acaab2666a7fcfcb79e5d6c9b6d0ad52a3e8c (diff)
downloadtor-b62d379f9274c219615520d6805a4fa985970faf.tar.gz
tor-b62d379f9274c219615520d6805a4fa985970faf.zip
r15689@catbus: nickm | 2007-10-11 16:40:25 -0400
Fix bug 451. This was a nasty bug, so let's fix it twice: first, by banning recursive calls to connection_handle_write from connection_flushed_some; and second, by not calling connection_finished_flushing() on a closed connection. Backport candidate. svn:r11882
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h
index e2c5c8a71c..9cd56c3d02 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -744,9 +744,6 @@ typedef struct connection_t {
/* 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. If they ever need more than
- * one byte, we can shave some bits off type, state, and purpose above, none
- * of which is ever over 31.)
*/
unsigned read_blocked_on_bw:1; /**< Boolean: should we start reading again
* once the bandwidth throttler allows it? */
@@ -769,6 +766,9 @@ typedef struct connection_t {
/** For AP connections only. If 1, and we fail to reach the chosen exit,
* stop requiring it. */
unsigned int chosen_exit_optional:1;
+ /** Set to 1 when we're inside connection_flushed_some to keep us from
+ * calling connection_handle_write() recursively. */
+ unsigned int in_flushed_some:1;
/* For linked connections:
*/
@@ -781,6 +781,9 @@ typedef struct connection_t {
/** True iff we're currently able to read on the linked conn, and our
* read_event should be made active with libevent. */
unsigned int active_on_link:1;
+ /** True iff we've called connection_close_immediate on this linked
+ * connection */
+ unsigned int linked_conn_is_closed:1;
int s; /**< Our socket; -1 if this connection is closed, or has no
* socket. */