- 10 Dec, 2020 2 commits
-
-
Nils Goroll authored
VRT_new_backend_clustered() is the only caller of VBP_Insert(). There, VBP_Update_Backend() needs to be called after the director is created in order to update the director status for a cold VCL. For a warm VCL, VBP_Update_Backend() is called via VRT_AddDirector() -> VDI_Event() -> vbe_dir_event() -> VBP_Control() Thus, the additonal call before the director is added to the backend, does not do anything but update the poll bits. Somehow related to #3362
-
Dridi Boukelmoune authored
We don't need to assert the integrity of the VSB after every single byte, it can become very expensive depending on the workload.
-
- 09 Dec, 2020 3 commits
-
-
Guillaume Quintard authored
-
Nils Goroll authored
Ref 001485e6
-
Dridi Boukelmoune authored
Going back to lowercase, and aligning code blocks to 4 spaces to match the rest of the code snippets.
-
- 07 Dec, 2020 6 commits
-
-
Nils Goroll authored
Ref #3470
-
Nils Goroll authored
Ref #3470
-
Nils Goroll authored
Fixes #3478
-
Nils Goroll authored
When resolve requests race, we were not guaranteed to consider all backends because we updated a shared nxt variable. Fixes #3474
-
Nils Goroll authored
-
Nils Goroll authored
... also (C)ompleted bans. The previous code made a lot of sense in light of the performance issue due to too many bans, but would not work to prune a long ban list due to (R)equest bans at the tail, as in this example: Present bans: 1607346873.538879 354304 C 1607346873.532313 0 C ... lots of (C)ompleted bans 1607083561.980118 0 - req.http.Host ~ foo 1607083561.972629 15 C The documentation does not mention the previous behavior (that only "active" bans are being counted), so this changes aligns code to documentation.
-
- 03 Dec, 2020 5 commits
-
-
Nils Goroll authored
-
Nils Goroll authored
-
Nils Goroll authored
-
Poul-Henning Kamp authored
This introduces a `PAN_dump_struct` function to do the standard up-front checks for NULL, bad magic & already dumped.
-
Poul-Henning Kamp authored
vtc_haproxy: VTCP_listen_on 127.0.0.1 instead of localhost Always bind vtc_haproxy with 127.0.0.1 instead of binding on ::1 or 127.0.0.1 depending on the environment. This is related to bug https://github.com/haproxy/haproxy/issues/937 here the ipv6 and ipv4 are randomly mixed which can't work with socks4.
-
- 02 Dec, 2020 5 commits
-
-
Nils Goroll authored
-
Dridi Boukelmoune authored
And wrap the logic in a macro to reduce duplication.
-
Dridi Boukelmoune authored
It's more an action than housekeeping.
-
Dridi Boukelmoune authored
Make it possible to compare VSCs, to create a synchronization point based on internal events (especially with custom VSCs). For example: # block until baz catches up varnish v1 -expect FOO.bar == FOO.baz This is still subject to roughly 5s before timing out.
-
Dridi Boukelmoune authored
-
- 30 Nov, 2020 4 commits
-
-
Nils Goroll authored
... unless we f*up, which is the sole purpose of its existence
-
Nils Goroll authored
-
Nils Goroll authored
this needs to live within the exclusive circle of cache_vcl.h includers, so I went for cache_vrt_vcl.c just because of the name.
-
Nils Goroll authored
This is the refactoring we agreed on to enable an alternative implementation of #3454. This PR does not yet introduce the copy callback needed to add the functionality suggested in #3454. We replace the .free pointer of struct vmod_priv with a pointer to a methods struct with callbacks. As of this commit, it only contains the .free callback renamed to .fini. The purpose of the refactoring is to allow addition of more callbacks later. The new struct vmod_priv_methods also contains a .type member pointing to a string to contain an arbitrary description of the type of data any priv holds which uses these methods. Implementation: relevant changes are in cache_vrt_priv.c and vrt.h, other changes are to the documentation and bundled vmods. The implementation is a simple refactoring for indirection of the call to the .fini callback via the methods structure.
-
- 27 Nov, 2020 2 commits
-
-
Nils Goroll authored
This change also exposed #3385 See #3470 for a suggestion how to get out of this This reverts commit 5cbb3586.
-
Nils Goroll authored
-
- 25 Nov, 2020 4 commits
-
-
Dridi Boukelmoune authored
Flexelint complains that this truncation is suspicious, which is fair. The pdiff() function allows for a more expressive, and hopefully less suspicious alternative with a bit of hardening in the process.
-
Dridi Boukelmoune authored
This way it can be used almost anywhere in the code base and out of tree, not just in the cache process. The function was slightly polished after prior discussions with phk and slink.
-
Federico G. Schwindt authored
stdbool.h gets pulled in indirectly, which defines bool to _Bool. Since we are not using the bool type here, just undefine it.
-
ThijsFeryn authored
-
- 24 Nov, 2020 5 commits
-
-
Dridi Boukelmoune authored
Better diff with the --word-diff --ignore-all-space options.
-
Dridi Boukelmoune authored
Having now the guarantee that VCL sources are always null-terminated we can use standard string.h functions to detect long strings. We can also generalize vcc_decstr() to work with all kinds of strings. Instead of duplicating the code in 3 locations with slight variations, encode the specificities of each type of string into a struct and have one location to parse them. Bonus deduplication, inline C parsing is identical. This is loosely inspired by vcl_fixed_token() and we could further reduce the size of the loop in vcc_Lexer() by extracting more logic.
-
Dridi Boukelmoune authored
And with that we know for sure that we always have null-terminated VCL sources.
-
Andrew Wiik authored
-
Andrew Wiik authored
-
- 23 Nov, 2020 4 commits
-
-
Nils Goroll authored
For a first byte timeout on a new connection, we emit FetchError: first byte timeout For a first byte timeout being reached on a recycled connection, we should keep the error message similar. Ref eecd409d
-
Nils Goroll authored
Dridi, phk and myself all stared at this piece of code and see no issue: res has been calloc'ed l elements. For any res[i] and res[j] access, i and j are less than l, respectively. l is not increased after the initial count of elements in s. Ref 9947307d Flexelint error: _ res[i] = vp; mgt/mgt_vcl.c 749 Warning 661: Possible access of out-of-bounds pointer (1 beyond end of data) by operator '[' [Reference: file mgt/mgt_vcl.c: lines 719, 722, 727, 744, 747, 749] mgt/mgt_vcl.c 719 Info 831: Reference cited in prior message mgt/mgt_vcl.c 722 Info 831: Reference cited in prior message mgt/mgt_vcl.c 727 Info 831: Reference cited in prior message mgt/mgt_vcl.c 744 Info 831: Reference cited in prior message mgt/mgt_vcl.c 747 Info 831: Reference cited in prior message mgt/mgt_vcl.c 749 Info 831: Reference cited in prior message
-
Dridi Boukelmoune authored
The plain text output is a suitable input for tsort(1), initially meant to find the correct discard order, I realized that it would be more reliable to let vcl.discard figure that one out. It wouldn't really work in my initial scenario: varnishadm vcl.deps | <filter some VCLs out> | tsort | xargs -n 1 varnishadm vcl.discard The filtering part only worked for direct dependencies but we can have two levels with return(vcl). I'm keeping this command only for setup analysis, the output can easily be turned into a graphviz dot file for example.
-
Dridi Boukelmoune authored
To put it simply, let's take a simple CLI script: vcl.discard vcl1 vcl.discard vcl2 [...] vcl.discard vclX We can now achieve the same with a single command: vcl.discard vcl1 vcl2 ... vclX But there is slighty more to it, because vcl.discard operates on both VCLs and VCL labels, and dependencies can exist between both. So in addition to operate on multiple VCLs it also does so in the correct order.
-