]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: frontend: move some remaining stream settings to stream_new()
authorWilly Tarreau <w@1wt.eu>
Sun, 5 Apr 2015 16:15:59 +0000 (18:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Apr 2015 09:37:35 +0000 (11:37 +0200)
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.

src/frontend.c
src/stream.c

index 723ec41449d2a3b7231517f688fe40e9489f5bab..e8531e9ffe8045ab4dbde431c27324ad2b8fab81 100644 (file)
@@ -141,15 +141,6 @@ int frontend_accept(struct stream *s)
        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;
 
index 59d1d5de3c3148fd78d1fb172a4160024c88383e..b28dff7a2c0ae447ca4b37e61dd061ba08cb4191 100644 (file)
@@ -191,8 +191,13 @@ struct stream *stream_new(struct session *sess, struct task *t)
        /* 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 @@ struct stream *stream_new(struct session *sess, struct task *t)
                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;