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.
This commit is contained in:
Willy Tarreau 2015-04-05 18:15:59 +02:00
parent e0232f1e33
commit c8815efb06
2 changed files with 7 additions and 11 deletions

View File

@ -141,15 +141,6 @@ int frontend_accept(struct stream *s)
if (fe->mode == PR_MODE_HTTP) if (fe->mode == PR_MODE_HTTP)
s->req.flags |= CF_READ_DONTWAIT; /* one read is usually enough */ 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 */ /* everything's OK, let's go on */
return 1; return 1;

View File

@ -191,8 +191,13 @@ struct stream *stream_new(struct session *sess, struct task *t)
/* activate default analysers enabled for this listener */ /* activate default analysers enabled for this listener */
s->req.analysers = l->analysers; 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.wto = TICK_ETERNITY;
s->req.rto = TICK_ETERNITY;
s->req.rex = TICK_ETERNITY; s->req.rex = TICK_ETERNITY;
s->req.wex = TICK_ETERNITY; s->req.wex = TICK_ETERNITY;
s->req.analyse_exp = 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.flags |= CF_NEVER_WAIT;
} }
s->res.wto = sess->fe->timeout.client;
s->res.rto = TICK_ETERNITY; s->res.rto = TICK_ETERNITY;
s->res.wto = TICK_ETERNITY;
s->res.rex = TICK_ETERNITY; s->res.rex = TICK_ETERNITY;
s->res.wex = TICK_ETERNITY; s->res.wex = TICK_ETERNITY;
s->res.analyse_exp = TICK_ETERNITY; s->res.analyse_exp = TICK_ETERNITY;