summaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-10-09 15:47:27 +0000
committerNick Mathewson <nickm@torproject.org>2006-10-09 15:47:27 +0000
commitb76fd968b4d2deddf2f40f63dc04713f45649c68 (patch)
tree7fc3e02f66375ba7c0513709b4bcc2de0a06bdec /src/or/command.c
parent17abfa6a6afa352ea5fcb0eddbc4539cd96e448c (diff)
downloadtor-b76fd968b4d2deddf2f40f63dc04713f45649c68.tar.gz
tor-b76fd968b4d2deddf2f40f63dc04713f45649c68.zip
r8972@totoro: nickm | 2006-10-09 10:36:22 -0400
Patch from Mike Perry: add a REASON field to closed and failed circ events. svn:r8671
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/command.c b/src/or/command.c
index cfd915a923..27779daeb6 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -273,18 +273,19 @@ command_process_created_cell(cell_t *cell, or_connection_t *conn)
if (CIRCUIT_IS_ORIGIN(circ)) { /* we're the OP. Handshake this. */
origin_circuit_t *origin_circ = TO_ORIGIN_CIRCUIT(circ);
+ int err_reason = 0;
log_debug(LD_OR,"at OP. Finishing handshake.");
- if (circuit_finish_handshake(origin_circ, cell->command,
- cell->payload) < 0) {
+ if ((err_reason = circuit_finish_handshake(origin_circ, cell->command,
+ cell->payload)) < 0) {
log_warn(LD_OR,"circuit_finish_handshake failed.");
- circuit_mark_for_close(circ, END_CIRC_AT_ORIGIN);
+ circuit_mark_for_close(circ, -err_reason);
return;
}
log_debug(LD_OR,"Moving to next skin.");
- if (circuit_send_next_onion_skin(origin_circ) < 0) {
+ if ((err_reason = circuit_send_next_onion_skin(origin_circ)) < 0) {
log_info(LD_OR,"circuit_send_next_onion_skin failed.");
/* XXX push this circuit_close lower */
- circuit_mark_for_close(circ, END_CIRC_AT_ORIGIN);
+ circuit_mark_for_close(circ, -err_reason);
return;
}
} else { /* pack it into an extended relay cell, and send it. */