aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.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_or.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_or.c')
-rw-r--r--src/or/connection_or.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 6859cff6e1..d49667ddeb 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -73,6 +73,18 @@ int connection_or_finished_flushing(connection_t *conn) {
/*********************/
+void connection_or_init_conn_from_router(connection_t *conn, routerinfo_t *router) {
+ conn->addr = router->addr;
+ conn->port = router->or_port;
+ conn->bandwidth = router->bandwidth;
+ conn->onion_pkey = crypto_pk_dup_key(router->onion_pkey);
+ conn->link_pkey = crypto_pk_dup_key(router->link_pkey);
+ conn->identity_pkey = crypto_pk_dup_key(router->identity_pkey);
+ if(conn->address)
+ free(conn->address);
+ conn->address = strdup(router->address);
+}
+
connection_t *connection_or_connect(routerinfo_t *router) {
connection_t *conn;
@@ -96,12 +108,7 @@ connection_t *connection_or_connect(routerinfo_t *router) {
}
/* set up conn so it's got all the data we need to remember */
- conn->addr = router->addr;
- conn->port = router->or_port;
- conn->bandwidth = router->bandwidth;
- conn->onion_pkey = crypto_pk_dup_key(router->onion_pkey);
- conn->link_pkey = crypto_pk_dup_key(router->link_pkey);
- conn->address = strdup(router->address);
+ connection_or_init_conn_from_router(conn, router);
if(connection_add(conn) < 0) { /* no space, forget it */
connection_free(conn);