[tor-bugs] #6683 [Tor Relay]: Request: add offset to current system time

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sun Aug 26 23:35:05 UTC 2012


#6683: Request: add offset to current system time
-------------------------+--------------------------------------------------
 Reporter:  tmpname0901  |          Owner:                  
     Type:  enhancement  |         Status:  needs_revision  
 Priority:  normal       |      Milestone:  Tor: unspecified
Component:  Tor Relay    |        Version:                  
 Keywords:               |         Parent:                  
   Points:               |   Actualpoints:                  
-------------------------+--------------------------------------------------

Comment(by rransom):

 Replying to [comment:8 tmpname0901]:
 > Updated patch, relative to the release-0.2.3 branch.  I hope it's less
 scary.
 >
 > I tried the suggested src/common/util.[hc] but it didn't work due to
 linking error.  (Unresolved get_options() in library.)

 Which is one reason that I told you to use a static global variable which
 the configuration-loading code would set.  (Another reason is that it
 would suck if your function/macro were ever called before Tor had loaded
 its configuration (i.e. with `get_options() == NULL`).)

 > So instead I put tor_time() in src/or/config.[hc], as the function is
 kinda config=option-related.

 It belongs in src/common/, next to the other functions that return the
 current time (and which also need to learn to return an adjusted time).
 (I would expect those functions to live in src/common/util.c, but on
 further thought, they might be in a different file.)

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6683#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list