MINOR: proxy: Introduce proxy flags to replace disabled bitfield

This change is required to support TCP/HTTP rules in defaults sections. The
'disabled' bitfield in the proxy structure, used to know if a proxy is
disabled or stopped, is replaced a generic bitfield named 'flags'.

PR_DISABLED and PR_STOPPED flags are renamed to PR_FL_DISABLED and
PR_FL_STOPPED respectively. In addition, everywhere there is a test to know
if a proxy is disabled or stopped, there is now a bitwise AND operation on
PR_FL_DISABLED and/or PR_FL_STOPPED flags.
diff --git a/addons/promex/service-prometheus.c b/addons/promex/service-prometheus.c
index 69fb26a..221e407 100644
--- a/addons/promex/service-prometheus.c
+++ b/addons/promex/service-prometheus.c
@@ -613,7 +613,7 @@
 			labels[0].value = ist2(px->id, strlen(px->id));
 
 			/* skip the disabled proxies, global frontend and non-networked ones */
-			if (px->disabled || px->uuid <= 0 || !(px->cap & PR_CAP_FE))
+			if ((px->flags & PR_FL_DISABLED) || px->uuid <= 0 || !(px->cap & PR_CAP_FE))
 				goto next_px;
 
 			if (!stats_fill_fe_stats(px, stats, ST_F_TOTAL_FIELDS, &(appctx->st2)))
