diff options
author | Roger Dingledine <arma@torproject.org> | 2003-09-05 06:04:03 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-09-05 06:04:03 +0000 |
commit | 7a34cdf5eeace25e9787240c53ce1db38e2e08f6 (patch) | |
tree | 33153964cc87f4961a361231c4f857a324f84cde /src/or/connection_or.c | |
parent | 99d1e4931b0eeb1e2e11f20b6d999332eb5a0c70 (diff) | |
download | tor-7a34cdf5eeace25e9787240c53ce1db38e2e08f6.tar.gz tor-7a34cdf5eeace25e9787240c53ce1db38e2e08f6.zip |
general cleanup and reabstraction, to prepare for tls
svn:r426
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 058d776da3..e2ad05e0e8 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -6,6 +6,7 @@ extern or_options_t options; /* command-line and config-file options */ +#ifndef TOR_TLS static int or_handshake_op_send_keys(connection_t *conn); static int or_handshake_op_finished_sending_keys(connection_t *conn); @@ -15,8 +16,9 @@ static int or_handshake_client_send_auth(connection_t *conn); static int or_handshake_server_process_auth(connection_t *conn); static int or_handshake_server_process_nonce(connection_t *conn); -static void connection_or_set_open(connection_t *conn); static void conn_or_init_crypto(connection_t *conn); +#endif +static void connection_or_set_open(connection_t *conn); /* * @@ -29,7 +31,6 @@ int connection_or_process_inbuf(connection_t *conn) { assert(conn && conn->type == CONN_TYPE_OR); if(conn->inbuf_reached_eof) { - /* eof reached, kill it. */ log_fn(LOG_DEBUG,"conn reached eof. Closing."); return -1; } @@ -37,12 +38,14 @@ int connection_or_process_inbuf(connection_t *conn) { // log(LOG_DEBUG,"connection_or_process_inbuf(): state %d.",conn->state); switch(conn->state) { +#ifndef TOR_TLS case OR_CONN_STATE_CLIENT_AUTH_WAIT: return or_handshake_client_process_auth(conn); case OR_CONN_STATE_SERVER_AUTH_WAIT: return or_handshake_server_process_auth(conn); case OR_CONN_STATE_SERVER_NONCE_WAIT: return or_handshake_server_process_nonce(conn); +#endif case OR_CONN_STATE_OPEN: return connection_process_cell_from_inbuf(conn); default: @@ -583,7 +586,6 @@ or_handshake_server_process_auth(connection_t *conn) { crypto_cipher_decrypt_init_cipher(conn->f_crypto); conn->state = OR_CONN_STATE_OPEN; - connection_init_timeval(conn); connection_watch_events(conn, POLLIN); return connection_process_inbuf(conn); /* in case they sent some cells along with the keys */ @@ -654,10 +656,10 @@ static void connection_or_set_open(connection_t *conn) { conn->state = OR_CONN_STATE_OPEN; directory_set_dirty(); - connection_init_timeval(conn); connection_watch_events(conn, POLLIN); } +#ifndef TOR_TLS static void conn_or_init_crypto(connection_t *conn) { //int x; @@ -673,6 +675,7 @@ conn_or_init_crypto(connection_t *conn) { crypto_cipher_decrypt_init_cipher(conn->b_crypto); /* always encrypt with f, always decrypt with b */ } +#endif |