summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-30 18:37:53 -0400
committerNick Mathewson <nickm@torproject.org>2010-10-01 18:14:27 -0400
commitb5341314c17573db15a7cc5999f36569c764c462 (patch)
tree94da14bd12577e5751391084e93e597ecc29df62 /src/or/rephist.c
parentf9ea242acabcaec0ab0fbd0de5e9999dfcdb0193 (diff)
downloadtor-b5341314c17573db15a7cc5999f36569c764c462.tar.gz
tor-b5341314c17573db15a7cc5999f36569c764c462.zip
Implement a few more node-based functions
Some of these functions only work for routerinfo-based nodes, and as such are only usable for advisory purposes. Fortunately, our uses of them are compatible with this limitation.
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 97a3c54546..1b978d963d 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -881,8 +881,12 @@ rep_hist_get_router_stability_doc(time_t now)
if (node) {
char ip[INET_NTOA_BUF_LEN+1];
char tbuf[ISO_TIME_LEN+1];
+ time_t published = node_get_published_on(node);
node_get_address_string(node,ip,sizeof(ip));
- format_iso_time(tbuf, node_get_published_on(node));
+ if (published > 0)
+ format_iso_time(tbuf, published);
+ else
+ strlcpy(tbuf, "???", sizeof(tbuf));
tor_snprintf(header_buf, sizeof(header_buf),
"router %s %s %s\n"
"published %s\n"