Browse Source

Merge remote-tracking branch 'teor/comments-20151204'

Nick Mathewson 8 years ago
parent
commit
f727ebcba8
3 changed files with 8 additions and 5 deletions
  1. 6 2
      src/or/connection.c
  2. 1 2
      src/or/main.c
  3. 1 1
      src/or/router.c

+ 6 - 2
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 *<b>socket_error</b>.
  * 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.
@@ -4212,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,

+ 1 - 2
src/or/main.c

@@ -500,8 +500,7 @@ connection_in_array(connection_t *conn)
   return smartlist_contains(connection_array, conn);
 }
 
-/** Set <b>*array</b> to an array of all connections, and <b>*n</b>
- * to the length of the array. <b>*array</b> and <b>*n</b> must not
+/** Set <b>*array</b> to an array of all connections. <b>*array</b> must not
  * be modified.
  */
 smartlist_t *

+ 1 - 1
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;