summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2017-02-14 03:52:01 -0500
committerNick Mathewson <nickm@torproject.org>2017-02-15 07:46:34 -0500
commit3c4da8a130e41b9096eef360c437cef3cd22a62c (patch)
tree50d9687fe0da7e4acc48896c32c5d2b1e82dd5e9
parent02e05bd74dbec614397b696cfcda6525562a4675 (diff)
downloadtor-3c4da8a130e41b9096eef360c437cef3cd22a62c.tar.gz
tor-3c4da8a130e41b9096eef360c437cef3cd22a62c.zip
give tor_version_parse_platform some function documentation
-rw-r--r--src/or/routerparse.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 28b9c57e4d..c4691b58ce 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -5512,9 +5512,14 @@ microdescs_parse_from_string(const char *s, const char *eos,
return result;
}
-/** Parse the Tor version of the platform string <b>platform</b>,
- * and compare it to the version in <b>cutoff</b>. Return 1 if
- * the router is at least as new as the cutoff, else return 0.
+/** Extract a Tor version from a <b>platform</b> line from a router
+ * descriptor, and place the result in <b>router_version</b>.
+ *
+ * Return 1 on success, -1 on parsing failure, and 0 if the
+ * platform line does not indicate some version of Tor.
+ *
+ * If <b>strict</b> is non-zero, finding any weird version components
+ * (like negative numbers) counts as a parsing failure.
*/
int
tor_version_parse_platform(const char *platform,
@@ -5552,6 +5557,7 @@ tor_version_parse_platform(const char *platform,
return -1;
}
}
+
return 1;
}