diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-09-03 10:17:08 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2009-09-03 10:17:08 +0200 |
commit | 995606a7e199c1e4cef42b5ba9198c0d891773af (patch) | |
tree | fbb82176f5962e7a381503ca3f7350e1db730a5d /src/or/rendservice.c | |
parent | 075c004095e25940707aa496b49e29caefdd73e8 (diff) | |
download | tor-995606a7e199c1e4cef42b5ba9198c0d891773af.tar.gz tor-995606a7e199c1e4cef42b5ba9198c0d891773af.zip |
Avoid calling time(NULL) too often.
Found by "rotator".
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 2fd041d33e..7887f66ab7 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -988,7 +988,7 @@ rend_service_introduce(origin_circuit_t *circuit, const char *request, len = r; if (*buf == 3) { /* Version 3 INTRODUCE2 cell. */ - time_t ts = 0, now = time(NULL); + time_t ts = 0; v3_shift = 1; auth_type = buf[1]; switch (auth_type) { @@ -1168,7 +1168,7 @@ rend_service_introduce(origin_circuit_t *circuit, const char *request, circ_needs_uptime = rend_service_requires_uptime(service); /* help predict this next time */ - rep_hist_note_used_internal(time(NULL), circ_needs_uptime, 1); + rep_hist_note_used_internal(now, circ_needs_uptime, 1); /* Launch a circuit to alice's chosen rendezvous point. */ @@ -1205,7 +1205,7 @@ rend_service_introduce(origin_circuit_t *circuit, const char *request, launched->build_state->pending_final_cpath = cpath = tor_malloc_zero(sizeof(crypt_path_t)); cpath->magic = CRYPT_PATH_MAGIC; - launched->build_state->expiry_time = time(NULL) + MAX_REND_TIMEOUT; + launched->build_state->expiry_time = now + MAX_REND_TIMEOUT; cpath->dh_handshake_state = dh; dh = NULL; |