]> err.no Git - varnish/commitdiff
Add CLIS_COMMS errno (400) and return an error text as well.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 7 Aug 2006 16:14:37 +0000 (16:14 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 7 Aug 2006 16:14:37 +0000 (16:14 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@729 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/include/cli.h
varnish-cache/lib/libvarnish/cli_common.c

index 4695dc73a07b4d62d821ed31fb8d6a23f78f8523..319ec64d603d07c8b2021f27086702c7b46febd6 100644 (file)
@@ -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 */
index 7b89462e79b31c037e75f6f47b7f166f5d9b7999..9f19cbde7a1fd9e653c8e187b2372322bc046a31 100644 (file)
@@ -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);