aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-09-28 23:57:49 +0000
committerNick Mathewson <nickm@torproject.org>2006-09-28 23:57:49 +0000
commitd3a06684bc626f17872a59a375cd6fbe1635baa4 (patch)
treee77c1f1b94870e70e163c370246ec299d7177deb /src/common/util.c
parent9988112c87bc5e4ad39880ffd2aa898e0e62e82f (diff)
downloadtor-d3a06684bc626f17872a59a375cd6fbe1635baa4.tar
tor-d3a06684bc626f17872a59a375cd6fbe1635baa4.tar.gz
r8974@Kushana: nickm | 2006-09-28 17:05:59 -0400
Improvement to last entry guards patch: track when we last attempted to connect to a node in our state file along with how long it has been unreachable. Also clarify behavior of parse_iso_time() when it gets extra characters. svn:r8520
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 99ac776dc..6c6ce088c 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -910,6 +910,10 @@ format_iso_time(char *buf, time_t t)
strftime(buf, ISO_TIME_LEN+1, "%Y-%m-%d %H:%M:%S", tor_gmtime_r(&t, &tm));
}
+/** Given an ISO-formatted UTC time value (after the epoch) in <b>cp</b>,
+ * parse it and store its value in *<b>t</b>. Return 0 on success, -1 on
+ * failure. Ignore extraneous stuff in <b>cp</b> separated by whitespace from
+ * the end of the time string. */
int
parse_iso_time(const char *cp, time_t *t)
{