diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-12 23:33:47 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-12 23:33:47 +0000 |
commit | a5bfe845096b13f676c57cfbebb9409bacbfa124 (patch) | |
tree | 6e3a13d210c91af6b5eb5874ddb7642b95465341 /src/or/rendmid.c | |
parent | f4ff5a75c141b671432cd1b9a9a0e102ca872562 (diff) | |
download | tor-a5bfe845096b13f676c57cfbebb9409bacbfa124.tar.gz tor-a5bfe845096b13f676c57cfbebb9409bacbfa124.zip |
ACK/NAK INTRODUCE1 requests. (We do no useful processing on them yet)
svn:r1597
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r-- | src/or/rendmid.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c index 4ab87cbaa5..80e7818f9d 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -112,6 +112,7 @@ rend_mid_introduce(circuit_t *circ, const char *request, int request_len) { circuit_t *intro_circ; char serviceid[REND_SERVICE_ID_LEN+1]; + char nak_body[1]; if (circ->purpose != CIRCUIT_PURPOSE_OR || circ->n_conn) { log_fn(LOG_WARN, "Rejecting INTRODUCE1 on non-OR or non-edge circuit %d", @@ -153,10 +154,23 @@ rend_mid_introduce(circuit_t *circ, const char *request, int request_len) log_fn(LOG_WARN, "Unable to send INTRODUCE2 cell to OP."); goto err; } + /* And sent an ack down the cirecuit. Empty body->succeeded. */ + if (connection_edge_send_command(NULL,circ,RELAY_COMMAND_INTRODUCE_ACK, + NULL,0,NULL)) { + log_fn(LOG_WARN, "Unable to send INTRODUCE_ACK cell to OP."); + circuit_mark_for_close(circ); + return -1; + } return 0; err: - circuit_mark_for_close(circ); /* Is this right? */ + /* Send the client an ACK */ + nak_body[0] = 1; + if (connection_edge_send_command(NULL,circ,RELAY_COMMAND_INTRODUCE_ACK, + nak_body, 1, NULL)) { + log_fn(LOG_WARN, "Unable to send NAK to OP"); + circuit_mark_for_close(circ); /* Is this right? */ + } return -1; } |