From cfabc9da492a0515ca318029ce0d4ec946598701 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 7 Dec 2007 12:03:58 +0000 Subject: [PATCH] TCP connections don't quite behave like other fds, and we need to handle 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 | 2 +- varnish-cache/bin/varnishd/mgt_event.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/mgt_cli.c b/varnish-cache/bin/varnishd/mgt_cli.c index c4df7628..29e10e86 100644 --- a/varnish-cache/bin/varnishd/mgt_cli.c +++ b/varnish-cache/bin/varnishd/mgt_cli.c @@ -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 */ diff --git a/varnish-cache/bin/varnishd/mgt_event.h b/varnish-cache/bin/varnishd/mgt_event.h index d93579d3..40c2ac6a 100644 --- a/varnish-cache/bin/varnishd/mgt_event.h +++ b/varnish-cache/bin/varnishd/mgt_event.h @@ -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; -- 2.39.5