diff options
author | Nick Mathewson <nickm@torproject.org> | 2003-04-17 16:46:44 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2003-04-17 16:46:44 +0000 |
commit | fdf4d4aa85c1b996f36944cea19c13e49e52b972 (patch) | |
tree | 6aec84c7fb2dac3773e78803d0cd2ac5831bdf87 /src | |
parent | 6fd4f2a17f9dc329240734ea99f6f608b28b5fc8 (diff) | |
download | tor-fdf4d4aa85c1b996f36944cea19c13e49e52b972.tar tor-fdf4d4aa85c1b996f36944cea19c13e49e52b972.tar.gz |
Use cell.topic* fields in ap_handshake_send_begin
svn:r248
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection_ap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/connection_ap.c b/src/or/connection_ap.c index 2a98537b8..444dfc00a 100644 --- a/src/or/connection_ap.c +++ b/src/or/connection_ap.c @@ -124,10 +124,11 @@ int ap_handshake_send_begin(connection_t *ap_conn, circuit_t *circ) { /* deliver the dest_addr in a data cell */ cell.command = CELL_DATA; cell.aci = circ->n_aci; - crypto_pseudo_rand(2, cell.payload+2); /* bytes 0-1 is blank, bytes 2-3 are random */ + cell.topic_command = TOPIC_COMMAND_BEGIN; + crypto_pseudo_rand(2, (char*)&cell.topic_id); /* FIXME check for collisions */ - ap_conn->topic_id = ntohs(*(uint16_t *)(cell.payload+2)); - cell.payload[0] = TOPIC_COMMAND_BEGIN; + ap_conn->topic_id = cell.topic_id; + snprintf(cell.payload+4, CELL_PAYLOAD_SIZE-4, "%s:%d", ap_conn->dest_addr, ap_conn->dest_port); cell.length = strlen(cell.payload+TOPIC_HEADER_SIZE)+1+TOPIC_HEADER_SIZE; log(LOG_DEBUG,"ap_handshake_send_begin(): Sending data cell to begin topic %d.", ap_conn->topic_id); |