aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-12 20:30:42 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-12 20:30:42 +0000
commita4a481d81cee5c5d53f0165e0777b541207c1853 (patch)
tree1bef88b44348bb8f73d4df3fb5e26164e2ce63ec /src/or/or.h
parent5fb2ab1e654ad5c121fff834897ea4cf920774ca (diff)
downloadtor-a4a481d81cee5c5d53f0165e0777b541207c1853.tar.gz
tor-a4a481d81cee5c5d53f0165e0777b541207c1853.zip
Implement proposal 148: Make client stream end reasons uniform.
This patch makes every RELAY_COMMAND_END cell that we send pass through one of two functions: connection_edge_end and relay_send_end_cell_from_edge. Both of these functions check the circuit purpose, and change the reason to MISC if the circuit purpose means that it's for client use. svn:r17612
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/or.h b/src/or/or.h
index aa5c92fa97..eb83d477a3 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -457,6 +457,8 @@ typedef enum {
/** Client-side circuit purpose: at Alice, rendezvous established. */
#define CIRCUIT_PURPOSE_C_REND_JOINED 12
+#define _CIRCUIT_PURPOSE_C_MAX 12
+
/** Hidden-service-side circuit purpose: at Bob, waiting for introductions. */
#define CIRCUIT_PURPOSE_S_ESTABLISH_INTRO 13
/** Hidden-service-side circuit purpose: at Bob, successfully established
@@ -478,6 +480,9 @@ typedef enum {
/** True iff the circuit purpose <b>p</b> is for a circuit that
* originated at this node. */
#define CIRCUIT_PURPOSE_IS_ORIGIN(p) ((p)>_CIRCUIT_PURPOSE_OR_MAX)
+#define CIRCUIT_PURPOSE_IS_CLIENT(p) \
+ ((p)> _CIRCUIT_PURPOSE_OR_MAX && \
+ (p)<=_CIRCUIT_PURPOSE_C_MAX)
#define CIRCUIT_IS_ORIGIN(c) (CIRCUIT_PURPOSE_IS_ORIGIN((c)->purpose))
/** How many circuits do we want simultaneously in-progress to handle
@@ -2970,7 +2975,7 @@ int connection_edge_reached_eof(edge_connection_t *conn);
int connection_edge_process_inbuf(edge_connection_t *conn,
int package_partial);
int connection_edge_destroy(circid_t circ_id, edge_connection_t *conn);
-int connection_edge_end(edge_connection_t *conn, char reason);
+int connection_edge_end(edge_connection_t *conn, uint8_t reason);
int connection_edge_end_errno(edge_connection_t *conn);
int connection_edge_finished_flushing(edge_connection_t *conn);
int connection_edge_finished_connecting(edge_connection_t *conn);