void RES_WriteObj(struct sess *sp);
/* cache_synthetic.c */
-void SYN_ErrorPage(struct sess *sp, int status, const char *reason);
+void SYN_ErrorPage(struct sess *sp, int status, const char *reason, int ttl);
/* cache_vary.c */
void VRY_Create(const struct sess *sp);
{
AZ(sp->obj);
- SYN_ErrorPage(sp, sp->err_code, sp->err_reason);
+ SYN_ErrorPage(sp, sp->err_code, sp->err_reason, params->err_ttl);
sp->err_code = 0;
sp->err_reason = NULL;
sp->step = STP_DONE;
*sp->http0 = *sp->http;
if (done != 0) {
- SYN_ErrorPage(sp, done, NULL); /* XXX: STP_ERROR ? */
+ SYN_ErrorPage(sp, done, NULL, params->err_ttl); /* XXX: STP_ERROR ? */
sp->step = STP_DONE;
return (0);
}
*/
void
-SYN_ErrorPage(struct sess *sp, int status, const char *reason)
+SYN_ErrorPage(struct sess *sp, int status, const char *reason, int ttl)
{
struct http *h;
struct worker *w;
unsigned u;
struct vsb vsb;
int fd;
- int ttl = 0; /* XXX: ?? */
WSL_Flush(sp->wrk, 0);
assert(status >= 100 && status <= 999);
/* TTL used for lack of anything better */
unsigned default_ttl;
+
+ /* TTL used for synthesized error pages */
+ unsigned err_ttl;
/* Worker threads and pool */
unsigned wthread_min;
"Use 0x notation and do the bitor in your head :-)\n",
0,
"0", "bitmap" },
+ { "err_ttl", tweak_uint, &master.err_ttl, 0, UINT_MAX,
+ "The TTL assigned to the synthesized error pages\n",
+ 0,
+ "0", "seconds" },
{ NULL, NULL, NULL }
};
Note that changes to this parameter are not applied retroactively.
.Pp
The default is 120 seconds.
+.It Va err_ttl
+The default time-to-live assigned to the synthesized error pages.
+.Pp
+The default is 0 seconds.
.It Va fetch_chunksize
The default chunk size used when retrieving documents for which the
backend server does not specify a content length.