summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-09-12 06:20:36 +0000
committerRoger Dingledine <arma@torproject.org>2003-09-12 06:20:36 +0000
commitb1078b7a3cdf805b60ceba934fc70610c3a923f4 (patch)
tree535bb6bd3ce993951142955370eb5bf68faa10b6
parent556bea4b6d807099e90a3f0c6615d7e500b83424 (diff)
downloadtor-b1078b7a3cdf805b60ceba934fc70610c3a923f4.tar.gz
tor-b1078b7a3cdf805b60ceba934fc70610c3a923f4.zip
tls works with onion proxies now.
svn:r449
-rw-r--r--src/or/connection.c2
-rw-r--r--src/or/connection_or.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 74d2f3cb35..2a51264e24 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -308,6 +308,7 @@ static int connection_tls_finish_handshake(connection_t *conn) {
conn->state = OR_CONN_STATE_OPEN;
directory_set_dirty();
connection_watch_events(conn, POLLIN);
+ log_fn(LOG_DEBUG,"tls handshake done. verifying.");
if(options.OnionRouter) { /* I'm an OR */
if(tor_tls_peer_has_cert(conn->tls)) { /* it's another OR */
pk = tor_tls_verify(conn->tls);
@@ -368,7 +369,6 @@ static int connection_tls_finish_handshake(connection_t *conn) {
conn->bandwidth = DEFAULT_BANDWIDTH_OP;
circuit_n_conn_open(conn); /* send the pending create */
}
- log_fn(LOG_DEBUG,"tls handshake done, now open.");
return 0;
}
#endif
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 231a62ac94..832330d93d 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -36,7 +36,8 @@ int connection_or_process_inbuf(connection_t *conn) {
}
#ifdef USE_TLS
- assert(conn->state == OR_CONN_STATE_OPEN);
+ if(conn->state != OR_CONN_STATE_OPEN)
+ return 0; /* don't do anything */
return connection_process_cell_from_inbuf(conn);
#else
// log(LOG_DEBUG,"connection_or_process_inbuf(): state %d.",conn->state);
@@ -81,7 +82,7 @@ int connection_or_finished_flushing(connection_t *conn) {
}
/* the connect has finished. */
- log_fn(LOG_DEBUG,"OR connection to router %s:%u established.",
+ log_fn(LOG_DEBUG,"OR connect() to router %s:%u finished.",
conn->address,conn->port);
#ifdef USE_TLS