From: phk Date: Mon, 7 Aug 2006 16:14:37 +0000 (+0000) Subject: Add CLIS_COMMS errno (400) and return an error text as well. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d71d4e0e43656d4dd8717222e869279b52fdbf3d;p=varnish Add CLIS_COMMS errno (400) and return an error text as well. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@729 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/cli.h b/varnish-cache/include/cli.h index 4695dc73..319ec64d 100644 --- a/varnish-cache/include/cli.h +++ b/varnish-cache/include/cli.h @@ -179,7 +179,8 @@ enum cli_status_e { CLIS_TOOMANY = 105, CLIS_PARAM = 106, CLIS_OK = 200, - CLIS_CANT = 300 + CLIS_CANT = 300, + CLIS_COMMS = 400 }; /* Length of first line of response */ diff --git a/varnish-cache/lib/libvarnish/cli_common.c b/varnish-cache/lib/libvarnish/cli_common.c index 7b89462e..9f19cbde 100644 --- a/varnish-cache/lib/libvarnish/cli_common.c +++ b/varnish-cache/lib/libvarnish/cli_common.c @@ -110,6 +110,8 @@ cli_readres(int fd, unsigned *status, char **ptr, double tmo) if (i != CLI_LINE0_LEN) { if (status != NULL) *status = CLIS_COMMS; + if (ptr != NULL) + *ptr = strdup("CLI communication error"); return (1); } assert(i == CLI_LINE0_LEN);