diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-10-24 23:39:28 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-14 23:16:22 -0500 |
commit | c64ee7099f32c2630d8ed65febf92357cd5e9487 (patch) | |
tree | 3ed3a50bc066bbe263443ce4d9d3bd1511f84778 /src | |
parent | b35a0d113233fa29439500555201b85c1dec64b1 (diff) | |
download | tor-c64ee7099f32c2630d8ed65febf92357cd5e9487.tar.gz tor-c64ee7099f32c2630d8ed65febf92357cd5e9487.zip |
Record, send, and receive flags in BEGIN cells
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection_edge.c | 8 | ||||
-rw-r--r-- | src/or/or.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index a840b43d7b..9a4f274bb1 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1656,6 +1656,10 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn) ap_conn->socks_request->address : "", ap_conn->socks_request->port); payload_len = (int)strlen(payload)+1; + if (payload_len <= RELAY_PAYLOAD_SIZE - 4) { + set_uint32(payload + payload_len, htonl(edge_conn->begincell_flags)); + payload_len += 4; + } log_info(LD_APP, "Sending relay cell %d to begin stream %d.", @@ -2235,14 +2239,14 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) } log_debug(LD_EXIT,"Creating new exit connection."); - n_stream = edge_connection_new(CONN_TYPE_EXIT, AF_INET); + n_stream = edge_connection_new(CONN_TYPE_EXIT, AF_INET);/*XXXX IPv6*/ /* Remember the tunneled request ID in the new edge connection, so that * we can measure download times. */ n_stream->dirreq_id = circ->dirreq_id; n_stream->base_.purpose = EXIT_PURPOSE_CONNECT; - + n_stream->begincell_flags = bcell.flags; n_stream->stream_id = rh.stream_id; n_stream->base_.port = port; /* leave n_stream->s at -1, because it's not yet valid */ diff --git a/src/or/or.h b/src/or/or.h index 05d27b1508..fa90aaee5b 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1414,6 +1414,8 @@ typedef struct edge_connection_t { uint32_t address_ttl; /**< TTL for address-to-addr mapping on exit * connection. Exit connections only. */ + uint32_t begincell_flags; /** Flags sent or received in the BEGIN cell + * for this connection */ streamid_t stream_id; /**< The stream ID used for this edge connection on its * circuit */ |