- 31 Jan, 2020 16 commits
-
-
Martin Blix Grydeland authored
Currently, with the 505b7bd9 patch, when calling WS_ReserveSize with bytes equal to the amount of workspace that is currently available, it will return zero and mark overflow. This patch redoes the patch, and changes it to return zero and overflow only when the requested number of bytes is larger than what is available.
-
Dridi Boukelmoune authored
(cherry picked from commit 7da6220d)
-
Martin Blix Grydeland authored
Proxy TLVs claiming to have PP2_TYPE_SSL sub-TLVs without complete payload would cause a Varnish assert. This patch fixes the parsing of the TLVs.
-
Martin Blix Grydeland authored
h2_init_sess can only be reached through H1 with either previous knowledge or opportunistic upgrade. Because of this the proto_priv session attribute will always be set before entry. This patch simplifies and removes dead code containing a call to SES_Reserve_proto_priv. Note: Better diff with the --ignore-all-space option
-
Martin Blix Grydeland authored
In h2_init_sess, an extra call was always made to SES_Reseve_proto_priv(), even though it was already reserved. This wasted a pointer worth of session workspace. This patch removes the extra call.
-
Martin Blix Grydeland authored
If proxy protocol is in use, it is possible to fill the session workspace exactly before entering http1_new_session(), which will cause it to assert when calling SES_Reserve_proto_priv(). with this patch we will close the session gracefully.
-
Nils Goroll authored
Ref varnishcache/varnish-cache#3145 / 287dc4a6 (cherry picked from commit d6dec031)
-
Nils Goroll authored
Ref varnishcache/varnish-cache#3145 / 287dc4a6 (cherry picked from commit e1a57eb7)
-
Emmanuel Hocdet authored
Patch by @ehocdet, commit message edited by @nigoroll: The root cause of #3131 was misdiagnosed to the extent that, while this change had prevented it, the root cause was a bug in WS_ReserveSize() fixed in 505b7bd9 The previous tlv_string() code was correct except for the fact that error handling should have checked for WS_ReserveSize(ctx->ws, len+1) <= len (also spotted by @ehocdet). Someone had mentioned at some point that we would not want to VRT_fail(), but I think this must have been related to the proxy transport code, not the proxy vmod. Ref varnishcache/varnish-cache#3131 (cherry picked from commit e74f9e87)
-
Nils Goroll authored
Notes: * for the acceptor, I think it makes sense to keep AN assertion (pun!) because varnish is not viable if the session workspace is too small to even hold the attributes initialized in the acceptor. If this was an issue, we should rather revisit the minimum values for the session workspace * for h1 and h2 session setup, I have used XXXAN() because I am not sure how we should best handle allocation failures. * The relevant bit, for now, is the proxy code which may allocate arbitrarily long TLV attributes, so this is the code for which we now actually handle errors and test that we do On the vtc: I added the test to o00005.vtc because there existed a previous overflow test from 267504b8, but that only tested for the one case of a WS overflow which was already handled. Fixes varnishcache/varnish-cache#3145 (cherry picked from commit 287dc4a6)
-
Nils Goroll authored
(cherry picked from commit 815331b3)
-
Nils Goroll authored
This originates from a3d47c25, but was overlooked in 4e333597: When there is insufficient space to fulfil the reservation request, we must not leave the workspace reserved. Fixes varnishcache/varnish-cache#3131 (cherry picked from commit 505b7bd9)
-
Nils Goroll authored
(cherry picked from commit ed3b095c)
-
Nils Goroll authored
WS_ReserveSize() does not leave the workspace reserved when the reservation fails, so WS_Release() must be called for retval > 0 only. Besides the debug string, it is identical to WS_Reserve() except for assert(bytes > 0); Follow-up varnishcache/varnish-cache#2967 Note: The WS_Reserve() function has not been deprecated as that can potentially create problems for the build process of VMODs. (cherry picked from commit 4e333597)
-
Nils Goroll authored
This works with gcc 6.3.0 and clang 3.8.1-24 The test for __GNUC__ is deliberately simple and might not catch all compilers which would potentially support deprecation marks. While more specifics could be added, the aim is to raise awareness with developers and we consider it quite unlikely that anyone does not compile with one of the main stream compilers at all. (cherry picked from commit 1594037c)
-
Nils Goroll authored
... to un-confuse the interface Notes on changes from WS_Reserve(): * Removed the first WS_Assert because all we change is ws->r and we got a specific assert on it. * it follows from PAOK(ws->e) && PAOK(ws->f) in WS_Assert() that PAOK(ws->r) && PAOK(b), so we remove the PRNDDN() Ref: varnishcache/varnish-cache#2967 (cherry picked from commit d001cdd2)
-
- 20 Dec, 2019 1 commit
-
-
Guillaume Quintard authored
-
- 19 Dec, 2019 7 commits
-
-
Andrew Wiik authored
-
Andrew Wiik authored
-
Martin Blix Grydeland authored
Fix the probe scheduler heap comparison function to be consistent with regard to different running state of the two arguments. With this fix, probes that are not running will always bubble to the top before those that are already running.
-
Dridi Boukelmoune authored
Otherwise you might run into this: Message from VCC-compiler: Unused backend nil, defined: ('<vcl.inline>' Line 4 Pos 17) backend nil none; ----------------###------ (That was just a warning) Message from C-compiler: vgc.c:1476:20: error: unused variable 'vgc_backend_nil' [-Werror,-Wunused-variable] static VCL_BACKEND vgc_backend_nil; ^ 1 error generated. Running C-compiler failed, exited with 1 VCL compilation failed This is done in both init and discard code to maintain the balance.
-
Nils Goroll authored
As discussed during bugwash, we should be consistent about the manual temperature controls and not transition cold->warm, but rather fail.
-
Nils Goroll authored
Conceptually, the auto state was a variant of the warm state which would automatically cool the vcl. Yet, cooling did not only transition the temperature, but also the state, so 'auto' only worked one way - except that vcl.use or moving a label (by labeling another vcl) would also set 'auto', so a manual warm/cold setting would get lost. Now the auto-state will remain no matter the actual temperature or labeling, so when a vcl needs to implicitly change temperature (due to being used or being labeled), an auto vcl will remain auto, and a cold/warm vcl will change state, but never become 'auto' implicitly. The vcl state/temperature test v00003.vtc, besides testing the new auto semantics, now also checks for the right vcl.list output and has been reduced by a duplicate check (warm event check has been integrated into an existing warm event). On other code changes: * mgt_vcl_setstate is now only concerned with the state, the temperature will be changed implicitly if so required. The state will either end up changed or restored, depending on success. owner of changes to the (struct vclprog).state member * mgt_vcl_settemp responsible for the right action to change the temperature. For auto, it will only change the temperature, for non-auto, also the state. owner of changes to the (struct vclprog).warm member * mgt_vcl_tellchild Inform the child about a change and/or temperature change * mgt_vcl_set_cooldown Update the cooldown (go_cold) appropriately, should be called after a change/temperature change. Fixes #2834 Closes #2801 Conflicts: bin/varnishtest/tests/v00003.vtc
-
Poul-Henning Kamp authored
the child process. Inspired by: #2471
-
- 18 Dec, 2019 4 commits
-
-
Andrew Wiik authored
-
Nils Goroll authored
Ref #3067
-
Nils Goroll authored
Ref #3067
-
Andrew Wiik authored
-
- 12 Dec, 2019 1 commit
-
-
Poul-Henning Kamp authored
-
- 11 Dec, 2019 3 commits
-
-
Nils Goroll authored
When making other changes which require additional workspace, this test may fail for too big a request in the first place. This additional logging facilitates before/after analysis
-
Dridi Boukelmoune authored
Spotted via vtest.
-
Dridi Boukelmoune authored
-
- 28 Oct, 2019 1 commit
-
-
Dag Haavi Finstad authored
Fixes: #3086
-
- 18 Oct, 2019 7 commits
-
-
Martin Blix Grydeland authored
-
Martin Blix Grydeland authored
-
Martin Blix Grydeland authored
req->err_code and req->err_reason are set when going to synthetic handling. From there the resp.reason HTTP field is set from req->err_reason if set, or the generic code based on req->err_code is used if it was NULL. This patch clears these members so that a value from the handling of a previous request doesn't linger. Fixes: VSV00004
-
Martin Blix Grydeland authored
-
Martin Blix Grydeland authored
Ref previous commit to remove the use of kill(signull) on the pids of the Varnish processes to test liveness.
-
Martin Blix Grydeland authored
A bug was uncovered in the VSM code that checks if kill(SIGNULL) would work as a test of liveness of the master and worker processes. If the user running the utility has the required permissions to send signal to the worker process, but not the management process, the code would wrongly assume it could do kill on both. It would then end up in a connect loop never succeeding. Because kill() can not always be successfully run (a common scenario when the user running varnishlog is not the same UID as the cache processes), there is a fall back to using fstat to check for Varnish restarts. Since this fallback is active for most use cases anyways, it was decided to retire the kill() mechanism rather than to fix it. This way the behaviour does not change depending on what user the utility is run as. This change was OK'd by PHK after discussing it on IRC.
-
Martin Blix Grydeland authored
Clusters VSM allocations start at offset 16. Make sure that the published segment includes that adjustment.
-