aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-09-25 10:42:07 +0000
committerRoger Dingledine <arma@torproject.org>2003-09-25 10:42:07 +0000
commit3b5191d36dd62af1a7c6e08ce3a171d189870b64 (patch)
tree8852c3a4b57e7c464e656c6a278bfe2fd2f5d862 /src/or/connection.c
parent3d4ccb781ae5d74f0e16a63c89e08459d15cccf1 (diff)
downloadtor-3b5191d36dd62af1a7c6e08ce3a171d189870b64.tar.gz
tor-3b5191d36dd62af1a7c6e08ce3a171d189870b64.zip
various bugfixes and updates
redo all the config files for the new format (we'll redo them again soon) fix (another! yuck) segfault in log_fn when input is too large tor_tls_context_new() returns -1 for error, not NULL fix segfault in check_conn_marked() on conn's that die during tls handshake make ORs also initialize conn from router when we're the receiving node make non-dirserver ORs upload descriptor to every dirserver on startup add our local address to the descriptor add Content-Length field to POST command revert the Content-Length search in fetch_from_buf_http() to previous code fix segfault in memmove in fetch_from_buf_http() raise maximum allowed headers/body size in directory.c svn:r484
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 05d337c10a..0f71cc164e 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -304,19 +304,14 @@ static int connection_tls_finish_handshake(connection_t *conn) {
return -1;
}
log_fn(LOG_DEBUG,"The router's pk matches the one we meant to connect to. Good.");
- crypto_free_pk_env(pk);
} else {
if(connection_exact_get_by_addr_port(router->addr,router->or_port)) {
log_fn(LOG_INFO,"That router is already connected. Dropping.");
return -1;
}
- conn->link_pkey = pk;
- conn->bandwidth = router->bandwidth;
- conn->addr = router->addr, conn->port = router->or_port;
- if(conn->address)
- free(conn->address);
- conn->address = strdup(router->address);
+ connection_or_init_conn_from_router(conn, router);
}
+ crypto_free_pk_env(pk);
} else { /* it's an OP */
conn->bandwidth = DEFAULT_BANDWIDTH_OP;
}
@@ -615,7 +610,7 @@ int connection_handle_write(connection_t *conn) {
return 0;
}
-int connection_write_to_buf(char *string, int len, connection_t *conn) {
+int connection_write_to_buf(const char *string, int len, connection_t *conn) {
if(!len)
return 0;