summaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-12-16 09:48:17 +0000
committerRoger Dingledine <arma@torproject.org>2003-12-16 09:48:17 +0000
commit8712a30e91fa61de03ed1525b174b3d0ae8cddac (patch)
tree98349cff3e7462fba74fcf173229e75ac800695b /src/or/command.c
parent961ecf7abfc80571ab858099d1d4f6362b791ea0 (diff)
downloadtor-8712a30e91fa61de03ed1525b174b3d0ae8cddac.tar.gz
tor-8712a30e91fa61de03ed1525b174b3d0ae8cddac.zip
move cell size to 512 bytes
move length to 2 bytes, put it in the relay header remove 4 reserved bytes in cell add 4 bytes to relay header for the integrity check svn:r942
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/or/command.c b/src/or/command.c
index ed0a8d04d0..8935fcb082 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -103,13 +103,8 @@ static void command_process_create_cell(cell_t *cell, connection_t *conn) {
circ = circuit_new(cell->circ_id, conn);
circ->state = CIRCUIT_STATE_ONIONSKIN_PENDING;
- if(cell->length != ONIONSKIN_CHALLENGE_LEN) {
- log_fn(LOG_WARN,"Bad cell length %d. Dropping.", cell->length);
- circuit_close(circ);
- return;
- }
- memcpy(circ->onionskin,cell->payload,cell->length);
+ memcpy(circ->onionskin, cell->payload, ONIONSKIN_CHALLENGE_LEN);
/* hand it off to the cpuworkers, and then return */
if(assign_to_cpuworker(NULL, CPUWORKER_TASK_ONION, circ) < 0) {
@@ -135,7 +130,6 @@ static void command_process_created_cell(cell_t *cell, connection_t *conn) {
circuit_close(circ);
return;
}
- assert(cell->length == ONIONSKIN_REPLY_LEN);
if(circ->cpath) { /* we're the OP. Handshake this. */
log_fn(LOG_DEBUG,"at OP. Finishing handshake.");
@@ -153,7 +147,7 @@ static void command_process_created_cell(cell_t *cell, connection_t *conn) {
} else { /* pack it into an extended relay cell, and send it. */
log_fn(LOG_INFO,"Converting created cell to extended relay cell, sending.");
connection_edge_send_command(NULL, circ, RELAY_COMMAND_EXTENDED,
- cell->payload, cell->length, NULL);
+ cell->payload, ONIONSKIN_REPLY_LEN, NULL);
}
}