aboutsummaryrefslogtreecommitdiff
path: root/src/common/address.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2012-04-12 22:42:37 +0200
committerGeorge Kadianakis <desnacked@riseup.net>2012-04-12 22:42:37 +0200
commit6d2898607bd831944c6c15b6e15200a426149811 (patch)
treee0b2baee164b62b85c89c24aefdfaddee37252ec /src/common/address.c
parentb03f90b5383744593dc1e83fc5834c965573a4dc (diff)
downloadtor-6d2898607bd831944c6c15b6e15200a426149811.tar
tor-6d2898607bd831944c6c15b6e15200a426149811.tar.gz
Fix issues found by nickm.
* Document fmt_addr_impl() and friends. * Parenthesize macro arguments. * Rename get_first_listener_addrport_for_pt() to get_first_listener_addrport_string(). * Handle port_cfg_t with no_listen. * Handle failure of router_get_active_listener_port_by_type(). * Add an XXX to router_get_active_listener_port_by_type().
Diffstat (limited to 'src/common/address.c')
-rw-r--r--src/common/address.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/common/address.c b/src/common/address.c
index 62cf16c03..7f78d1e4d 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -986,10 +986,15 @@ tor_dup_addr(const tor_addr_t *addr)
}
}
-/** Return a string representing the address <b>addr</b>. This string is
- * statically allocated, and must not be freed. Each call to
- * <b>fmt_addr</b> invalidates the last result of the function. This
- * function is not thread-safe. */
+/** Return a string representing the address <b>addr</b>. This string
+ * is statically allocated, and must not be freed. Each call to
+ * <b>fmt_addr_impl</b> invalidates the last result of the function.
+ * This function is not thread-safe. If <b>decorate</b> is set, add
+ * brackets to IPv6 addresses.
+ *
+ * It's better to use the wrapper macros of this function:
+ * <b>fmt_addr()</b> and <b>fmt_and_decorate_addr()</b>.
+ */
const char *
fmt_addr_impl(const tor_addr_t *addr, int decorate)
{