MEDIUM: frontend: move some remaining stream settings to stream_new()
The auto-forwarding mechanism in case no analyser is set is generic
to the streams. Also the timeouts on the client side are better preset
in the stream initialization as well.
diff --git a/src/frontend.c b/src/frontend.c
index 723ec41..e8531e9 100644
--- a/src/frontend.c
+++ b/src/frontend.c
@@ -141,15 +141,6 @@
if (fe->mode == PR_MODE_HTTP)
s->req.flags |= CF_READ_DONTWAIT; /* one read is usually enough */
- /* note: this should not happen anymore since there's always at least the switching rules */
- if (!s->req.analysers) {
- channel_auto_connect(&s->req); /* don't wait to establish connection */
- channel_auto_close(&s->req); /* let the producer forward close requests */
- }
-
- s->req.rto = fe->timeout.client;
- s->res.wto = fe->timeout.client;
-
/* everything's OK, let's go on */
return 1;
diff --git a/src/stream.c b/src/stream.c
index 59d1d5d..b28dff7 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -191,8 +191,13 @@
/* activate default analysers enabled for this listener */
s->req.analysers = l->analysers;
+ if (!s->req.analysers) {
+ channel_auto_connect(&s->req); /* don't wait to establish connection */
+ channel_auto_close(&s->req); /* let the producer forward close requests */
+ }
+
+ s->req.rto = sess->fe->timeout.client;
s->req.wto = TICK_ETERNITY;
- s->req.rto = TICK_ETERNITY;
s->req.rex = TICK_ETERNITY;
s->req.wex = TICK_ETERNITY;
s->req.analyse_exp = TICK_ETERNITY;
@@ -206,8 +211,8 @@
s->res.flags |= CF_NEVER_WAIT;
}
+ s->res.wto = sess->fe->timeout.client;
s->res.rto = TICK_ETERNITY;
- s->res.wto = TICK_ETERNITY;
s->res.rex = TICK_ETERNITY;
s->res.wex = TICK_ETERNITY;
s->res.analyse_exp = TICK_ETERNITY;