summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-12-01 08:09:48 +0000
committerNick Mathewson <nickm@torproject.org>2007-12-01 08:09:48 +0000
commitd8ad247dfdea0705de2990af68026cdf6da22430 (patch)
tree91be989c484e6ae0857cfe08f4e295a919921771 /src/or/connection.c
parent1789f94668f8da029d18efb51bc3d0652488f706 (diff)
downloadtor-d8ad247dfdea0705de2990af68026cdf6da22430.tar.gz
tor-d8ad247dfdea0705de2990af68026cdf6da22430.zip
r15088@tombo: nickm | 2007-11-30 23:47:29 -0500
Add support to get a callback invoked when the client renegotiate a connection. Also, make clients renegotiate. (not enabled yet, until they detect that the server acted like a v2 server) svn:r12623
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 24fd567de0..a39d5d7108 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -89,6 +89,7 @@ conn_state_to_string(int type, int state)
case OR_CONN_STATE_PROXY_FLUSHING: return "proxy flushing";
case OR_CONN_STATE_PROXY_READING: return "proxy reading";
case OR_CONN_STATE_TLS_HANDSHAKING: return "handshaking (TLS)";
+ case OR_CONN_STATE_TLS_RENEGOTIATING: return "renegotiating (TLS)";
case OR_CONN_STATE_OR_HANDSHAKING: return "handshaking (Tor)";
case OR_CONN_STATE_OPEN: return "open";
}
@@ -1893,7 +1894,8 @@ connection_read_to_buf(connection_t *conn, int *max_to_read)
conn->state > OR_CONN_STATE_PROXY_READING) {
int pending;
or_connection_t *or_conn = TO_OR_CONN(conn);
- if (conn->state == OR_CONN_STATE_TLS_HANDSHAKING) {
+ if (conn->state == OR_CONN_STATE_TLS_HANDSHAKING ||
+ conn->state == OR_CONN_STATE_TLS_RENEGOTIATING) {
/* continue handshaking even if global token bucket is empty */
return connection_tls_continue_handshake(or_conn);
}
@@ -2115,7 +2117,8 @@ connection_handle_write(connection_t *conn, int force)
if (connection_speaks_cells(conn) &&
conn->state > OR_CONN_STATE_PROXY_READING) {
or_connection_t *or_conn = TO_OR_CONN(conn);
- if (conn->state == OR_CONN_STATE_TLS_HANDSHAKING) {
+ if (conn->state == OR_CONN_STATE_TLS_HANDSHAKING ||
+ conn->state == OR_CONN_STATE_TLS_RENEGOTIATING) {
connection_stop_writing(conn);
if (connection_tls_continue_handshake(or_conn) < 0) {
/* Don't flush; connection is dead. */