1. 28 Jan, 2016 18 commits
  2. 26 Jan, 2016 1 commit
    • Devon H. O'Dell's avatar
      WS: Fix off-by-one in WS_Reset · 8656fec9
      Devon H. O'Dell authored
      WS_Assert allows the workspace to be full in its check that `ws->f <= ws->e`.
      WS_Reset does not honor this; if a snapshot was taken of a full workspace, and
      that snapshot is reverted with WS_Reset, we panic.
      
      This issue was identified by Jozef Hatala <jozef@fastly.com>
      8656fec9
  3. 25 Jan, 2016 2 commits
  4. 23 Jan, 2016 1 commit
  5. 22 Jan, 2016 3 commits
  6. 21 Jan, 2016 1 commit
  7. 20 Jan, 2016 2 commits
  8. 19 Jan, 2016 1 commit
  9. 18 Jan, 2016 9 commits
    • Poul-Henning Kamp's avatar
      Minor flexelinting · 085d3b26
      Poul-Henning Kamp authored
      085d3b26
    • Poul-Henning Kamp's avatar
      Pass the type of VCL method (B(ackend)/C(lient)/H(ousekeeping) · 9957868a
      Poul-Henning Kamp authored
      into the macro-table.
      9957868a
    • Dridi Boukelmoune's avatar
      Replace the VCL refcount by a self-desribing list · 8756bacc
      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.
      8756bacc
    • Dridi Boukelmoune's avatar
      Simplify `vcl.use` by making it failsafe · 81655e53
      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.
      81655e53
    • Dridi Boukelmoune's avatar
      Catch a vcl.state failure on the manager side · 18265396
      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.
      18265396
    • Dridi Boukelmoune's avatar
      Make VMODs actually fail warm-ups · 36293d0d
      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);
      	}
      36293d0d
    • Dridi Boukelmoune's avatar
      Allow VMODs to fail a warm-up · 64c3853f
      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.
      64c3853f
    • Poul-Henning Kamp's avatar
      Qualify the -C test-vcl name with the PID of the process, so two · 7d979720
      Poul-Henning Kamp authored
      concurrent -C tests don't collided.
      
      Problem spotted by:	fgs
      7d979720
    • Poul-Henning Kamp's avatar
      Use a unique (and now reserved) VCL name of -C testing. · 00736b71
      Poul-Henning Kamp authored
      Fixes:	#1802
      00736b71
  10. 15 Jan, 2016 2 commits