summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-03-13 18:53:48 +1000
committerteor <teor@torproject.org>2020-03-13 18:53:48 +1000
commit9cf7839df7478d74d6c14d56c884b8d9e2aad4f3 (patch)
tree2353639d960bf8ddf37d3e979c11a193380be8d5 /src/app
parent3b4303e7f6d92fdc36632f1dd98b4557cffa089e (diff)
downloadtor-9cf7839df7478d74d6c14d56c884b8d9e2aad4f3.tar.gz
tor-9cf7839df7478d74d6c14d56c884b8d9e2aad4f3.zip
config: Improve some comments
Document the namelen argument to port_cfg_new(). Fix a typo in a comment in port_cfg_line_extract_addrport(). Comment-only changes.
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index ad664873ea..0623389099 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -5880,7 +5880,11 @@ parse_dir_fallback_line(const char *line,
return r;
}
-/** Allocate and return a new port_cfg_t with reasonable defaults. */
+/** Allocate and return a new port_cfg_t with reasonable defaults.
+ *
+ * <b>namelen</b> is the length of the unix socket name
+ * (typically the filesystem path), not including the trailing NUL.
+ * It should be 0 for ports that are not zunix sockets. */
port_cfg_t *
port_cfg_new(size_t namelen)
{
@@ -6000,7 +6004,7 @@ port_cfg_line_extract_addrport(const char *line,
size_t sz;
*is_unix_out = 1;
*addrport_out = NULL;
- line += strlen(unix_socket_prefix); /*No q: Keep the quote */
+ line += strlen(unix_socket_prefix); /* No 'unix:', but keep the quote */
*rest_out = unescape_string(line, addrport_out, &sz);
if (!*rest_out || (*addrport_out && sz != strlen(*addrport_out))) {
tor_free(*addrport_out);