From 3b5191d36dd62af1a7c6e08ce3a171d189870b64 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Thu, 25 Sep 2003 10:42:07 +0000 Subject: 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 --- src/or/connection.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/or/connection.c') diff --git a/src/or/connection.c b/src/or/connection.c index 05d337c10..0f71cc164 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; -- cgit v1.2.3