[MINOR] proxy: add PR_O2_DISPATCH to detect dispatch mode
Till now we used the fact that the dispatch address was not null to use
the dispatch mode. This is very unconvenient, so let's have a dedicated
option.
diff --git a/src/backend.c b/src/backend.c
index 0d5081a..857496c 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -619,8 +619,7 @@
goto out;
}
}
- else if (!*(int *)&s->be->dispatch_addr.sin_addr &&
- !(s->be->options & PR_O_TRANSP)) {
+ else if (!(s->be->options2 & PR_O2_DISPATCH) && !(s->be->options & PR_O_TRANSP)) {
err = SRV_STATUS_NOSRV;
goto out;
}
@@ -700,7 +699,7 @@
}
}
}
- else if (*(int *)&s->be->dispatch_addr.sin_addr) {
+ else if (s->be->options2 & PR_O2_DISPATCH) {
/* connect to the defined dispatch addr */
s->req->cons->addr.s.to = s->be->dispatch_addr;
}