]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stconn: Don't clear SE_FL_ERROR when endpoint is reset
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Apr 2023 08:28:28 +0000 (10:28 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Apr 2023 15:05:53 +0000 (17:05 +0200)
There is no reason to remove this flag. When the SC endpoint is reset, it is
replaced by a new one. The old one is released. It was useful when the new
endpoint inherited some flags from the old one.  But it is no longer
performed. Thus there is no reason still unset this flag.

src/stconn.c

index 1ec6172b0247aad5373a47d20b5e505af8193863..ceb429b380af9ca671f215f4ddb17978a9e7e6e9 100644 (file)
@@ -437,9 +437,6 @@ void sc_destroy(struct stconn *sc)
 /* Resets the stream connector endpoint. It happens when the app layer want to renew
  * its endpoint. For a connection retry for instance. If a mux or an applet is
  * attached, a new endpoint is created. Returns -1 on error and 0 on success.
- *
- * Only SE_FL_ERROR flag is removed on the endpoint. Orther flags are preserved.
- * It is the caller responsibility to remove other flags if needed.
  */
 int sc_reset_endp(struct stconn *sc)
 {
@@ -447,7 +444,6 @@ int sc_reset_endp(struct stconn *sc)
 
        BUG_ON(!sc->app);
 
-       sc_ep_clr(sc, SE_FL_ERROR);
        if (!__sc_endp(sc)) {
                /* endpoint not attached or attached to a mux with no
                 * target. Thus the endpoint will not be release but just
@@ -461,10 +457,8 @@ int sc_reset_endp(struct stconn *sc)
        /* allocate the new endpoint first to be able to set error if it
         * fails */
        new_sd = sedesc_new();
-       if (!unlikely(new_sd)) {
-               sc_ep_set(sc, SE_FL_ERROR);
+       if (!unlikely(new_sd))
                return -1;
-       }
 
        /* The app is still attached, the sc will not be released */
        sc_detach_endp(&sc);