[tor-dev] Two questions about dir-spec.txt

Nick Mathewson nickm at alum.mit.edu
Wed Dec 14 20:13:32 UTC 2011

On Wed, Dec 14, 2011 at 1:37 PM, Karsten Loesing
<karsten.loesing at gmx.net> wrote:
> Hi Nick,
> as the subject says, two quick questions about dir-spec.txt:
> 1. The "s" lines of network status entries are specified as:
>    "s" SP Flags NL
> Now, when a relay has no flags at all, which can happen in a vote or
> could happen in older consensus methods, that relay would have an "s"
> line just consisting of "s", not "s ".
> I think it makes sense to omit the SP, but should this be specified?


> If so, how?

One of the easiest ways would be "s" NL | "s" SP Flags NL

> There are other lines where it's not specified whether a trailing SP is
> permitted or not.  But I think I only encountered "s" lines without any
> list elements so far.

IIRC trailing space is permitted while parsing but should never be
required or emitted.

> (I ran into problems here a while ago, when I looked for lines starting
> with "s " to overwrite an sLine string variable.  But there was no "s "
> line for some relays, so the program used the "s " line from the
> previous relay.  Went unnoticed.  Ugh.)
> 2. The "m" lines in votes are not in dir-spec.txt.  I haven't looked at
> proposal 158 yet.  Is that proposal up-to-date?

It should be, IIRC, but see also 162.  I have a ticket somewhere to
merge it back into dir-spec

More information about the tor-dev mailing list