* If not so, we check the FD and buffer states before leaving.
* A full request is indicated by the fact that we have seen
* the double LF/CRLF, so the state is >= HTTP_MSG_BODY. Invalid
- * requests are checked first.
- *
+ * requests are checked first. When waiting for a second request
+ * on a keep-alive session, if we encounter and error, close, t/o,
+ * we note the error in the session flags but don't set any state.
+ * Since the error will be noted there, it will not be counted by
+ * process_session() as a frontend error.
*/
if (unlikely(msg->msg_state < HTTP_MSG_BODY)) {
/* 2: have we encountered a read error ? */
else if (req->flags & BF_READ_ERROR) {
+ if (!(s->flags & SN_ERR_MASK))
+ s->flags |= SN_ERR_CLICL;
+
if (txn->flags & TX_WAIT_NEXT_RQ)
goto failed_keep_alive;
if (s->listener->counters)
s->listener->counters->failed_req++;
- if (!(s->flags & SN_ERR_MASK))
- s->flags |= SN_ERR_CLICL;
if (!(s->flags & SN_FINST_MASK))
s->flags |= SN_FINST_R;
return 0;
/* 3: has the read timeout expired ? */
else if (req->flags & BF_READ_TIMEOUT || tick_is_expired(req->analyse_exp, now_ms)) {
+ if (!(s->flags & SN_ERR_MASK))
+ s->flags |= SN_ERR_CLITO;
+
if (txn->flags & TX_WAIT_NEXT_RQ)
goto failed_keep_alive;
if (s->listener->counters)
s->listener->counters->failed_req++;
- if (!(s->flags & SN_ERR_MASK))
- s->flags |= SN_ERR_CLITO;
if (!(s->flags & SN_FINST_MASK))
s->flags |= SN_FINST_R;
return 0;
/* 4: have we encountered a close ? */
else if (req->flags & BF_SHUTR) {
+ if (!(s->flags & SN_ERR_MASK))
+ s->flags |= SN_ERR_CLICL;
+
if (txn->flags & TX_WAIT_NEXT_RQ)
goto failed_keep_alive;
if (s->listener->counters)
s->listener->counters->failed_req++;
- if (!(s->flags & SN_ERR_MASK))
- s->flags |= SN_ERR_CLICL;
if (!(s->flags & SN_FINST_MASK))
s->flags |= SN_FINST_R;
return 0;