mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-21 06:06:59 -04:00
BUG/MEDIUM: stick-tables: some sample-fetch doesn't work in the connection state.
The sc_* sample fetch can work without the struct strm, because the
tracked counters are also stored in the session. So, this patchs
removes the check for the strm existance.
This bug is recent and was introduced in 1.7-dev2 by commit 6204cd9
("BUG/MAJOR: vars: always retrieve the stream and session from the sample")
This bugfix must be backported in 1.6.
This commit is contained in:
parent
ff480424ab
commit
40e1d51068
1 changed files with 2 additions and 61 deletions
63
src/stream.c
63
src/stream.c
|
|
@ -2754,7 +2754,8 @@ smp_fetch_sc_stkctr(struct session *sess, struct stream *strm, const struct arg
|
|||
* ctr form the stream, then from the session if it was not there.
|
||||
*/
|
||||
|
||||
stkptr = &strm->stkctr[num];
|
||||
if (strm)
|
||||
stkptr = &strm->stkctr[num];
|
||||
if (!strm || !stkctr_entry(stkptr)) {
|
||||
stkptr = &sess->stkctr[num];
|
||||
if (!stkctr_entry(stkptr))
|
||||
|
|
@ -2817,9 +2818,6 @@ smp_create_src_stkctr(struct session *sess, struct stream *strm, const struct ar
|
|||
static int
|
||||
smp_fetch_sc_tracked(const struct arg *args, struct sample *smp, const char *kw, void *private)
|
||||
{
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
smp->flags = SMP_F_VOL_TEST;
|
||||
smp->data.type = SMP_T_BOOL;
|
||||
smp->data.u.sint = !!smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
|
|
@ -2836,9 +2834,6 @@ smp_fetch_sc_get_gpt0(const struct arg *args, struct sample *smp, const char *kw
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -2866,9 +2861,6 @@ smp_fetch_sc_get_gpc0(const struct arg *args, struct sample *smp, const char *kw
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -2896,9 +2888,6 @@ smp_fetch_sc_gpc0_rate(const struct arg *args, struct sample *smp, const char *k
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -2925,9 +2914,6 @@ smp_fetch_sc_inc_gpc0(const struct arg *args, struct sample *smp, const char *kw
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -2972,9 +2958,6 @@ smp_fetch_sc_clr_gpc0(const struct arg *args, struct sample *smp, const char *kw
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3007,9 +2990,6 @@ smp_fetch_sc_conn_cnt(const struct arg *args, struct sample *smp, const char *kw
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3035,9 +3015,6 @@ smp_fetch_sc_conn_rate(const struct arg *args, struct sample *smp, const char *k
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3106,9 +3083,6 @@ smp_fetch_sc_conn_cur(const struct arg *args, struct sample *smp, const char *kw
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3134,9 +3108,6 @@ smp_fetch_sc_sess_cnt(const struct arg *args, struct sample *smp, const char *kw
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3161,9 +3132,6 @@ smp_fetch_sc_sess_rate(const struct arg *args, struct sample *smp, const char *k
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3190,9 +3158,6 @@ smp_fetch_sc_http_req_cnt(const struct arg *args, struct sample *smp, const char
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3218,9 +3183,6 @@ smp_fetch_sc_http_req_rate(const struct arg *args, struct sample *smp, const cha
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3247,9 +3209,6 @@ smp_fetch_sc_http_err_cnt(const struct arg *args, struct sample *smp, const char
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3275,9 +3234,6 @@ smp_fetch_sc_http_err_rate(const struct arg *args, struct sample *smp, const cha
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3304,9 +3260,6 @@ smp_fetch_sc_kbytes_in(const struct arg *args, struct sample *smp, const char *k
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3332,9 +3285,6 @@ smp_fetch_sc_bytes_in_rate(const struct arg *args, struct sample *smp, const cha
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3361,9 +3311,6 @@ smp_fetch_sc_kbytes_out(const struct arg *args, struct sample *smp, const char *
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3389,9 +3336,6 @@ smp_fetch_sc_bytes_out_rate(const struct arg *args, struct sample *smp, const ch
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
@ -3417,9 +3361,6 @@ smp_fetch_sc_trackers(const struct arg *args, struct sample *smp, const char *kw
|
|||
{
|
||||
struct stkctr *stkctr;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
stkctr = smp_fetch_sc_stkctr(smp->sess, smp->strm, args, kw);
|
||||
if (!stkctr)
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue