This option may be set both in a frontend and in a backend. It is enabled if
at least one of the frontend or backend holding a connection has it enabled.
- This option has no effect if it is combined with "option httpclose", which
- has precedence.
+ This option may be compbined with "option httpclose", which will cause
+ keepalive to be announced to the server and close to be announced to the
+ client. This practice is discouraged though.
If this option has been enabled in a "defaults" section, it can be disabled
in a specific instance by prepending the "no" keyword before it.
(txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_SCL) &&
((txn->flags & TX_HDR_CONN_CLO) || /* "connection: close" */
(txn->flags & (TX_REQ_VER_11|TX_HDR_CONN_KAL)) == 0 || /* no "connection: k-a" in 1.0 */
- ((s->fe->options|s->be->options) & PR_O_HTTP_CLOSE) || /* httpclose + any = forceclose */
+ (((s->fe->options|s->be->options) & PR_O_HTTP_CLOSE) && /* httpclose without pretend-ka... */
+ 1/*!((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA)*/) || /* ... +any = forceclose */
!(txn->flags & TX_REQ_XFER_LEN) || /* no length known => close */
s->fe->state == PR_STSTOPPED)) /* frontend is stopping */
txn->flags = (txn->flags & ~TX_CON_WANT_MSK) | TX_CON_WANT_CLO;
/* 11: add "Connection: close" or "Connection: keep-alive" if needed and not yet set. */
if (((txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_TUN) ||
- ((s->fe->options|s->be->options) & PR_O_HTTP_CLOSE)) {
+ ((s->fe->options|s->be->options) & PR_O_HTTP_CLOSE) ||
+ ((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA)) {
unsigned int want_flags = 0;
if (txn->flags & TX_REQ_VER_11) {
- if (((txn->flags & TX_CON_WANT_MSK) >= TX_CON_WANT_SCL &&
- !((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA)) ||
- ((s->fe->options|s->be->options) & PR_O_HTTP_CLOSE))
+ if (((txn->flags & TX_CON_WANT_MSK) >= TX_CON_WANT_SCL ||
+ ((s->fe->options|s->be->options) & PR_O_HTTP_CLOSE)) &&
+ !((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA))
want_flags |= TX_CON_CLO_SET;
} else {
- if ((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_KAL ||
- (((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA) &&
- !((s->fe->options|s->be->options) & PR_O_HTTP_CLOSE)))
+ if (((txn->flags & TX_CON_WANT_MSK) == TX_CON_WANT_KAL &&
+ !((s->fe->options|s->be->options) & PR_O_HTTP_CLOSE)) ||
+ ((s->fe->options2|s->be->options2) & PR_O2_FAKE_KA))
want_flags |= TX_CON_KAL_SET;
}