summaryrefslogtreecommitdiff
path: root/src/or/cpuworker.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-25 04:49:11 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-25 04:49:11 +0000
commite355ed0e154ef34122f6c4be0a0f243d8173a56c (patch)
treed5eefdebf107c04a8922991a23e62da24d1625ae /src/or/cpuworker.c
parent6a45028ccbb8ff18aa07e7853e12a04a1102fb3e (diff)
downloadtor-e355ed0e154ef34122f6c4be0a0f243d8173a56c.tar.gz
tor-e355ed0e154ef34122f6c4be0a0f243d8173a56c.zip
log correctly if decoding onion failed
svn:r1690
Diffstat (limited to 'src/or/cpuworker.c')
-rw-r--r--src/or/cpuworker.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 8f6d67a5c7..09b8c1e72c 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -102,16 +102,17 @@ int connection_cpu_process_inbuf(connection_t *conn) {
if(p_conn)
circ = circuit_get_by_circ_id_conn(circ_id, p_conn);
+ if(success == 0) {
+ log_fn(LOG_WARN,"decoding onionskin failed. Closing.");
+ if(circ)
+ circuit_mark_for_close(circ);
+ goto done_processing;
+ }
if(!circ) {
log_fn(LOG_INFO,"processed onion for a circ that's gone. Dropping.");
goto done_processing;
}
assert(circ->p_conn);
- if(success == 0) {
- log_fn(LOG_WARN,"decoding onionskin failed. Closing.");
- circuit_mark_for_close(circ);
- goto done_processing;
- }
if(onionskin_answer(circ, buf+TAG_LEN, buf+TAG_LEN+ONIONSKIN_REPLY_LEN) < 0) {
log_fn(LOG_WARN,"onionskin_answer failed. Closing.");
circuit_mark_for_close(circ);