❦ 29 mars 2016 16:52 +0200, Willy Tarreau <[email protected]> :
>> l = calloc(1, sizeof(struct listener));
>
> I definitely agree. This code is quite old (2005) and we don't do that
> much cleanup passes unfortunately. Oh and yes by the way, in case people
> have doubts about this, I wrote it and used to proceed like this in the
> past, it offered a good protection against blind copy-paste and/or
> incorrect backports... But after that I preferred to change for :
>
> l = calloc(1, sizeof(*l));
So, I did that too.
>> 1. can we remove uneeded void* cast?
>
> As much as possible yes!
OK, done. I did not consider casts of simple types (char*, ...) if they
were not caught by Coccinelle. Too difficult to spot in the code.
>> 2. correct dns.c
>
> I don't know the exact bug but I'll trust you :-)
I still have to do that. I have exhausted the time I can allocate to
this this week-end. Next week-end.
>> 3. correct TLV handling in connection.c
>
> I just checked and the TLV is 32-bit aligned so I guess we don't need
> any change there.
I was thinking: what about a buggy server sending unaligned TLV? But
since it only happens on arch not allowing unaligned memory access and
you only use proxy with servers you trust, this doesn't matter much.
>> 4. simplify the occurrence in shctx.c (or not worth it)
>
> Yes, it's a good opportunity for it as well.
Done in the first patch.
Hope I didn't break anything.
--
To be or not to be.
-- Shakespeare
To do is to be.
-- Nietzsche
To be is to do.
-- Sartre
Do be do be do.
-- Sinatra