]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: Handle appctx case first when releasing the endpoint
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 15 Dec 2021 08:14:47 +0000 (09:14 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Feb 2022 10:00:01 +0000 (11:00 +0100)
Stream-interfaces will be moved in the conn-stream and the appctx will be
moved at the same level than the muxes. Idea is to merge the
stream-interface and the conn-stream and have a better symmetry between the
muxes and the applets. To limit bugs during this refactoring, when the SI
endpoint is released, the appctx case is handled first.

include/haproxy/stream_interface.h

index 88c8101d05912275bf39beb8ae52eaf255436a18..c1c2b03fa8dc07c492853db4767c1f8279a6f917 100644 (file)
@@ -177,17 +177,17 @@ static inline void si_release_endpoint(struct stream_interface *si)
        if (!si->end)
                return;
 
-       if ((cs = objt_cs(si->end))) {
+       if ((appctx = objt_appctx(si->end))) {
+               if (appctx->applet->release && !si_state_in(si->state, SI_SB_DIS|SI_SB_CLO))
+                       appctx->applet->release(appctx);
+               appctx_free(appctx);
+       }
+       else if ((cs = objt_cs(si->end))) {
                if (si->wait_event.events != 0)
                        cs->conn->mux->unsubscribe(cs, si->wait_event.events,
                            &si->wait_event);
                cs_destroy(cs);
        }
-       else if ((appctx = objt_appctx(si->end))) {
-               if (appctx->applet->release && !si_state_in(si->state, SI_SB_DIS|SI_SB_CLO))
-                       appctx->applet->release(appctx);
-               appctx_free(appctx);
-       }
        si_detach_endpoint(si);
 }