]> err.no Git - varnish/commitdiff
TCP connections don't quite behave like other fds, and we need to handle
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 7 Dec 2007 12:03:58 +0000 (12:03 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 7 Dec 2007 12:03:58 +0000 (12:03 +0000)
that for the managers CLI event-engine:

React to POLLNVAL as we would to POLLHUP

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2286 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/mgt_cli.c
varnish-cache/bin/varnishd/mgt_event.h

index c4df76281011bc5c9c8dd7074c80556cb7547f1d..29e10e869a35f993aca96bd707f0b61c2971bb65 100644 (file)
@@ -301,7 +301,7 @@ mgt_cli_callback(const struct ev *e, int what)
 
        CAST_OBJ_NOTNULL(cp, e->priv, CLI_PORT_MAGIC);
 
-       if (what & (EV_ERR | EV_HUP))
+       if (what & (EV_ERR | EV_HUP | EV_GONE))
                goto cli_close;
 
        /* grow the buffer if it is full */
index d93579d3a2d3b910565d94d3cc08728aad54502e..40c2ac6a0eb74d06f8168ad11972a2db6d51671f 100644 (file)
@@ -50,6 +50,7 @@ struct ev {
 #define                EV_WR   POLLOUT
 #define                EV_ERR  POLLERR
 #define                EV_HUP  POLLHUP
+#define                EV_GONE POLLNVAL
 #define                EV_SIG  -1
        int             sig;
        unsigned        sig_flags;