diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-07-25 22:56:54 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-07-25 22:56:54 +0000 |
commit | a8821e2d826755209f793f7ce61e04e9f8bfed64 (patch) | |
tree | b5376c791d8ee9d194e2146955bb1b69a75881d4 /src | |
parent | 47f3a40900e24cf5d14e8fa218b876a2b39b25f0 (diff) | |
download | tor-a8821e2d826755209f793f7ce61e04e9f8bfed64.tar.gz tor-a8821e2d826755209f793f7ce61e04e9f8bfed64.zip |
r13905@catbus: nickm | 2007-07-25 18:48:44 -0400
ADDRMAP events should never have specified local time. Extend them to have the proper gmt time, and make GETINFO address-mappings always do the right thing (since it is new in this version).
svn:r10930
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection_edge.c | 2 | ||||
-rw-r--r-- | src/or/control.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 95f2536ef1..f310d9289b 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1161,7 +1161,7 @@ addressmap_get_mappings(smartlist_t *sl, time_t min_expires, tor_snprintf(line, len, "%s %s NEVER", key, val->new_address); else { char time[ISO_TIME_LEN+1]; - format_local_iso_time(time, val->expires); + format_iso_time(time, val->expires); tor_snprintf(line, len, "%s %s \"%s\"", key, val->new_address, time); } diff --git a/src/or/control.c b/src/or/control.c index fc4c002d05..d99fb4b8c6 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -3099,10 +3099,15 @@ control_event_address_mapped(const char *from, const char *to, time_t expires, error); else { char buf[ISO_TIME_LEN+1]; + char buf2[ISO_TIME_LEN+1]; format_local_iso_time(buf,expires); + format_iso_time(buf2,expires); send_control_event_extended(EVENT_ADDRMAP, ALL_NAMES, - "650 ADDRMAP %s %s \"%s\"@%s\r\n", - from, to, buf, error); + "650 ADDRMAP %s %s \"%s\"" + "@%s%sEXPIRES=\"%s\"\r\n", + from, to, buf, + error, error?" ":"", + buf2); } return 0; |