mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
MINOR: stream: add a new target_addr entry in the stream structure
The purpose will be to store the target address there and not to allocate a connection just for this anymore. For now it's only placed in the struct, a few fields were moved to plug some holes, and the entry is freed on release (never allocated yet for now). This must have no impact. Note that in order to fit, the store_count which previously was an int was turned into a short, which is way more than enough given that the hard-coded limit is 8.
This commit is contained in:
parent
16aa4aff6b
commit
9042060b0b
@ -148,15 +148,16 @@ struct stream {
|
||||
|
||||
struct freq_ctr call_rate; /* stream task call rate */
|
||||
|
||||
short store_count;
|
||||
enum obj_type obj_type; /* object type == OBJ_TYPE_STREAM */
|
||||
/* 1 unused bytes here */
|
||||
|
||||
struct {
|
||||
struct stksess *ts;
|
||||
struct stktable *table;
|
||||
} store[8]; /* tracked stickiness values to store */
|
||||
int store_count;
|
||||
|
||||
enum obj_type obj_type; /* object type == OBJ_TYPE_STREAM */
|
||||
/* 3 unused bytes here */
|
||||
|
||||
struct sockaddr_storage *target_addr; /* the address to join if not null */
|
||||
struct stkctr stkctr[MAX_SESS_STKCTR]; /* content-aware stick counters */
|
||||
|
||||
struct strm_flt strm_flt; /* current state of filters active on this stream */
|
||||
|
||||
@ -270,6 +270,7 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin)
|
||||
|
||||
stream_init_srv_conn(s);
|
||||
s->target = sess->listener ? sess->listener->default_target : NULL;
|
||||
s->target_addr = NULL;
|
||||
|
||||
s->pend_pos = NULL;
|
||||
s->priority_class = 0;
|
||||
@ -487,6 +488,7 @@ static void stream_free(struct stream *s)
|
||||
session_free(sess);
|
||||
}
|
||||
|
||||
sockaddr_free(&s->target_addr);
|
||||
pool_free(pool_head_stream, s);
|
||||
|
||||
/* We may want to free the maximum amount of pools if the proxy is stopping */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user