[master] 32574ab46 vsm: Pass VARNISH_DEFAULT_N to VSM_Arg()

Dridi Boukelmoune dridi at varni.sh
Mon May 27 11:19:43 UTC 2024


> * this does not properly initialize the vut->n_arg

Yes, there was no -n option to grab an optarg.

> * this does not set the default in VSM_New()

What you did in VSM_New is as wrong as what I initially did (taking
your code at face value) in 1d7cdaddab67d156f6a99b2d2a1089b3a1913275
because as soon as the environment variable is present, it never goes
through VSM_Arg and relative working directories are never turned into
their absolute counterparts.

Again, I insist, we already had a fallback handling in VSM_Attach in
the absence of a -n option, and this is where the intermediate
VARNISH_DEFAULT_N should be introduced.

> When you write "there should be only 2 locations needed", I agree that two
> locations are better than four, but no matter how much I appreciate your desire
> to minimize code changes, I do not agree that this is now handled at the right
> place for the reasons given.

This not about minimizing the change for the sake of minimizing. I
wanted to avoid spreading the handling of the environment variable in
more places than needed, increasing the risk of doing so incorrectly.

And the risk existed since we both got it wrong initially.

Dridi


More information about the varnish-commit mailing list