]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Improve comments in circuit_get_cpath_*
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>
Fri, 8 Jul 2016 02:30:20 +0000 (12:30 +1000)
committerteor <teor2345@gmail.com>
Wed, 24 Aug 2016 00:32:22 +0000 (10:32 +1000)
src/or/circuitlist.c

index d2ba7d47817a2bf6e3ab2da2ccb2483b6789daca..0d56a7ee20ade101b5334fb14063fbdca426c21f 100644 (file)
@@ -1613,7 +1613,8 @@ circuit_find_to_cannibalize(uint8_t purpose, extend_info_t *info,
   return best;
 }
 
-/** Return the number of hops in circuit's path. */
+/** Return the number of hops in circuit's path. If circ has no entries,
+ * or is NULL, returns 0. */
 int
 circuit_get_cpath_len(origin_circuit_t *circ)
 {
@@ -1629,7 +1630,8 @@ circuit_get_cpath_len(origin_circuit_t *circ)
 }
 
 /** Return the <b>hopnum</b>th hop in <b>circ</b>->cpath, or NULL if there
- * aren't that many hops in the list. */
+ * aren't that many hops in the list. <b>hopnum</b> starts at 1.
+ * Returns NULL if <b>hopnum</b> is 0 or negative. */
 crypt_path_t *
 circuit_get_cpath_hop(origin_circuit_t *circ, int hopnum)
 {