diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-06-29 19:55:10 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-06-29 19:55:10 -0400 |
commit | 741ab2a47abeba41223b908a71f10c80d6c18b6e (patch) | |
tree | a7cfff3fa8fabb0c6490c074df8f90246801d52c /src/or/circuitbuild.c | |
parent | 485cab869d292becb62a43b2e33a399ebc671303 (diff) | |
download | tor-741ab2a47abeba41223b908a71f10c80d6c18b6e.tar.gz tor-741ab2a47abeba41223b908a71f10c80d6c18b6e.zip |
Fix bugs with assuming time_t can be implicitly cast to long
Many friendly operating systems have 64-bit times, and it's not nice
to pass them to an %ld format.
It's also extremely not-nice to write a time to the log as an
integer. Most people think it's 2010 June 29 23:57 UTC+epsilon, not
1277855805+epsilon.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 1d654f04c0..6ee2921885 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -946,11 +946,17 @@ circuit_build_times_network_close(circuit_build_times_t *cbt, if (cbt->liveness.network_last_live <= start_time && start_time <= (now - cbt->close_ms/1000.0)) { if (did_onehop) { + char last_live_buf[ISO_TIME_LEN+1]; + char start_time_buf[ISO_TIME_LEN+1]; + char now_buf[ISO_TIME_LEN+1]; + format_local_iso_time(last_live_buf, cbt->liveness.network_last_live); + format_local_iso_time(start_time_buf, start_time); + format_local_iso_time(now_buf, now); log_warn(LD_BUG, "Circuit somehow completed a hop while the network was " - "not live. Network was last live at %ld, but circuit launched " - "at %ld. It's now %ld.", cbt->liveness.network_last_live, - start_time, now); + "not live. Network was last live at %s, but circuit launched " + "at %s. It's now %s.", last_live_buf, start_time_buf, + now_buf); } cbt->liveness.nonlive_timeouts++; } |