diff --git a/src/stick_table.c b/src/stick_table.c index 365c9e0b6..dd23b52d6 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -1825,6 +1825,23 @@ static int sample_conv_table_bytes_in_rate(const struct arg *arg_p, struct sampl return smp_fetch_bytes_in_rate(&stkctr, smp, 1); } +/* Casts sample to the type of the table specified in arg(0), and looks + * it up into this table. Returns the data rate sent to clients in bytes/s + * if the key is present in the table, otherwise zero, so that comparisons can + * be easily performed. If the inspected parameter is not stored in the table, + * is returned. + */ +static int smp_fetch_bytes_out_rate(struct stkctr *stkctr, struct sample *smp, int decrefcnt); +static int sample_conv_table_bytes_out_rate(const struct arg *arg_p, struct sample *smp, void *private) +{ + struct stkctr stkctr; + + stkctr.table = arg_p[0].data.t; + stkctr_set_entry(&stkctr, smp_fetch_stksess(stkctr.table, smp, 0)); + + return smp_fetch_bytes_out_rate(&stkctr, smp, 1); +} + /* Casts sample to the type of the table specified in arg(0), and looks * it up into this table. Returns the cumulated number of connections for the key * if the key is present in the table, otherwise zero, so that comparisons can @@ -1942,23 +1959,6 @@ static int sample_conv_table_idle(const struct arg *arg_p, struct sample *smp, v return 1; } -/* Casts sample to the type of the table specified in arg(0), and looks - * it up into this table. Returns the data rate sent to clients in bytes/s - * if the key is present in the table, otherwise zero, so that comparisons can - * be easily performed. If the inspected parameter is not stored in the table, - * is returned. - */ -static int smp_fetch_bytes_out_rate(struct stkctr *stkctr, struct sample *smp, int decrefcnt); -static int sample_conv_table_bytes_out_rate(const struct arg *arg_p, struct sample *smp, void *private) -{ - struct stkctr stkctr; - - stkctr.table = arg_p[0].data.t; - stkctr_set_entry(&stkctr, smp_fetch_stksess(stkctr.table, smp, 0)); - - return smp_fetch_bytes_out_rate(&stkctr, smp, 1); -} - /* Casts sample to the type of the table specified in arg(0), and looks * it up into this table. Returns the cumulated number of front glitches for the * key if the key is present in the table, otherwise zero, so that comparisons