]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: stconn: export sc_new()
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 19 Mar 2026 13:55:04 +0000 (14:55 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Fri, 24 Apr 2026 09:32:45 +0000 (11:32 +0200)
This patch exports sc_new() by removing its static storage class and
adding its prototype to include/haproxy/stconn.h.

This is required to allow external modules, such as the upcoming haload
benchmarking tool, to allocate and initialize new stream connectors
from a stream endpoint descriptor (sedesc).

include/haproxy/stconn.h
src/stconn.c

index 7c6d3b5537112c083b6e3ae2b9a880b8104818eb..50db0c0bd31f38ed3c884387e5ddee706496b388 100644 (file)
@@ -40,6 +40,7 @@ struct check;
 #define IS_HTX_SC(sc)     ((sc_conn(sc) && IS_HTX_CONN(__sc_conn(sc))) || (sc_appctx(sc) && IS_HTX_STRM(__sc_strm(sc))))
 
 struct sedesc *sedesc_new();
+struct stconn *sc_new(struct sedesc *sedesc);
 void sedesc_free(struct sedesc *sedesc);
 
 void se_shutdown(struct sedesc *sedesc, enum se_shut_mode mode);
index c2f96a198f554404e36c8dbab82deb8a2e84cf97..8be03f14436af7005cef9d87dc9e164d2e766a29 100644 (file)
@@ -134,7 +134,7 @@ void se_shutdown(struct sedesc *sedesc, enum se_shut_mode mode)
  * function. The caller must, at least, set the SE_FL_ORPHAN or SE_FL_DETACHED
  * flag.
  */
-static struct stconn *sc_new(struct sedesc *sedesc)
+struct stconn *sc_new(struct sedesc *sedesc)
 {
        struct stconn *sc;