diff options
author | Roger Dingledine <arma@torproject.org> | 2003-05-02 21:29:25 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-05-02 21:29:25 +0000 |
commit | 96759a609e65edf0ba48471242a94b63023fba3c (patch) | |
tree | dd8c0837888ccd5cd28ae009b1d1427a70f596db /src/or/connection_exit.c | |
parent | bb75b142187798b3599b76d53e1faf581676d30a (diff) | |
download | tor-96759a609e65edf0ba48471242a94b63023fba3c.tar.gz tor-96759a609e65edf0ba48471242a94b63023fba3c.zip |
streams are now 8 bytes, and are recognized by intermediate hops
the OP only crypts the appropriate number of times depending on which
layer (hop on the path) it's for/from.
svn:r262
Diffstat (limited to 'src/or/connection_exit.c')
-rw-r--r-- | src/or/connection_exit.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/or/connection_exit.c b/src/or/connection_exit.c index f63bf634ff..0720598f82 100644 --- a/src/or/connection_exit.c +++ b/src/or/connection_exit.c @@ -8,11 +8,11 @@ int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) { connection_t *n_conn; char *colon; - if(!memchr(cell->payload + RELAY_HEADER_SIZE,0,cell->length - RELAY_HEADER_SIZE)) { + if(!memchr(cell->payload+RELAY_HEADER_SIZE+STREAM_ID_SIZE,0,cell->length-RELAY_HEADER_SIZE-STREAM_ID_SIZE)) { log(LOG_WARNING,"connection_exit_begin_conn(): relay begin cell has no \\0. Dropping."); return 0; } - colon = strchr(cell->payload + RELAY_HEADER_SIZE, ':'); + colon = strchr(cell->payload+RELAY_HEADER_SIZE+STREAM_ID_SIZE, ':'); if(!colon) { log(LOG_WARNING,"connection_exit_begin_conn(): relay begin cell has no colon. Dropping."); return 0; @@ -31,10 +31,8 @@ int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) { return 0; } -// cell->payload[0] = 0; - n_conn->stream_id = CELL_STREAM_ID(*cell); - - n_conn->address = strdup(cell->payload + RELAY_HEADER_SIZE); + memcpy(n_conn->stream_id, cell->payload + RELAY_HEADER_SIZE, STREAM_ID_SIZE); + n_conn->address = strdup(cell->payload + RELAY_HEADER_SIZE + STREAM_ID_SIZE); n_conn->port = atoi(colon+1); n_conn->state = EXIT_CONN_STATE_RESOLVING; n_conn->receiver_bucket = -1; /* edge connections don't do receiver buckets */ |