mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 06:41:32 +02:00
REORG: Initialize the conn-stream by hand in cs_init()
The function cs_init() is only called by cs_new(). The conn-stream initialization will be reviewed. It is easier to do it in cs_new() instead of using a dedicated function. cs_new() is pretty simple, there is no reason to split the code in this case.
This commit is contained in:
parent
9388204db1
commit
bb772d09f5
@ -42,20 +42,6 @@ int cs_attach_app(struct conn_stream *cs, enum obj_type *app);
|
|||||||
void cs_detach_endp(struct conn_stream *cs);
|
void cs_detach_endp(struct conn_stream *cs);
|
||||||
void cs_detach_app(struct conn_stream *cs);
|
void cs_detach_app(struct conn_stream *cs);
|
||||||
|
|
||||||
/*
|
|
||||||
* Initializes all required fields for a new conn_strema.
|
|
||||||
*/
|
|
||||||
static inline void cs_init(struct conn_stream *cs)
|
|
||||||
{
|
|
||||||
cs->obj_type = OBJ_TYPE_CS;
|
|
||||||
cs->flags = CS_FL_NONE;
|
|
||||||
cs->end = NULL;
|
|
||||||
cs->app = NULL;
|
|
||||||
cs->ctx = NULL;
|
|
||||||
cs->si = NULL;
|
|
||||||
cs->data_cb = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Returns the connection from a cs if the endpoint is a mux stream. Otherwise
|
/* Returns the connection from a cs if the endpoint is a mux stream. Otherwise
|
||||||
* NULL is returned. __cs_conn() returns the connection without any control
|
* NULL is returned. __cs_conn() returns the connection without any control
|
||||||
* while cs_conn() check the endpoint type.
|
* while cs_conn() check the endpoint type.
|
||||||
|
@ -29,7 +29,15 @@ struct conn_stream *cs_new()
|
|||||||
cs = pool_alloc(pool_head_connstream);
|
cs = pool_alloc(pool_head_connstream);
|
||||||
if (unlikely(!cs))
|
if (unlikely(!cs))
|
||||||
return NULL;
|
return NULL;
|
||||||
cs_init(cs);
|
|
||||||
|
cs->obj_type = OBJ_TYPE_CS;
|
||||||
|
cs->flags = CS_FL_NONE;
|
||||||
|
cs->end = NULL;
|
||||||
|
cs->app = NULL;
|
||||||
|
cs->ctx = NULL;
|
||||||
|
cs->si = NULL;
|
||||||
|
cs->data_cb = NULL;
|
||||||
|
|
||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user