Re: VSC self-documentation

2017-05-19 Thread Reza Naghibi
Looks pretty decent. Definitely makes sense to have some kind of JSON support in Varnish, especially on the parsing and reading end. I too had to implement my own JSON lib just because the options out there just dont hit all requirements, libraries generally optimize for 1 thing and somehow do ever

Re: VSC self-documentation

2017-05-19 Thread Poul-Henning Kamp
In message , "Devon H. O'Dell" writes: >> [2] I my check for control-chars in strings I forgot that char is signed. > >Except when it isn't! Whether "plain" char is signed or unsigned is >implementation-defined Yeah, compliments to the ISO-C people for that bit of insanity... -- Poul-

Re: VSC self-documentation

2017-05-19 Thread Devon H. O'Dell
On Fri, May 19, 2017 at 1:08 AM, Poul-Henning Kamp wrote: > > In message > , "Devon > H. O'Dell" writes: > >>In case JSON ends up being a thing, [...] > >>Unsure whether strict correctness is required, but it certainly can't >>hurt (especially if folks end up building e.g. VMODs on top

Re: VSC self-documentation

2017-05-19 Thread Poul-Henning Kamp
In message , "Devon H. O'Dell" writes: >In case JSON ends up being a thing, [...] >Unsure whether strict correctness is required, but it certainly can't >hurt (especially if folks end up building e.g. VMODs on top of it). Thus inspired I just tested my code[1] agains the testsuite, an

Re: VSC self-documentation

2017-05-18 Thread Poul-Henning Kamp
In message , Dridi Boukelmoune writes: >> ... but I still feel dirty using JSON to pass data structures >> from one C-program to another, or as it may be, from a python >> program to another. > >There are other solutions for this kind of descriptors, and you could >probably get a msgpack

Re: VSC self-documentation

2017-05-18 Thread Devon H. O'Dell
On Thu, May 18, 2017 at 12:15 AM, Poul-Henning Kamp wrote: > And then we run into the how do we encode that in the VSM segment > thing, and after looking at all the alternatives I could imagine, > I end up with JSON ... again, again, again. > > I have a small, 500 LOC, json parser in C we can use,

Re: VSC self-documentation

2017-05-18 Thread Dridi Boukelmoune
> I have a small, 500 LOC, json parser in C we can use, so that is > not going to drag in a dependency. > > If we're going to bite the JSON bullet, the other places it makes > sense to use it, is for the vcc_if.c::Vmod_Spec data structure > which explains the contents of a VMOD to VCC. > > Given th