- 11 Feb, 2016 21 commits
-
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
shutdown.
-
Federico G. Schwindt authored
-
Poul-Henning Kamp authored
When we fork the worker process, we close all filedescriptors we have not explictly marked for it to inherit, for security reasons. Operating system libraries may have open filedescriptors (see end*ent(3)) and there is no way to chase these down. At least on OSX something related to DNS lookups leaves such a FD around, and when that code later discovers the FD doesn't work, it closes it, even though it no longer owns it. In ticket 1841, that happens to be FD7 which is one of our kqueue FDs. Normally such library code should set 'close-on-exec' status with fcntl(2) but that doesn't seem to be the case here, and this bit of wisdom seems neglegted about 50/50, so it probably wouldn't help us to examine this. The fix here is to close the FDs, and replace them with a FD open to /dev/null, so that there is no risk of information leak, but we don't reuse the FD for something else until the library has properly closed it. Fixes #1841
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
-
Federico G. Schwindt authored
Prompted by someone on #varnish. OK'd by phk.
-
Federico G. Schwindt authored
It is not allowed by the spec and we incorrectly assumed chunked and eventually timed out. OK'd by phk@. Fixes #1843.
-
Federico G. Schwindt authored
We don't have forward declarations in VCL. OK'd by phk@. Fixes #1837.
-
Poul-Henning Kamp authored
Spotted by: fgs
-
Poul-Henning Kamp authored
can recurse.
-
Poul-Henning Kamp authored
hyperwide memcmp()
-
Poul-Henning Kamp authored
In incredibly seldom circumstances this bug would cause ESI:include data to be bad. Fixes: #1852
-
Poul-Henning Kamp authored
-
Federico G. Schwindt authored
Fixes #1851.
-
Federico G. Schwindt authored
-
Poul-Henning Kamp authored
-
Lasse Karstensen authored
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
Fixes: #1857
-
Poul-Henning Kamp authored
-
- 28 Jan, 2016 3 commits
-
-
Lasse Karstensen authored
-
Lasse Karstensen authored
-
Lasse Karstensen authored
-
- 22 Jan, 2016 12 commits
-
-
Lasse Karstensen authored
-
Federico G. Schwindt authored
Fixes previous commit. Sigh.
-
Federico G. Schwindt authored
Broken in 9bb8f962. Committed solution proposed by phk@, discussed with phk@ and martin@. Fixes #1845.
-
Poul-Henning Kamp authored
-
Poul-Henning Kamp authored
into the macro-table.
-
Dridi Boukelmoune authored
Instead of counting the references, the VCL keeps track of them with up to 31 characters in the description. It is the VMOD's responsibility to keep track of the opaque struct vclref * and provide a meaningful user- friendly description.
-
Dridi Boukelmoune authored
By the time we decide to switch to a VCL, it must be warm and usable. The deprecated VCL_EVENT_USE should not get in the way.
-
Dridi Boukelmoune authored
Don't update the state of the VCL to warm if it failed, and don't start the child if the active VCL failed to warm up.
-
Dridi Boukelmoune authored
The implementation is similar to the load/discard dance when a load fails. New VGC functions are introduced iff the VCL has at least one VMOD handling events. The generated code looks like this: static unsigned vgc_inistep; static unsigned vgc_warmupstep; ... static int VGC_Load(VRT_CTX) { ... } static int VGC_Discard(VRT_CTX) { ... } static int VGC_Warmup(VRT_CTX, enum vcl_event_e ev) { vgc_warmupstep = 0; /* 4 */ if (Vmod_debug_Func._event(ctx, &vmod_priv_debug, ev)) return (1); vgc_warmupstep = 4; return (0); } static int VGC_Use(VRT_CTX, enum vcl_event_e ev) { /* 4 */ if (Vmod_debug_Func._event(ctx, &vmod_priv_debug, ev)) return (1); return (0); } static int VGC_Cooldown(VRT_CTX, enum vcl_event_e ev) { int retval = 0; /* 4 */ if (vgc_warmupstep >= 4 && Vmod_debug_Func._event(ctx, &vmod_priv_debug, ev) != 0) retval = 1; return (retval); } static int VGC_Event(VRT_CTX, enum vcl_event_e ev) { if (ev == VCL_EVENT_LOAD) return(VGC_Load(ctx)); if (ev == VCL_EVENT_WARM) return(VGC_Warmup(ctx, ev)); if (ev == VCL_EVENT_USE) return(VGC_Use(ctx, ev)); if (ev == VCL_EVENT_COLD) return(VGC_Cooldown(ctx, ev)); if (ev == VCL_EVENT_DISCARD) return(VGC_Discard(ctx)); return (1); } However, if there are no VMODs handling events, no new functions shall be generated, leading to code looking like this: static unsigned vgc_inistep; static unsigned vgc_warmupstep; ... static int VGC_Load(VRT_CTX) { ... } static int VGC_Discard(VRT_CTX) { ... } static int VGC_Event(VRT_CTX, enum vcl_event_e ev) { if (ev == VCL_EVENT_LOAD) return(VGC_Load(ctx)); if (ev == VCL_EVENT_DISCARD) return(VGC_Discard(ctx)); (void)vgc_warmupstep; return (0); }
-
Dridi Boukelmoune authored
It is also possible to convey a message to the CLI. In case of a failure the VCL is cooled down. VCL_Load may now fail with either CLIS_PARAM or CLIS_CANT.
-
Dridi Boukelmoune authored
The two functions are separated in order to have self-documenting signatures because one class of events is (or will be) allowed to fail while the other MUST be failsafe.
-
Dridi Boukelmoune authored
Make a clear distinction between (struct vclprog).warm that is used as a boolean, unlike the second parameter of mgt_vcl_setstate. We don't use an actual C enum but const char[] to make debugging easier.
-
- 21 Jan, 2016 2 commits
-
-
Federico G. Schwindt authored
-
Federico G. Schwindt authored
Discussed with mithrandir@.
-
- 20 Jan, 2016 1 commit
-
-
Lasse Karstensen authored
-
- 19 Jan, 2016 1 commit
-
-
Lasse Karstensen authored
-