From fb3e862b8690101276cf2dfe8a5fc2dfb69fb71f Mon Sep 17 00:00:00 2001 From: "teor (Tim Wilson-Brown)" Date: Tue, 1 Dec 2015 13:08:37 +1100 Subject: Update comment: get_connection_array no longer takes "n" --- src/or/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/or/main.c b/src/or/main.c index 1469fd1da1..3f166c819d 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -500,8 +500,7 @@ connection_in_array(connection_t *conn) return smartlist_contains(connection_array, conn); } -/** Set *array to an array of all connections, and *n - * to the length of the array. *array and *n must not +/** Set *array to an array of all connections. *array must not * be modified. */ smartlist_t * -- cgit v1.2.3-54-g00ecf From 3461bcb10e1910d1bd46a887abe5bf3bd139f0d2 Mon Sep 17 00:00:00 2001 From: "teor (Tim Wilson-Brown)" Date: Fri, 4 Dec 2015 18:13:29 +1100 Subject: Move a comment in router_get_my_descriptor to the correct line --- src/or/router.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/or/router.c b/src/or/router.c index 90203458b2..bed9dc5e43 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1781,9 +1781,9 @@ router_get_my_descriptor(void) const char *body; if (!router_get_my_routerinfo()) return NULL; - /* Make sure this is nul-terminated. */ tor_assert(desc_routerinfo->cache_info.saved_location == SAVED_NOWHERE); body = signed_descriptor_get_body(&desc_routerinfo->cache_info); + /* Make sure this is nul-terminated. */ tor_assert(!body[desc_routerinfo->cache_info.signed_descriptor_len]); log_debug(LD_GENERAL,"my desc is '%s'", body); return body; -- cgit v1.2.3-54-g00ecf From b7525c39bff1f43b1437960d7030693942e33274 Mon Sep 17 00:00:00 2001 From: "teor (Tim Wilson-Brown)" Date: Mon, 7 Dec 2015 15:59:34 +1100 Subject: Comment-only changes to connection_connect port is in host order (addr is tor_addr_t, endianness is abstracted). addr and port can be different to conn->addr and conn->port if connecting via a proxy. --- src/or/connection.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/or/connection.c b/src/or/connection.c index b31b99c2e7..5ac0cb6cc5 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -1708,10 +1708,13 @@ connection_connect_sockaddr(connection_t *conn, } /** Take conn, make a nonblocking socket; try to connect to - * addr:port (they arrive in *host order*). If fail, return -1 and if + * addr:port (port arrives in *host order*). If fail, return -1 and if * applicable put your best guess about errno into *socket_error. * Else assign s to conn-\>s: if connected return 1, if EAGAIN return 0. * + * addr:port can be different to conn->addr:conn->port if connecting through + * a proxy. + * * address is used to make the logs useful. * * On success, add conn to the list of polled connections. -- cgit v1.2.3-54-g00ecf From 329aa59e432f9f1796315b5f54692bfeff295c47 Mon Sep 17 00:00:00 2001 From: "teor (Tim Wilson-Brown)" Date: Mon, 7 Dec 2015 16:13:07 +1100 Subject: Comment-only change to connection_get_by_type_addr_port_purpose connection_get_by_type_addr_port_purpose also ignores connections that are marked for close. --- src/or/connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/or/connection.c b/src/or/connection.c index 5ac0cb6cc5..4e39832709 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -4215,7 +4215,8 @@ connection_write_to_buf_impl_,(const char *string, size_t len, } /** Return a connection with given type, address, port, and purpose; - * or NULL if no such connection exists. */ + * or NULL if no such connection exists (or if all such connections are marked + * for close). */ connection_t * connection_get_by_type_addr_port_purpose(int type, const tor_addr_t *addr, uint16_t port, -- cgit v1.2.3-54-g00ecf