summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-04-28 15:57:27 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-28 15:57:27 -0400
commit32918e954fa3c2d55eb6b7695bd833197c31e09e (patch)
tree414b6ed3d4e1b98db8f05b4907006e4737024b0d /src/or/circuituse.c
parent26456d33546b674d5fa4d2c0112eeec561da7279 (diff)
parent2c0258b69a232a7b11ecc999bee74dac1c1b1495 (diff)
downloadtor-32918e954fa3c2d55eb6b7695bd833197c31e09e.tar.gz
tor-32918e954fa3c2d55eb6b7695bd833197c31e09e.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
Conflicts: src/or/rendcommon.h
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 10593c0da3..135aa803ac 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1737,14 +1737,21 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
"introduction. (stream %d sec old)",
introcirc->_base.n_circ_id, rendcirc->_base.n_circ_id,
conn_age);
- if (rend_client_send_introduction(introcirc, rendcirc) < 0) {
+ switch (rend_client_send_introduction(introcirc, rendcirc)) {
+ case 0: /* success */
+ rendcirc->_base.timestamp_dirty = time(NULL);
+ introcirc->_base.timestamp_dirty = time(NULL);
+ assert_circuit_ok(TO_CIRCUIT(rendcirc));
+ assert_circuit_ok(TO_CIRCUIT(introcirc));
+ return 0;
+ case -1: /* transient error */
+ return 0;
+ case -2: /* permanent error */
+ return -1;
+ default: /* oops */
+ tor_fragile_assert();
return -1;
}
- rendcirc->_base.timestamp_dirty = time(NULL);
- introcirc->_base.timestamp_dirty = time(NULL);
- assert_circuit_ok(TO_CIRCUIT(rendcirc));
- assert_circuit_ok(TO_CIRCUIT(introcirc));
- return 0;
}
}