@@ -621,7 +621,7 @@
 
 			switch (appctx->st2) {
 				case ST_F_STATUS:
-					state = !px->disabled;
+					state = !(px->flags & PR_FL_STOPPED);
 					for (; appctx->ctx.stats.st_code < PROMEX_FRONT_STATE_COUNT; appctx->ctx.stats.st_code++) {
 						labels[1].name = ist("state");
 						labels[1].value = promex_front_st[appctx->ctx.stats.st_code];
@@ -714,7 +714,7 @@
 			labels[0].value = ist2(px->id, strlen(px->id));
 
 			/* skip the disabled proxies, global frontend and non-networked ones */
-			if (px->disabled || px->uuid <= 0 || !(px->cap & PR_CAP_FE))
+			if ((px->flags & PR_FL_DISABLED) || px->uuid <= 0 || !(px->cap & PR_CAP_FE))
 				goto next_px;
 
 			li = appctx->ctx.stats.obj2;
@@ -804,7 +804,7 @@
 			labels[0].value = ist2(px->id, strlen(px->id));
 
 			/* skip the disabled proxies, global frontend and non-networked ones */
-			if (px->disabled || px->uuid <= 0 || !(px->cap & PR_CAP_BE))
+			if ((px->flags & PR_FL_DISABLED) || px->uuid <= 0 || !(px->cap & PR_CAP_BE))
 				goto next_px;
 
 			if (!stats_fill_be_stats(px, 0, stats, ST_F_TOTAL_FIELDS, &(appctx->st2)))
@@ -937,7 +937,7 @@
 			labels[0].value = ist2(px->id, strlen(px->id));
 
 			/* skip the disabled proxies, global frontend and non-networked ones */
-			if (px->disabled || px->uuid <= 0 || !(px->cap & PR_CAP_BE))
+			if ((px->flags & PR_FL_DISABLED) || px->uuid <= 0 || !(px->cap & PR_CAP_BE))
 				goto next_px;
 
 			while (appctx->ctx.stats.obj2) {
diff --git a/include/haproxy/backend.h b/include/haproxy/backend.h
index 17dffac..a6ac621 100644
--- a/include/haproxy/backend.h
+++ b/include/haproxy/backend.h
@@ -52,7 +52,7 @@
 /* Returns number of usable servers in backend */
 static inline int be_usable_srv(struct proxy *be)
 {
-        if (be->disabled)
+        if (be->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
                 return 0;
         else if (be->srv_act)
                 return be->srv_act;
diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h
index 5ef47c3..c38c339 100644
--- a/include/haproxy/proxy-t.h
+++ b/include/haproxy/proxy-t.h
@@ -200,9 +200,9 @@
 #define PR_RE_EARLY_ERROR         0x00010000 /* Retry if we failed at sending early data */
 #define PR_RE_JUNK_REQUEST        0x00020000 /* We received an incomplete or garbage response */
 
-/* disabled state */
-#define PR_DISABLED               0x1  /* The proxy was disabled in the configuration (not at runtime) */
-#define PR_STOPPED                0x2  /* The proxy was stopped */
+/* Proxy flags */
+#define PR_FL_DISABLED           0x01  /* The proxy was disabled in the configuration (not at runtime) */
+#define PR_FL_STOPPED            0x02  /* The proxy was stopped */
 
 struct stream;
 
@@ -258,7 +258,7 @@
 
 struct proxy {
 	enum obj_type obj_type;                 /* object type == OBJ_TYPE_PROXY */
-	char disabled;                          /* bit field PR_DISABLED | PR_STOPPED */
+	char flags;                             /* bit field PR_FL_* */
 	enum pr_mode mode;                      /* mode = PR_MODE_TCP, PR_MODE_HTTP, ... */
 	char cap;                               /* supported capabilities (PR_CAP_*) */
 	unsigned int maxconn;                   /* max # of active streams on the frontend */
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 6f526d4..f6589d1 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -595,12 +595,12 @@
 	else if (strcmp(args[0], "disabled") == 0) {  /* disables this proxy */
 		if (alertif_too_many_args(0, file, linenum, args, &err_code))
 			goto out;
-		curproxy->disabled |= PR_DISABLED;
+		curproxy->flags |= PR_FL_DISABLED;
 	}
 	else if (strcmp(args[0], "enabled") == 0) {  /* enables this proxy (used to revert a disabled default) */
 		if (alertif_too_many_args(0, file, linenum, args, &err_code))
 			goto out;
-		curproxy->disabled = 0;
+		curproxy->flags &= ~PR_FL_DISABLED;
 	}
 	else if (strcmp(args[0], "bind-process") == 0) {  /* enable this proxy only on some processes */
 		int cur_arg = 1;
diff --git a/src/cfgparse.c b/src/cfgparse.c
index e606a47..dbb55ed 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1019,7 +1019,7 @@
 		stktables_list = t;
 	}
 	else if (strcmp(args[0], "disabled") == 0) {  /* disables this peers section */
-		curpeers->disabled |= PR_DISABLED;
+		curpeers->disabled |= PR_FL_DISABLED;
 	}
 	else if (strcmp(args[0], "enabled") == 0) {  /* enables this peers section (used to revert a disabled default) */
 		curpeers->disabled = 0;
@@ -2502,7 +2502,7 @@
 		if (curproxy->uuid >= 0)
 			next_pxid++;
 
-		if (curproxy->disabled) {
+		if (curproxy->flags & PR_FL_DISABLED) {
 			/* ensure we don't keep listeners uselessly bound. We
 			 * can't disable their listeners yet (fdtab not
 			 * allocated yet) but let's skip them.
@@ -3962,7 +3962,7 @@
 	 * other proxies.
 	 */
 	for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
-		if (curproxy->disabled || !curproxy->table)
+		if ((curproxy->flags & PR_FL_DISABLED) || !curproxy->table)
 			continue;
 
 		if (!stktable_init(curproxy->table)) {
diff --git a/src/check.c b/src/check.c
index ad6df9c..dd6a951 100644
--- a/src/check.c
+++ b/src/check.c
@@ -1117,7 +1117,7 @@
 		 * is disabled.
 		 */
 		if (((check->state & (CHK_ST_ENABLED | CHK_ST_PAUSED)) != CHK_ST_ENABLED) ||
-		    proxy->disabled) {
+		    (proxy->flags & (PR_FL_DISABLED|PR_FL_STOPPED))) {
 			TRACE_STATE("health-check paused or disabled", CHK_EV_TASK_WAKE, check);
 			goto reschedule;
 		}
diff --git a/src/extcheck.c b/src/extcheck.c
index 5b0d3e9..f517362 100644
--- a/src/extcheck.c
+++ b/src/extcheck.c
@@ -494,7 +494,7 @@
 		 * is disabled.
 		 */
 		if (((check->state & (CHK_ST_ENABLED | CHK_ST_PAUSED)) != CHK_ST_ENABLED) ||
-		    s->proxy->disabled)
+		    (s->proxy->flags & (PR_FL_DISABLED|PR_FL_STOPPED)))
 			goto reschedule;
 
 		/* we'll initiate a new check */
diff --git a/src/filters.c b/src/filters.c
index f64c192..06ae788 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -292,7 +292,7 @@
 	int err_code = ERR_NONE;
 
 	for (px = proxies_list; px; px = px->next) {
-		if (px->disabled) {
+		if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) {
 			flt_deinit(px);
 			continue;
 		}
@@ -315,7 +315,7 @@
 	int err_code = 0;
 
 	for (px = proxies_list; px; px = px->next) {
-		if (px->disabled)
+		if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 			continue;
 
 		err_code = flt_init_per_thread(px);
diff --git a/src/haproxy.c b/src/haproxy.c
index 7a4dc79..3c41c86 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -1999,7 +1999,7 @@
 		struct post_proxy_check_fct *ppcf;
 		struct post_server_check_fct *pscf;
 
-		if (px->disabled)
+		if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 			continue;
 
 		list_for_each_entry(pscf, &post_server_check_list, list) {
@@ -2061,13 +2061,13 @@
 				break;
 
 		for (px = proxies_list; px; px = px->next)
-			if (!px->disabled && px->li_all)
+			if (!(px->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) && px->li_all)
 				break;
 
 		if (!px) {
 			/* We may only have log-forward section */
 			for (px = cfg_log_forward; px; px = px->next)
-				if (!px->disabled && px->li_all)
+				if (!(px->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) && px->li_all)
 					break;
 		}
 
@@ -2401,7 +2401,7 @@
 
 	/* stop disabled proxies */
 	for (px = proxies_list; px; px = px->next) {
-		if (px->disabled)
+		if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 			stop_proxy(px);
 	}
 
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index 5fa7502..46ee5ed 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -3088,7 +3088,7 @@
 	}
 	fcgi_send(fconn);
 
-	if (unlikely(fconn->proxy->disabled)) {
+	if (unlikely(fconn->proxy->flags & (PR_FL_DISABLED|PR_FL_STOPPED))) {
 		/* frontend is stopping, reload likely in progress, let's try
 		 * to announce a graceful shutdown if not yet done. We don't
 		 * care if it fails, it will be tried again later.
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 814b3fb..8d2e21c 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -1023,7 +1023,7 @@
 	}
 
 	/* If KAL, check if the frontend is stopping. If yes, switch in CLO mode */
-	if (h1s->flags & H1S_F_WANT_KAL && fe->disabled) {
+	if (h1s->flags & H1S_F_WANT_KAL && (fe->flags & (PR_FL_DISABLED|PR_FL_STOPPED))) {
 		h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO;
 		TRACE_STATE("stopping, set close mode", H1_EV_RX_DATA|H1_EV_RX_HDRS|H1_EV_TX_DATA|H1_EV_TX_HDRS, h1s->h1c->conn, h1s);
 	}
@@ -1087,7 +1087,7 @@
 	}
 
 	/* If KAL, check if the backend is stopping. If yes, switch in CLO mode */
-	if (h1s->flags & H1S_F_WANT_KAL && be->disabled) {
+	if (h1s->flags & H1S_F_WANT_KAL && (be->flags & (PR_FL_DISABLED|PR_FL_STOPPED))) {
 		h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO;
 		TRACE_STATE("stopping, set close mode", H1_EV_RX_DATA|H1_EV_RX_HDRS|H1_EV_TX_DATA|H1_EV_TX_HDRS, h1s->h1c->conn, h1s);
 	}
@@ -2841,7 +2841,7 @@
 	 * Release idling front connection if this is the case.
 	 */
 	if (!(h1c->flags & H1C_F_IS_BACK)) {
-		if (unlikely(h1c->px->disabled)) {
+		if (unlikely(h1c->px->flags & (PR_FL_DISABLED|PR_FL_STOPPED))) {
 			if (h1c->flags & H1C_F_WAIT_NEXT_REQ)
 				goto release;
 		}
diff --git a/src/mux_h2.c b/src/mux_h2.c
index f32766d..03dbd54 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -3925,7 +3925,7 @@
 	}
 	h2_send(h2c);
 
-	if (unlikely(h2c->proxy->disabled) && !(h2c->flags & H2_CF_IS_BACK)) {
+	if (unlikely(h2c->proxy->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) && !(h2c->flags & H2_CF_IS_BACK)) {
 		/* frontend is stopping, reload likely in progress, let's try
 		 * to announce a graceful shutdown if not yet done. We don't
 		 * care if it fails, it will be tried again later.
diff --git a/src/mworker.c b/src/mworker.c
index 7c73780..fb3adc0 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -443,7 +443,7 @@
 		}
 		/* if the proxy shouldn't be in the master, we stop it */
 		if (!listen_in_master)
-			curproxy->disabled |= PR_DISABLED;
+			curproxy->flags |= PR_FL_DISABLED;
 	}
 }
 
diff --git a/src/proxy.c b/src/proxy.c
index 4dbf671..c99f3a5 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -1364,7 +1364,7 @@
 void proxy_preset_defaults(struct proxy *defproxy)
 {
 	defproxy->mode = PR_MODE_TCP;
-	defproxy->disabled = 0;
+	defproxy->flags = 0;
 	if (!(defproxy->cap & PR_CAP_INT)) {
 		defproxy->maxconn = cfg_maxpconn;
 		defproxy->conn_retries = CONN_RETRIES;
@@ -1532,7 +1532,7 @@
 	/* set default values from the specified default proxy */
 	memcpy(&curproxy->defsrv, &defproxy->defsrv, sizeof(curproxy->defsrv));
 
-	curproxy->disabled = defproxy->disabled;
+	curproxy->flags = defproxy->flags;
 	curproxy->options = defproxy->options;
 	curproxy->options2 = defproxy->options2;
 	curproxy->no_options = defproxy->no_options;
@@ -1811,19 +1811,19 @@
 }
 
 /* to be called under the proxy lock after stopping some listeners. This will
- * automatically update the p->disabled flag after stopping the last one, and
+ * automatically update the p->flags flag after stopping the last one, and
  * will emit a log indicating the proxy's condition. The function is idempotent
  * so that it will not emit multiple logs; a proxy will be disabled only once.
  */
 void proxy_cond_disable(struct proxy *p)
 {
-	if (p->disabled)
+	if (p->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 		return;
 
 	if (p->li_ready + p->li_paused > 0)
 		return;
 
-	p->disabled |= PR_STOPPED;
+	p->flags |= PR_FL_STOPPED;
 
 	/* Note: syslog proxies use their own loggers so while it's somewhat OK
 	 * to report them being stopped as a warning, we must not spam their log
@@ -1863,7 +1863,7 @@
 	 */
 
 	/* first, let's check if we need to stop the proxy */
-	if (unlikely(stopping && !p->disabled)) {
+	if (unlikely(stopping && !(p->flags & (PR_FL_DISABLED|PR_FL_STOPPED)))) {
 		int t;
 		t = tick_remain(now_ms, p->stop_time);
 		if (t == 0) {
@@ -1883,7 +1883,7 @@
 	 * be in neither list. Any entry being dumped will have ref_cnt > 0.
 	 * However we protect tables that are being synced to peers.
 	 */
-	if (unlikely(stopping && p->disabled && p->table && p->table->current)) {
+	if (unlikely(stopping && (p->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) && p->table && p->table->current)) {
 
 		if (!p->table->refcnt) {
 			/* !table->refcnt means there
@@ -2103,7 +2103,7 @@
 {
 	struct listener *l;
 
-	if (!(p->cap & PR_CAP_FE) || p->disabled || !p->li_ready)
+	if (!(p->cap & PR_CAP_FE) || (p->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) || !p->li_ready)
 		return 1;
 
 	list_for_each_entry(l, &p->conf.listeners, by_fe)
@@ -2122,7 +2122,7 @@
  * to be called when going down in order to release the ports so that another
  * process may bind to them. It must also be called on disabled proxies at the
  * end of start-up. If all listeners are closed, the proxy is set to the
- * PR_STSTOPPED state. The function takes the proxy's lock so it's safe to
+ * PR_STOPPED state. The function takes the proxy's lock so it's safe to
  * call from multiple places.
  */
 void stop_proxy(struct proxy *p)
@@ -2134,9 +2134,9 @@
 	list_for_each_entry(l, &p->conf.listeners, by_fe)
 		stop_listener(l, 1, 0, 0);
 
-	if (!p->disabled && !p->li_ready) {
+	if (!(p->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) && !p->li_ready) {
 		/* might be just a backend */
-		p->disabled |= PR_STOPPED;
+		p->flags |= PR_FL_STOPPED;
 	}
 
 	HA_RWLOCK_WRUNLOCK(PROXY_LOCK, &p->lock);
@@ -2152,7 +2152,7 @@
 	struct listener *l;
 	int fail;
 
-	if (p->disabled || !p->li_paused)
+	if ((p->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) || !p->li_paused)
 		return 1;
 
 	fail = 0;
@@ -2372,7 +2372,7 @@
 	struct switching_rule *swrule1, *swrule2;
 
 	for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
-		if (curproxy->disabled)
+		if (curproxy->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 			continue;
 
 		if (!(curproxy->cap & PR_CAP_FE))
@@ -2416,7 +2416,7 @@
 	 * loop above because cross-references are not yet fully resolved.
 	 */
 	for (curproxy = proxies_list; curproxy; curproxy = curproxy->next) {
-		if (curproxy->disabled)
+		if (curproxy->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 			continue;
 
 		/* If <fullconn> is not set, let's set it to 10% of the sum of
@@ -2875,7 +2875,7 @@
 	if (!px)
 		return 1;
 
-	if (px->disabled)
+	if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 		return cli_msg(appctx, LOG_NOTICE, "Frontend was already shut down.\n");
 
 	stop_proxy(px);
@@ -2898,7 +2898,7 @@
 	if (!px)
 		return 1;
 
-	if (px->disabled)
+	if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 		return cli_msg(appctx, LOG_NOTICE, "Frontend was previously shut down, cannot disable.\n");
 
 	if (!px->li_ready)
@@ -2930,7 +2930,7 @@
 	if (!px)
 		return 1;
 
-	if (px->disabled)
+	if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED))
 		return cli_err(appctx, "Frontend was previously shut down, cannot enable.\n");
 
 	if (px->li_ready == px->li_all)
diff --git a/src/server.c b/src/server.c
index ca9a593..b8908ce 100644
--- a/src/server.c
+++ b/src/server.c
@@ -3865,7 +3865,7 @@
 		struct server *srv;
 
 		/* servers are in backend only */
-		if (!(curproxy->cap & PR_CAP_BE) || curproxy->disabled)
+		if (!(curproxy->cap & PR_CAP_BE) || (curproxy->flags & (PR_FL_DISABLED|PR_FL_STOPPED)))
 			goto srv_init_addr_next;
 
 		for (srv = curproxy->srv; srv; srv = srv->next) {
@@ -3954,7 +3954,7 @@
 		return NULL;
 	}
 
-	if (px->disabled) {
+	if (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) {
 		cli_err(appctx, "Proxy is disabled.\n");
 		return NULL;
 	}
diff --git a/src/server_state.c b/src/server_state.c
index a831d57..dcbbe41 100644
--- a/src/server_state.c
+++ b/src/server_state.c
@@ -830,7 +830,7 @@
 		struct eb_root local_state_tree = EB_ROOT_UNIQUE;
 
 		/* Must be an enabled backend with at least a server */
-		if (!(curproxy->cap & PR_CAP_BE) || curproxy->disabled || !curproxy->srv)
+		if (!(curproxy->cap & PR_CAP_BE) || (curproxy->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) || !curproxy->srv)
 			continue; /* next proxy */
 
 		/* Mode must be specified */
diff --git a/src/stats.c b/src/stats.c
index bc083de..2705a17 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -1695,7 +1695,7 @@
 				metric = mkf_u64(FN_COUNTER, px->fe_counters.denied_sess);
 				break;
 			case ST_F_STATUS:
-				metric = mkf_str(FO_STATUS, px->disabled ? "STOP" : "OPEN");
+				metric = mkf_str(FO_STATUS, (px->flags & (PR_FL_DISABLED|PR_FL_STOPPED)) ? "STOP" : "OPEN");
 				break;
 			case ST_F_PID:
 				metric = mkf_u32(FO_KEY, 1);
@@ -3678,7 +3678,7 @@
 		 * Also skip proxies that were disabled in the configuration
 		 * This change allows retrieving stats from "old" proxies after a reload.
 		 */
-		if (!(px->disabled & PR_DISABLED) && px->uuid > 0 &&
+		if (!(px->flags & PR_FL_DISABLED) && px->uuid > 0 &&
 		    (px->cap & (PR_CAP_FE | PR_CAP_BE)) && !(px->cap & PR_CAP_INT)) {
 			if (stats_dump_proxy_to_buffer(si, htx, px, uri) == 0)
 				return 0;
@@ -4091,7 +4091,7 @@
 						total_servers++;
 						break;
 					case ST_ADM_ACTION_SHUTDOWN:
-						if (!px->disabled) {
+						if (!(px->flags & (PR_FL_DISABLED|PR_FL_STOPPED))) {
 							srv_shutdown_streams(sv, SF_ERR_KILLED);
 							altered_servers++;
 							total_servers++;
diff --git a/src/stick_table.c b/src/stick_table.c
index 4936677..ae22b83 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -654,7 +654,7 @@
 			t->exp_task->process = process_table_expire;
 			t->exp_task->context = (void *)t;
 		}
-		if (t->peers.p && t->peers.p->peers_fe && !t->peers.p->peers_fe->disabled) {
+		if (t->peers.p && t->peers.p->peers_fe && !(t->peers.p->peers_fe->flags & (PR_FL_DISABLED|PR_FL_STOPPED))) {
 			peers_retval = peers_register_table(t->peers.p, t);
 		}
 
diff --git a/src/stream.c b/src/stream.c
index 4fc22b8..c2e3ff9 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -747,7 +747,7 @@
 	pool_free(pool_head_stream, s);
 
 	/* We may want to free the maximum amount of pools if the proxy is stopping */
-	if (fe && unlikely(fe->disabled)) {
+	if (fe && unlikely(fe->flags & (PR_FL_DISABLED|PR_FL_STOPPED))) {
 		pool_flush(pool_head_buffer);
 		pool_flush(pool_head_http_txn);
 		pool_flush(pool_head_requri);