diff options
author | George Kadianakis <desnacked@riseup.net> | 2012-05-07 18:05:54 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2012-05-07 18:05:54 +0300 |
commit | d2e9d1713487c5ae63ef453a11343470c1d54330 (patch) | |
tree | ccdbad7638904a5dd5bf632f704df6f537207940 /src/or/rendmid.c | |
parent | c9afd6f9c5a3cf73340e528818570b4ba5cdf6b2 (diff) | |
download | tor-d2e9d1713487c5ae63ef453a11343470c1d54330.tar.gz tor-d2e9d1713487c5ae63ef453a11343470c1d54330.zip |
Reorder rend_mid_rendezvous() to do protocol violation checks on top.
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r-- | src/or/rendmid.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c index 2742c351b3..391eab7f82 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -276,13 +276,6 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, or_circuit_t *rend_circ; char hexid[9]; int reason = END_CIRC_REASON_INTERNAL; - base16_encode(hexid,9,(char*)request,request_len<4?request_len:4); - - if (request_len>=4) { - log_info(LD_REND, - "Got request for rendezvous from circuit %d to cookie %s.", - circ->p_circ_id, hexid); - } if (circ->_base.purpose != CIRCUIT_PURPOSE_OR || circ->_base.n_conn) { log_info(LD_REND, @@ -300,6 +293,12 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, goto err; } + base16_encode(hexid, 9, (char*)request, 4); + + log_info(LD_REND, + "Got request for rendezvous from circuit %d to cookie %s.", + circ->p_circ_id, hexid); + rend_circ = circuit_get_rendezvous((char*)request); if (!rend_circ) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, |