From: des Date: Tue, 23 Oct 2007 12:35:29 +0000 (+0000) Subject: Supply reasonable defaults for error code / reason. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24be6a31b51227a1c769cc9d85252725b0c45157;p=varnish Supply reasonable defaults for error code / reason. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2161 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index a8244a66..2ae6be78 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -56,8 +56,8 @@ VRT_error(struct sess *sp, unsigned code, const char *reason) CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); WSL(sp->wrk, SLT_Debug, 0, "VCL_error(%u, %s)", code, reason); - sp->err_code = code; - sp->err_reason = reason; + sp->err_code = code ? code : 503; + sp->err_reason = reason ? reason : http_StatusMessage(sp->err_code); } /*--------------------------------------------------------------------*/