Request for review: synthetic objects

Dag-Erling Smørgrav des at
Thu May 24 17:27:45 CEST 2007

The attached patch adds the beginning of an API for synthetic objects.

Brief overview:

 - moved http_msg array from cache_response.c to cache_http.c,
   introduced http_StatusMessage() lookup function

 - introduced http_Put{Protocol,Status,Response} to complement

 - introduced SYN_ErrorPage() in a new file, cache_synthetic.c.
   SYN_ErrorPage() populates the session's current object with the
   specified error code and a corresponding HTML error page; it is the
   caller's responsibility to ensure that the session has a suitable
   object (i.e. one that doesn't already have headers or a body)

 - rewrote RES_Error() to simply call SYN_ErrorPage() (with ttl = 0) and

 - rewrote cnt_fetch() to use SYN_ErrorPage() to create a 503 page with
   a TTL of 30 seconds when Fetch() fails.

 - removed the call to RES_Error() in cache_backend.c; the error
   trickles back up to cnt_fetch() anyway.

Dag-Erling Smørgrav
Senior Software Developer
Linpro AS -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: varnish-synthetic.diff
Type: text/x-diff
Size: 16320 bytes
Desc: not available
URL: <>

More information about the varnish-dev mailing list