[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #1680 [Tor - Tor client]: Implicit (default) state file lines hard for external apps to know



#1680: Implicit (default) state file lines hard for external apps to know
------------------------------+---------------------------------------------
 Reporter:  arma              |       Owner:     
     Type:  defect            |      Status:  new
 Priority:  normal            |   Milestone:     
Component:  Tor - Tor client  |     Version:     
 Keywords:                    |      Parent:     
------------------------------+---------------------------------------------
 Right now we have stanzas in relay state files like:

 BWHistoryReadEnds 2010-07-08 17:52:41
 BWHistoryReadValues 438064128,395179008,...

 but we leave "BWHistoryReadInterval 900" implicit because it's the default
 value from config.c.

 That's fine -- if we ever change the default, we'll have to teach Tor to
 look at the TorVersion line in the state file, and derive the correct
 default when loading the state file.

 But now we have apps like arm looking at our state file. Those apps need
 to know that a missing value means 900, and if we ever change it, they
 need to know what Tor versions have what defaults. Having that logic
 separately in every controller app is the wrong place for it.

 Does that mean we want a "getstate" controller option (along with a
 getinfo state/names), and it will write out the lines it would write to
 the state file, but include the defaults?

 Or should we just write the defaults to the state file, and call that
 close enough? It seems we shouldn't do that, since I can imagine two
 classes of defaults (first is "I don't care what the value is, please
 choose the right number for me Tor", and the second is "I am relying on
 this number, and it happens to be the default number") and we don't
 distinguish between them. On the third hand, I don't actually see any of
 the former category in _state_vars[] in config.c, so maybe I'm
 generalizing too much.

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