From 1d2c79a53c4f040f16b77aa67f3833a643726d18 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 27 May 2022 11:15:19 +0200 Subject: [PATCH] CLEANUP: obj_type: rename OBJ_TYPE_CS to OBJ_TYPE_SC Let's apply the new name to the type as well. --- include/haproxy/obj_type-t.h | 2 +- include/haproxy/obj_type.h | 12 ++++++------ src/stconn.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/haproxy/obj_type-t.h b/include/haproxy/obj_type-t.h index 4f5b75b08..517d2303d 100644 --- a/include/haproxy/obj_type-t.h +++ b/include/haproxy/obj_type-t.h @@ -40,7 +40,7 @@ enum obj_type { OBJ_TYPE_APPCTX, /* object is a struct appctx */ OBJ_TYPE_CONN, /* object is a struct connection */ OBJ_TYPE_SRVRQ, /* object is a struct dns_srvrq */ - OBJ_TYPE_CS, /* object is a struct stconn */ + OBJ_TYPE_SC, /* object is a struct stconn */ OBJ_TYPE_STREAM, /* object is a struct stream */ OBJ_TYPE_CHECK, /* object is a struct check */ OBJ_TYPE_ENTRIES /* last one : number of entries */ diff --git a/include/haproxy/obj_type.h b/include/haproxy/obj_type.h index d60282d3f..103746088 100644 --- a/include/haproxy/obj_type.h +++ b/include/haproxy/obj_type.h @@ -51,7 +51,7 @@ static inline const char *obj_type_name(const enum obj_type *t) case OBJ_TYPE_APPCTX: return "APPCTX"; case OBJ_TYPE_CONN: return "CONN"; case OBJ_TYPE_SRVRQ: return "SRVRQ"; - case OBJ_TYPE_CS: return "CS"; + case OBJ_TYPE_SC: return "SC"; case OBJ_TYPE_STREAM: return "STREAM"; case OBJ_TYPE_CHECK: return "CHECK"; default: return "!INVAL!"; @@ -125,16 +125,16 @@ static inline struct appctx *objt_appctx(enum obj_type *t) return __objt_appctx(t); } -static inline struct stconn *__objt_cs(enum obj_type *t) +static inline struct stconn *__objt_sc(enum obj_type *t) { return (container_of(t, struct stconn, obj_type)); } -static inline struct stconn *objt_cs(enum obj_type *t) +static inline struct stconn *objt_sc(enum obj_type *t) { - if (!t || *t != OBJ_TYPE_CS) + if (!t || *t != OBJ_TYPE_SC) return NULL; - return __objt_cs(t); + return __objt_sc(t); } static inline struct connection *__objt_conn(enum obj_type *t) @@ -196,7 +196,7 @@ static inline void *obj_base_ptr(enum obj_type *t) case OBJ_TYPE_APPCTX: return __objt_appctx(t); case OBJ_TYPE_CONN: return __objt_conn(t); case OBJ_TYPE_SRVRQ: return __objt_resolv_srvrq(t); - case OBJ_TYPE_CS: return __objt_cs(t); + case OBJ_TYPE_SC: return __objt_sc(t); case OBJ_TYPE_STREAM: return __objt_stream(t); case OBJ_TYPE_CHECK: return __objt_check(t); default: return t; // exact pointer for invalid case diff --git a/src/stconn.c b/src/stconn.c index e0f0d2e1e..908908f36 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -130,7 +130,7 @@ static struct stconn *sc_new(struct sedesc *sedesc) if (unlikely(!sc)) goto alloc_error; - sc->obj_type = OBJ_TYPE_CS; + sc->obj_type = OBJ_TYPE_SC; sc->flags = SC_FL_NONE; sc->state = SC_ST_INI; sc->hcto = TICK_ETERNITY;