]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
give tor_version_parse_platform some function documentation
authorRoger Dingledine <arma@torproject.org>
Tue, 14 Feb 2017 08:52:01 +0000 (03:52 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 15 Feb 2017 12:46:34 +0000 (07:46 -0500)
src/or/routerparse.c

index 28b9c57e4da3c9e6476ed455444f19cd24ae8ab4..c4691b58cec1fb0db4c9a7e078faf4410306701d 100644 (file)
@@ -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;
 }