summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-10-20 17:54:48 +0000
committerNick Mathewson <nickm@torproject.org>2006-10-20 17:54:48 +0000
commitb27cb38dee3aa024e191a974bcf2801d4e87c0a5 (patch)
treea08aa6d0cd08cea79e981975cb9b75ed803cce87 /src/or/connection_edge.c
parent8e94097edb05b204cff7772588a3376507b3fd0b (diff)
downloadtor-b27cb38dee3aa024e191a974bcf2801d4e87c0a5.tar.gz
tor-b27cb38dee3aa024e191a974bcf2801d4e87c0a5.zip
r9307@Kushana: nickm | 2006-10-20 13:53:54 -0400
Have connection_about_to_close use an end_reason field in edge_connection_t to tell what reason to tell the controller for closing the stream. Set end_reason in connection_edge_end, connection_mark_unattached_ap, and everwhere we set edge_has_sent_end. Add a changelog entry. svn:r8779
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 04e7b0f2fa..9e7173ad48 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -63,6 +63,7 @@ _connection_mark_unattached_ap(edge_connection_t *conn, int endreason,
_connection_mark_for_close(TO_CONN(conn), line, file);
conn->_base.hold_open_until_flushed = 1;
+ conn->end_reason = endreason;
}
/** There was an EOF. Send an end and mark the connection for close.
@@ -155,6 +156,7 @@ connection_edge_destroy(uint16_t circ_id, edge_connection_t *conn)
} else {
/* closing the circuit, nothing to send an END to */
conn->_base.edge_has_sent_end = 1;
+ conn->end_reason = END_STREAM_REASON_DESTROY;
connection_mark_for_close(TO_CONN(conn));
conn->_base.hold_open_until_flushed = 1;
}
@@ -213,6 +215,7 @@ connection_edge_end(edge_connection_t *conn, char reason,
}
conn->_base.edge_has_sent_end = 1;
+ conn->end_reason = reason;
return 0;
}
@@ -408,6 +411,7 @@ connection_ap_expire_beginning(void)
connection_edge_end(conn, END_STREAM_REASON_TIMEOUT, conn->cpath_layer);
/* un-mark it as ending, since we're going to reuse it */
conn->_base.edge_has_sent_end = 0;
+ conn->end_reason = 0;
/* kludge to make us not try this circuit again, yet to allow
* current streams on it to survive if they can: make it
* unattractive to use for new streams */