]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: connection: remove some unneeded checks for CO_FL_SOCK_WR_SH
authorWilly Tarreau <w@1wt.eu>
Thu, 23 Jan 2020 17:25:23 +0000 (18:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 23 Jan 2020 18:01:37 +0000 (19:01 +0100)
A few places in health checks and stream-int on the send path were still
checking for this flag. Now we do not and instead we rely on snd_buf()
to report the error if any.

It's worth noting that all 3 real muxes still use CO_FL_SOCK_WR_SH and
CO_FL_ERROR interchangeably at various places to decide to abort and/or
free their data. This should be clarified and fixed so that only
CO_FL_ERROR is used, and this will render the error paths simpler and
more accurate.

src/checks.c
src/stream_interface.c

index f30f1ae837b1ba344f96412713209e9a358e3a46..5f1cec92654c90c93b4487b13c297e59cb93ba5e 100644 (file)
@@ -765,13 +765,6 @@ static void __event_srv_chk_w(struct conn_stream *cs)
                goto out_wakeup;
        }
 
-       if (conn->flags & CO_FL_SOCK_WR_SH) {
-               /* if the output is closed, we can't do anything */
-               conn->flags |= CO_FL_ERROR;
-               chk_report_conn_err(check, 0, 0);
-               goto out_wakeup;
-       }
-
        /* here, we know that the connection is established. That's enough for
         * a pure TCP check.
         */
@@ -3036,12 +3029,6 @@ static int tcpcheck_main(struct check *check)
                                b_reset(&check->bi);
                        }
 
-                       if (conn->flags & CO_FL_SOCK_WR_SH) {
-                               conn->flags |= CO_FL_ERROR;
-                               chk_report_conn_err(check, 0, 0);
-                               goto out_end_tcpcheck;
-                       }
-
                        if (check->current_step->string_len >= b_size(&check->bo)) {
                                chunk_printf(&trash, "tcp-check send : string too large (%d) for buffer size (%u) at step %d",
                                             check->current_step->string_len, (unsigned int)b_size(&check->bo),
index 14e662711233ddec65c6a27ef85c3328d423a0d2..4e307ed6d9b960ec64b1e20732f6ff89ed3298d4 100644 (file)
@@ -668,7 +668,7 @@ int si_cs_send(struct conn_stream *cs)
                return 0;
 
        /* we might have been called just after an asynchronous shutw */
-       if (conn->flags & CO_FL_SOCK_WR_SH || oc->flags & CF_SHUTW)
+       if (oc->flags & CF_SHUTW)
                return 1;
 
        if (oc->pipe && conn->xprt->snd_pipe && conn->mux->snd_pipe) {