- 17 Feb, 2021 4 commits
-
-
Nils Goroll authored
suggested by phk
-
Nils Goroll authored
7ec28f1a did not work with object methods because we need a partial symbol table lookup to identify them, otherwise the symbol kind we find is just SUB for the method's return value. Additions to the test case and vmod_debug by @slimhazard, thank you Fixes #3521
-
Nils Goroll authored
For the next commit, we need a partial lookup without error. Alternatively, we could also a an error mode.
-
Nils Goroll authored
Diff best viewed with -b option - avoid the second call to VCC_SymbolGet(), unless necessary - reorder from simple to complex Ref 7ec28f1a
-
- 16 Feb, 2021 5 commits
-
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
sub vcl_synth { if (resp.status == 12404) { [...] // this specific 404 } else if (resp.status % 1000 == 404) { [...] // all other 404's } }
-
Poul-Henning Kamp authored
-
- 15 Feb, 2021 9 commits
-
-
Guillaume Quintard authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Guillaume Quintard authored
-
Nils Goroll authored
that is, call vmod.returning_sub(); in VCL. Background: The existing call sub; is special in that it instantiates "sub", if it does not exist already, enabling use-before-definition semantics. The doctrine of this change is to preserve this behaviour and to not make existing, static calls any less efficient. Implementation: To support calling both literal SUBs as well as SUB expressions, we peek into the symbol table to check if the called expression is a function, based on the knowledge that, as of now, only functions can have a non-literal SUB return. We also know that no other expression can yield a SUB. So if peeking ahead tells us that a function follows, we call into expression evaluation. Otherwise, we expect a literal SUB as before. Null check: For dynamic SUB calls from vmods via VRT_call(), we require the SUB argument be non-NULL. But we can not for call: To signal error with a SUB return, a vmod function needs to be allowed to return NULL, otherwise it would need to have a dummy return value available for the VRT_fail() case. So we need to check for NULL in VGC. Alternatives considered: - We could make expression evaluation return SUB also for literal SUB symbols, turning all calls into sub->func(ctx, ...) C statements. I tried this path and it resulted in a change of behaviour with cc_command="clang -g -O2 ...": Where, previously, sub code was inlined, it would now generate an explicit C function call always, despite the fact that the C function is known at compile time (because all named VCL_SUB structs are). So this option was dismissed for violating the doctrine. - The null check could go to VPI, via a VPI_call(), basically identical to VRT_call(), but checking for NULL. This option was dismissed because it would foreclose the requirement to allow for SUB arguments in the future. Acknowledgements: reza mentioned the idea of call SUB at one point, and I can not remember if I had it before or not, so when in doubt, it was his idea. Dridi helped with ideas on the implementation and spotted a bug.
-
Dridi Boukelmoune authored
To control the threshold used to warn.
-
Dridi Boukelmoune authored
As a recurring pitfall sometimes hard to identify, it deserves its own notice. The accounting of variants reuses the worker's strangelove field since it doesn't conflict where other parts of the code base use it.
-
Poul-Henning Kamp authored
-
- 12 Feb, 2021 5 commits
-
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
and protect this pattern in the test-case.
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
a comment why it is not necessary. Only call vcl_hash{} if the initial hash is still intact when we get there.
-
- 11 Feb, 2021 5 commits
-
-
Poul-Henning Kamp authored
This lifts internal restrictions on the hashkey production, but does not change how things work from a VCL perspective.
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
expect resp.http.content-length -le 1024
-
- 10 Feb, 2021 5 commits
-
-
Dridi Boukelmoune authored
And use that for logging purposes when a successfully opened h2 session ends. RX_JUNK is still the default session close reason when existing reasons aren't accurate enough. Fixes #3393
-
Dridi Boukelmoune authored
In the same fashion as include/tbl/params.h for legibility.
-
Nils Goroll authored
with manual polish for cstyle and un-doing some return ((x)).
-
Nils Goroll authored
-
Nils Goroll authored
Either flexelint or me, probabbly the latter, do not understand the code. As far as I am concerned, I would have thought that flexelint could follow for AN(y); REPLACE(x, y); x being guranteed to be non-NULL This reverts commit 897e5313. This reverts commit 6f4d0ec1.
-
- 09 Feb, 2021 7 commits
-
-
Nils Goroll authored
-
Nils Goroll authored
-
Nils Goroll authored
to slim down one of my PRs with a trivial addition which, I hope, will not be controversial.
-
Nils Goroll authored
-
Nils Goroll authored
-
Nils Goroll authored
-
Nils Goroll authored
Missing include for REPLACE() / memset() added manually.
-