First NTS code

Hal Murray hmurray at megapathdsl.net
Tue Jan 29 20:21:36 UTC 2019


esr at thyrsus.com said:
>> Your "empty cookie string as a sentinel" doesn't work unless you allocate 
>> space for the extra slot.
> Eh? We know what the maximum number of cookies is. I think all we have to do
> is notice which cookies are empty (have initial NUL).  But I might be wrong
> about that; I'm not wedded to that representation, it's an inside-NTS thing
> that belongs to whoever writes the cookie extraction code. 

Initial NUL doesn't work.  Cookies are binary blobs.  0 is a valid data byte.

I'm not sure what you mean by "sentinel".

The array of cookies is a FIFO.  If you have 2 indexes for read+write, you have to decide if equal means empty or full.  If you make the array one bigger the full-equal case never happens.  You have to make sure you never insert too many.

-- 
These are my opinions.  I hate spam.





More information about the devel mailing list