proxy->timeout.tunnel = TICK_ETERNITY;
}
-/* return proxy's abortonclose status: 0=off, non-zero=on.
- * Considers the proxy's mode when neither on/off was set,
- * and HTTP mode defaults to on.
+/* Return proxy's abortonclose status: 0=off, non-zero=on, with a default to
+ * <def> when neither choice was forced.
*/
-static inline int proxy_abrt_close(const struct proxy *px)
+static inline int proxy_abrt_close_def(const struct proxy *px, int def)
{
if (px->options & PR_O_ABRT_CLOSE)
return 1;
else if (px->no_options & PR_O_ABRT_CLOSE)
return 0;
/* When unset: 1 for HTTP, 0 for TCP */
- return px->mode == PR_MODE_HTTP;
+ return def;
+}
+
+/* return proxy's abortonclose status: 0=off, non-zero=on.
+ * Considers the proxy's mode when neither on/off was set,
+ * and HTTP mode defaults to on.
+ */
+static inline int proxy_abrt_close(const struct proxy *px)
+{
+ return proxy_abrt_close_def(px, px->mode == PR_MODE_HTTP);
}
/* increase the number of cumulated connections received on the designated frontend */
* server, which will decide whether to close or to go on processing the
* request. We only do that in tunnel mode, and not in other modes since
* it can be abused to exhaust source ports. */
- if (proxy_abrt_close(s->be)) {
+ if (proxy_abrt_close_def(s->be, 1)) {
channel_auto_read(req);
if ((s->scf->flags & (SC_FL_ABRT_DONE|SC_FL_EOS)) && !(txn->flags & TX_CON_WANT_TUN))
s->scb->flags |= SC_FL_NOLINGER;
if ((s->scf->flags & SC_FL_ERROR) ||
((s->scf->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)) &&
- proxy_abrt_close(px)))
+ proxy_abrt_close_def(px, 1)))
act_opts |= ACT_OPT_FINAL | ACT_OPT_FINAL_EARLY;
/* If "the current_rule_list" match the executed rule list, we are in
act_opts |= ACT_OPT_FINAL;
if ((s->scf->flags & SC_FL_ERROR) ||
((s->scf->flags & (SC_FL_EOS|SC_FL_ABRT_DONE)) &&
- proxy_abrt_close(px)))
+ proxy_abrt_close_def(px, 1)))
act_opts |= ACT_OPT_FINAL | ACT_OPT_FINAL_EARLY;
/* If "the current_rule_list" match the executed rule list, we are in
* buffers, otherwise a close could cause an RST on some systems
* (eg: Linux).
*/
- if (!proxy_abrt_close(s->be) && txn->meth != HTTP_METH_POST)
+ if (!proxy_abrt_close_def(s->be, 1) && txn->meth != HTTP_METH_POST)
channel_dont_read(chn);
/* if the server closes the connection, we want to immediately react
if (txn->rsp.flags & HTTP_MSGF_XFER_LEN)
s->scb->flags |= SC_FL_NOLINGER; /* we want to close ASAP */
/* see above in MSG_DONE why we only do this in these states */
- if (!proxy_abrt_close(s->be))
+ if (!proxy_abrt_close_def(s->be, 1))
channel_dont_read(chn);
goto end;
}