MINOR: stick-table: make skttable_data_cast to use only std types
This patch replaces all advanced data type aliases on
stktable_data_cast calls by standard types.
This way we could call the same stktable_data_cast
regardless of the used advanced data type as long they
are using the same std type.
It also removes all the advanced data type aliases.
diff --git a/include/haproxy/session.h b/include/haproxy/session.h
index 1842b7a..d838fd9 100644
--- a/include/haproxy/session.h
+++ b/include/haproxy/session.h
@@ -60,8 +60,8 @@
if (ptr) {
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
- if (stktable_data_cast(ptr, conn_cur) > 0)
- stktable_data_cast(ptr, conn_cur)--;
+ if (stktable_data_cast(ptr, std_t_uint) > 0)
+ stktable_data_cast(ptr, std_t_uint)--;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
diff --git a/include/haproxy/stick_table-t.h b/include/haproxy/stick_table-t.h
index 237bfbe..f09956a 100644
--- a/include/haproxy/stick_table-t.h
+++ b/include/haproxy/stick_table-t.h
@@ -118,30 +118,6 @@
unsigned long long std_t_ull;
struct freq_ctr std_t_frqp;
struct dict_entry *std_t_dict;
-
- /* types of each storable data */
- int server_id;
- struct dict_entry *server_key;
- unsigned int gpt0;
- unsigned int gpc0;
- struct freq_ctr gpc0_rate;
- unsigned int gpc1;
- struct freq_ctr gpc1_rate;
- unsigned int conn_cnt;
- struct freq_ctr conn_rate;
- unsigned int conn_cur;
- unsigned int sess_cnt;
- struct freq_ctr sess_rate;
- unsigned int http_req_cnt;
- struct freq_ctr http_req_rate;
- unsigned int http_err_cnt;
- struct freq_ctr http_err_rate;
- unsigned long long bytes_in_cnt;
- struct freq_ctr bytes_in_rate;
- unsigned long long bytes_out_cnt;
- struct freq_ctr bytes_out_rate;
- unsigned int http_fail_cnt;
- struct freq_ctr http_fail_rate;
};
/* known data types */
diff --git a/include/haproxy/stick_table.h b/include/haproxy/stick_table.h
index c9fb85e..4dffe2a 100644
--- a/include/haproxy/stick_table.h
+++ b/include/haproxy/stick_table.h
@@ -232,11 +232,11 @@
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_REQ_CNT);
if (ptr1)
- stktable_data_cast(ptr1, http_req_cnt)++;
+ stktable_data_cast(ptr1, std_t_uint)++;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_REQ_RATE);
if (ptr2)
- update_freq_ctr_period(&stktable_data_cast(ptr2, http_req_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -264,11 +264,11 @@
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_ERR_CNT);
if (ptr1)
- stktable_data_cast(ptr1, http_err_cnt)++;
+ stktable_data_cast(ptr1, std_t_uint)++;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_ERR_RATE);
if (ptr2)
- update_freq_ctr_period(&stktable_data_cast(ptr2, http_err_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -296,11 +296,11 @@
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_FAIL_CNT);
if (ptr1)
- stktable_data_cast(ptr1, http_fail_cnt)++;
+ stktable_data_cast(ptr1, std_t_uint)++;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_HTTP_FAIL_RATE);
if (ptr2)
- update_freq_ctr_period(&stktable_data_cast(ptr2, http_fail_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u, 1);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -327,11 +327,11 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_IN_CNT);
if (ptr1)
- stktable_data_cast(ptr1, bytes_in_cnt) += bytes;
+ stktable_data_cast(ptr1, std_t_ull) += bytes;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_IN_RATE);
if (ptr2)
- update_freq_ctr_period(&stktable_data_cast(ptr2, bytes_in_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u, bytes);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -358,11 +358,11 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
ptr1 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_OUT_CNT);
if (ptr1)
- stktable_data_cast(ptr1, bytes_out_cnt) += bytes;
+ stktable_data_cast(ptr1, std_t_ull) += bytes;
ptr2 = stktable_data_ptr(stkctr->table, ts, STKTABLE_DT_BYTES_OUT_RATE);
if (ptr2)
- update_freq_ctr_period(&stktable_data_cast(ptr2, bytes_out_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u, bytes);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
diff --git a/include/haproxy/stream.h b/include/haproxy/stream.h
index 9a7ffa1..e89383d 100644
--- a/include/haproxy/stream.h
+++ b/include/haproxy/stream.h
@@ -126,8 +126,8 @@
if (ptr) {
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
- if (stktable_data_cast(ptr, conn_cur) > 0)
- stktable_data_cast(ptr, conn_cur)--;
+ if (stktable_data_cast(ptr, std_t_uint) > 0)
+ stktable_data_cast(ptr, std_t_uint)--;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -165,8 +165,8 @@
if (ptr) {
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
- if (stktable_data_cast(ptr, conn_cur) > 0)
- stktable_data_cast(ptr, conn_cur)--;
+ if (stktable_data_cast(ptr, std_t_uint) > 0)
+ stktable_data_cast(ptr, std_t_uint)--;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -190,15 +190,15 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR);
if (ptr)
- stktable_data_cast(ptr, conn_cur)++;
+ stktable_data_cast(ptr, std_t_uint)++;
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT);
if (ptr)
- stktable_data_cast(ptr, conn_cnt)++;
+ stktable_data_cast(ptr, std_t_uint)++;
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_RATE);
if (ptr)
- update_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_CONN_RATE].u, 1);
if (tick_isset(t->expire))
ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire));
diff --git a/src/http_act.c b/src/http_act.c
index b77fd93..f16b639 100644
--- a/src/http_act.c
+++ b/src/http_act.c
@@ -2011,19 +2011,19 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (ptr1)
- stktable_data_cast(ptr1, http_req_cnt)++;
+ stktable_data_cast(ptr1, std_t_uint)++;
if (ptr2)
- update_freq_ctr_period(&stktable_data_cast(ptr2, http_req_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr2, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u, 1);
if (ptr3)
- stktable_data_cast(ptr3, http_err_cnt)++;
+ stktable_data_cast(ptr3, std_t_uint)++;
if (ptr4)
- update_freq_ctr_period(&stktable_data_cast(ptr4, http_err_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr4, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u, 1);
if (ptr5)
- stktable_data_cast(ptr5, http_fail_cnt)++;
+ stktable_data_cast(ptr5, std_t_uint)++;
if (ptr6)
- update_freq_ctr_period(&stktable_data_cast(ptr6, http_fail_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr6, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u, 1);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
diff --git a/src/session.c b/src/session.c
index 0f26588..4789ca9 100644
--- a/src/session.c
+++ b/src/session.c
@@ -119,11 +119,11 @@
ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_SESS_CNT);
if (ptr)
- HA_ATOMIC_INC(&stktable_data_cast(ptr, sess_cnt));
+ HA_ATOMIC_INC(&stktable_data_cast(ptr, std_t_uint));
ptr = stktable_data_ptr(stkctr->table, stkctr_entry(stkctr), STKTABLE_DT_SESS_RATE);
if (ptr)
- update_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_SESS_RATE].u, 1);
}
}
diff --git a/src/stick_table.c b/src/stick_table.c
index b1873f0..73c8fc1 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -98,8 +98,8 @@
void *data;
data = stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY);
if (data) {
- dict_entry_unref(&server_key_dict, stktable_data_cast(data, server_key));
- stktable_data_cast(data, server_key) = NULL;
+ dict_entry_unref(&server_key_dict, stktable_data_cast(data, std_t_dict));
+ stktable_data_cast(data, std_t_dict) = NULL;
}
HA_SPIN_LOCK(STK_TABLE_LOCK, &t->lock);
__stksess_free(t, ts);
@@ -1228,7 +1228,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_IN_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_BYTES_IN_RATE].u);
stktable_release(t, ts);
@@ -1265,7 +1265,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CNT);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, conn_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1301,7 +1301,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_CUR);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, conn_cur);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1337,7 +1337,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_CONN_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_CONN_RATE].u);
stktable_release(t, ts);
@@ -1374,7 +1374,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_OUT_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u);
stktable_release(t, ts);
@@ -1411,7 +1411,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPT0);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, gpt0);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1447,7 +1447,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC0);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, gpc0);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1483,7 +1483,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC0_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc0_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_GPC0_RATE].u);
stktable_release(t, ts);
@@ -1520,7 +1520,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC1);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, gpc1);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1556,7 +1556,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_GPC1_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc1_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_GPC1_RATE].u);
stktable_release(t, ts);
@@ -1593,7 +1593,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_ERR_CNT);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, http_err_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1629,7 +1629,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_ERR_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u);
stktable_release(t, ts);
@@ -1666,7 +1666,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_FAIL_CNT);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, http_fail_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1702,7 +1702,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_FAIL_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_fail_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u);
stktable_release(t, ts);
@@ -1739,7 +1739,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_REQ_CNT);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, http_req_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1775,7 +1775,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_HTTP_REQ_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u);
stktable_release(t, ts);
@@ -1812,7 +1812,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_IN_CNT);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, bytes_in_cnt) >> 10;
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_ull) >> 10;
stktable_release(t, ts);
return !!ptr;
@@ -1848,7 +1848,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_BYTES_OUT_CNT);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, bytes_out_cnt) >> 10;
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_ull) >> 10;
stktable_release(t, ts);
return !!ptr;
@@ -1884,7 +1884,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, server_id);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_sint);
stktable_release(t, ts);
return !!ptr;
@@ -1920,7 +1920,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SESS_CNT);
if (ptr)
- smp->data.u.sint = stktable_data_cast(ptr, sess_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
stktable_release(t, ts);
return !!ptr;
@@ -1956,7 +1956,7 @@
ptr = stktable_data_ptr(t, ts, STKTABLE_DT_SESS_RATE);
if (ptr)
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
t->data_arg[STKTABLE_DT_SESS_RATE].u);
stktable_release(t, ts);
@@ -2020,11 +2020,11 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (ptr1)
- update_freq_ctr_period(&stktable_data_cast(ptr1, gpc0_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr1, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u, 1);
if (ptr2)
- stktable_data_cast(ptr2, gpc0)++;
+ stktable_data_cast(ptr2, std_t_uint)++;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -2102,11 +2102,11 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
if (ptr1)
- update_freq_ctr_period(&stktable_data_cast(ptr1, gpc1_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr1, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u, 1);
if (ptr2)
- stktable_data_cast(ptr2, gpc1)++;
+ stktable_data_cast(ptr2, std_t_uint)++;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -2213,7 +2213,7 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
- stktable_data_cast(ptr, gpt0) = value;
+ stktable_data_cast(ptr, std_t_uint) = value;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -2494,7 +2494,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, gpt0);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2535,7 +2535,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, gpc0);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2576,7 +2576,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, gpc1);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2616,7 +2616,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc0_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2657,7 +2657,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, gpc1_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2702,13 +2702,13 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
if (ptr1) {
- update_freq_ctr_period(&stktable_data_cast(ptr1, gpc0_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr1, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC0_RATE].u, 1);
- smp->data.u.sint = (&stktable_data_cast(ptr1, gpc0_rate))->curr_ctr;
+ smp->data.u.sint = (&stktable_data_cast(ptr1, std_t_frqp))->curr_ctr;
}
if (ptr2)
- smp->data.u.sint = ++stktable_data_cast(ptr2, gpc0);
+ smp->data.u.sint = ++stktable_data_cast(ptr2, std_t_uint);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2755,13 +2755,13 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
if (ptr1) {
- update_freq_ctr_period(&stktable_data_cast(ptr1, gpc1_rate),
+ update_freq_ctr_period(&stktable_data_cast(ptr1, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_GPC1_RATE].u, 1);
- smp->data.u.sint = (&stktable_data_cast(ptr1, gpc1_rate))->curr_ctr;
+ smp->data.u.sint = (&stktable_data_cast(ptr1, std_t_frqp))->curr_ctr;
}
if (ptr2)
- smp->data.u.sint = ++stktable_data_cast(ptr2, gpc1);
+ smp->data.u.sint = ++stktable_data_cast(ptr2, std_t_uint);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2807,8 +2807,8 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, gpc0);
- stktable_data_cast(ptr, gpc0) = 0;
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
+ stktable_data_cast(ptr, std_t_uint) = 0;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2851,8 +2851,8 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, gpc1);
- stktable_data_cast(ptr, gpc1) = 0;
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
+ stktable_data_cast(ptr, std_t_uint) = 0;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2891,7 +2891,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, conn_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2932,7 +2932,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_CONN_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -2983,7 +2983,7 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
- smp->data.u.sint = ++stktable_data_cast(ptr, conn_cnt);
+ smp->data.u.sint = ++stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
@@ -3024,7 +3024,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, conn_cur);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3063,7 +3063,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, sess_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3101,7 +3101,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_SESS_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3141,7 +3141,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, http_req_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3180,7 +3180,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3220,7 +3220,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, http_err_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3259,7 +3259,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3299,7 +3299,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, http_fail_cnt);
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_uint);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3338,7 +3338,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, http_fail_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_HTTP_FAIL_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3378,7 +3378,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, bytes_in_cnt) >> 10;
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_ull) >> 10;
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3417,7 +3417,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3457,7 +3457,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = stktable_data_cast(ptr, bytes_out_cnt) >> 10;
+ smp->data.u.sint = stktable_data_cast(ptr, std_t_ull) >> 10;
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
@@ -3496,7 +3496,7 @@
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
- smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
+ smp->data.u.sint = read_freq_ctr_period(&stktable_data_cast(ptr, std_t_frqp),
stkctr->table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &stkctr_entry(stkctr)->lock);
diff --git a/src/stream.c b/src/stream.c
index 31913e0..c434708 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1245,7 +1245,7 @@
/* Look for the server name previously stored in <t> stick-table */
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &ts->lock);
ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY);
- de = stktable_data_cast(ptr, server_key);
+ de = stktable_data_cast(ptr, std_t_dict);
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &ts->lock);
if (de) {
@@ -1271,7 +1271,7 @@
/* Look for the server ID */
HA_RWLOCK_RDLOCK(STK_SESS_LOCK, &ts->lock);
ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID);
- node = eb32_lookup(&px->conf.used_server_id, stktable_data_cast(ptr, server_id));
+ node = eb32_lookup(&px->conf.used_server_id, stktable_data_cast(ptr, std_t_sint));
HA_RWLOCK_RDUNLOCK(STK_SESS_LOCK, &ts->lock);
if (!node)
@@ -1449,7 +1449,7 @@
HA_RWLOCK_WRLOCK(STK_SESS_LOCK, &ts->lock);
ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_ID);
- stktable_data_cast(ptr, server_id) = __objt_server(s->target)->puid;
+ stktable_data_cast(ptr, std_t_sint) = __objt_server(s->target)->puid;
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);
if (t->server_key_type == STKTABLE_SRV_NAME)
@@ -1463,7 +1463,7 @@
de = dict_insert(&server_key_dict, key);
if (de) {
ptr = __stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY);
- stktable_data_cast(ptr, server_key) = de;
+ stktable_data_cast(ptr, std_t_dict) = de;
}
HA_RWLOCK_WRUNLOCK(STK_SESS_LOCK, &ts->lock);