MEDIUM: proxy: replace proxy->state with proxy->disabled
The remaining proxy states were only used to distinguish an enabled
proxy from a disabled one. Due to the initialization order, both
PR_STNEW and PR_STREADY were equivalent after startup, and they
would only differ from PR_STSTOPPED when the proxy is disabled or
shutdown (which is effectively another way to disable it).
Now we just have a "disabled" field which allows to distinguish them.
It's becoming obvious that start_proxies() is only used to print a
greeting message now, that we'd rather get rid of. Probably that
zombify_proxy() and stop_proxy() should be merged once their
differences move to the right place.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 9c87218..1b73d2b 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -3609,7 +3609,7 @@
}
h2_send(h2c);
- if (unlikely(h2c->proxy->state == PR_STSTOPPED)) {
+ if (unlikely(h2c->proxy->disabled)) {
/* 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.