* function only computes the condition, it does not apply the polarity required
* by IF/UNLESS, it's up to the caller to do this.
*/
-enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct stream *strm, unsigned int opt);
+enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt);
/* Returns a pointer to the first ACL conflicting with usage at place <where>
* which is one of the SMP_VAL_* bits indicating a check place, or NULL if
struct chunk *http_error_message(struct stream *s, int msgnum);
struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, struct proxy *curproxy,
const char **args, char **errmsg, int use_fmt);
-int smp_fetch_cookie(struct proxy *px, struct stream *strm, unsigned int opt,
+int smp_fetch_cookie(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private);
int
-smp_fetch_base32(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_base32(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private);
enum http_meth_t find_http_meth(const char *str, const int len);
struct sample_expr *sample_parse_expr(char **str, int *idx, const char *file, int line, char **err, struct arg_list *al);
struct sample_conv *find_sample_conv(const char *kw, int len);
-struct sample *sample_process(struct proxy *px, struct stream *strm,
- unsigned int dir, struct sample_expr *expr,
- struct sample *p);
-struct sample *sample_fetch_string(struct proxy *px, struct stream *strm,
- unsigned int opt, struct sample_expr *expr);
+struct sample *sample_process(struct proxy *px, struct session *sess,
+ struct stream *strm, unsigned int opt,
+ struct sample_expr *expr, struct sample *p);
+struct sample *sample_fetch_string(struct proxy *px, struct session *sess,
+ struct stream *strm, unsigned int opt,
+ struct sample_expr *expr);
void sample_register_fetches(struct sample_fetch_kw_list *psl);
void sample_register_convs(struct sample_conv_kw_list *psl);
const char *sample_src_names(unsigned int use);
struct stksess *stktable_lookup_key(struct stktable *t, struct stktable_key *key);
struct stksess *stktable_update_key(struct stktable *table, struct stktable_key *key);
struct stktable_key *smp_to_stkey(struct sample *smp, struct stktable *t);
-struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px,
+struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px, struct session *sess,
struct stream *strm, unsigned int opt,
struct sample_expr *expr, struct sample *smp);
int stktable_compatible_sample(struct sample_expr *expr, unsigned long table_type);
void sess_change_server(struct stream *sess, struct server *newsrv);
struct task *process_stream(struct task *t);
void default_srv_error(struct stream *s, struct stream_interface *si);
-struct stkctr *smp_fetch_sc_stkctr(struct stream *l4, const struct arg *args, const char *kw);
+struct stkctr *smp_fetch_sc_stkctr(struct session *sess, struct stream *strm, const struct arg *args, const char *kw);
int parse_track_counters(char **args, int *arg,
int section_type, struct proxy *curpx,
struct track_ctr_prm *prm,
};
/* needed below */
+struct session;
struct stream;
/* a sample context might be used by any sample fetch function in order to
struct sample_fetch {
const char *kw; /* configuration keyword */
int (*process)(struct proxy *px,
+ struct session *sess,
struct stream *strm,
unsigned int opt, /* fetch options (SMP_OPT_*) */
const struct arg *arg_p,
* if (cond->pol == ACL_COND_UNLESS)
* res = !res;
*/
-enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct stream *strm, unsigned int opt)
+enum acl_test_res acl_exec_cond(struct acl_cond *cond, struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt)
{
__label__ fetch_next;
struct acl_term_suite *suite;
/* we need to reset context and flags */
memset(&smp, 0, sizeof(smp));
fetch_next:
- if (!sample_process(px, strm, opt, expr->smp, &smp)) {
+ if (!sample_process(px, sess, strm, opt, expr->smp, &smp)) {
/* maybe we could not fetch because of missing data */
if (smp.flags & SMP_F_MAY_CHANGE && !(opt & SMP_OPT_FINAL))
acl_res |= ACL_TEST_MISS;
* undefined behaviour.
*/
static int
-smp_fetch_nbsrv(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_nbsrv(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
* undefined behaviour.
*/
static int
-smp_fetch_srv_is_up(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_srv_is_up(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct server *srv = args->data.srv;
* undefined behaviour.
*/
static int
-smp_fetch_connslots(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_connslots(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct server *iterator;
/* set temp integer to the id of the backend */
static int
-smp_fetch_be_id(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_be_id(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TXN;
/* set temp integer to the id of the server */
static int
-smp_fetch_srv_id(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_srv_id(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!objt_server(strm->target))
* undefined behaviour.
*/
static int
-smp_fetch_be_sess_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_be_sess_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
* undefined behaviour.
*/
static int
-smp_fetch_be_conn(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_be_conn(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
* undefined behaviour.
*/
static int
-smp_fetch_queue_size(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_queue_size(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
* undefined behaviour.
*/
static int
-smp_fetch_avg_queue_size(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_avg_queue_size(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int nbsrv;
* undefined behaviour.
*/
static int
-smp_fetch_srv_conn(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_srv_conn(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
* undefined behaviour.
*/
static int
-smp_fetch_srv_sess_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_srv_sess_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
/* boolean, returns true if compression is used (either gzip or deflate) in the response */
static int
-smp_fetch_res_comp(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_res_comp(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
/* string, returns algo */
static int
-smp_fetch_res_comp_algo(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_res_comp_algo(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!strm->comp_algo)
/* set temp integer to the id of the frontend */
static int
-smp_fetch_fe_id(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_fe_id(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_SESS;
smp->type = SMP_T_UINT;
- smp->data.uint = strm_sess(strm)->fe->uuid;
+ smp->data.uint = sess->fe->uuid;
return 1;
}
* an undefined behaviour.
*/
static int
-smp_fetch_fe_sess_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_fe_sess_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
* an undefined behaviour.
*/
static int
-smp_fetch_fe_conn(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_fe_conn(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
memset(&smp, 0, sizeof(smp));
/* Run the sample fetch process. */
- if (!f->process(hsmp->p, hsmp->s, 0, args, &smp, f->kw, f->private)) {
+ if (!f->process(hsmp->p, hsmp->s->sess, hsmp->s, 0, args, &smp, f->kw, f->private)) {
if (hsmp->stringsafe)
lua_pushstring(L, "");
else
* doesn't allow "yield" functions because the HAProxy engine cannot
* resume sample-fetches.
*/
-static int hlua_sample_fetch_wrapper(struct proxy *px, struct stream *s,
- unsigned int opt, const struct arg *arg_p,
+static int hlua_sample_fetch_wrapper(struct proxy *px, struct session *sess,
+ struct stream *s, unsigned int opt,
+ const struct arg *arg_p,
struct sample *smp, const char *kw, void *private)
{
struct hlua_function *fcn = (struct hlua_function *)private;
/* set temp integer to the number of connexions to the same listening socket */
static int
-smp_fetch_dconn(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_dconn(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_UINT;
- smp->data.uint = strm_sess(strm)->listener->nbconn;
+ smp->data.uint = sess->listener->nbconn;
return 1;
}
/* set temp integer to the id of the socket (listener) */
static int
-smp_fetch_so_id(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_so_id(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_UINT;
- smp->data.uint = strm_sess(strm)->listener->luid;
+ smp->data.uint = sess->listener->luid;
return 1;
}
case LOG_FMT_EXPR: // sample expression, may be request or response
key = NULL;
if (tmp->options & LOG_OPT_REQ_CAP)
- key = sample_fetch_string(be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, tmp->expr);
+ key = sample_fetch_string(be, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, tmp->expr);
if (!key && (tmp->options & LOG_OPT_RES_CAP))
- key = sample_fetch_string(be, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL, tmp->expr);
+ key = sample_fetch_string(be, sess, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL, tmp->expr);
if (tmp->options & LOG_OPT_HTTP)
ret = encode_chunk(tmplog, dst + maxsize,
'%', http_encode_map, key ? &key->data.str : &empty);
* used with content inspection.
*/
static int
-smp_fetch_wait_end(struct proxy *px, struct stream *s, unsigned int opt,
+smp_fetch_wait_end(struct proxy *px, struct session *sess, struct stream *s, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!(opt & SMP_OPT_FINAL)) {
/* return the number of bytes in the request buffer */
static int
-smp_fetch_len(struct proxy *px, struct stream *s, unsigned int opt,
+smp_fetch_len(struct proxy *px, struct session *sess, struct stream *s, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct channel *chn;
/* returns the type of SSL hello message (mainly used to detect an SSL hello) */
static int
-smp_fetch_ssl_hello_type(struct proxy *px, struct stream *s, unsigned int opt,
+smp_fetch_ssl_hello_type(struct proxy *px, struct session *sess, struct stream *s, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int hs_len;
* Note: this decoder only works with non-wrapping data.
*/
static int
-smp_fetch_req_ssl_ver(struct proxy *px, struct stream *s, unsigned int opt,
+smp_fetch_req_ssl_ver(struct proxy *px, struct session *sess, struct stream *s, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int version, bleft, msg_len;
* - opaque hostname[name_len bytes]
*/
static int
-smp_fetch_ssl_hello_sni(struct proxy *px, struct stream *s, unsigned int opt,
+smp_fetch_ssl_hello_sni(struct proxy *px, struct session *sess, struct stream *s, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int hs_len, ext_len, bleft;
* returned sample has type SMP_T_CSTR.
*/
int
-smp_fetch_rdp_cookie(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_rdp_cookie(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
return fetch_rdp_cookie_name(strm, smp, args ? args->data.str.str : NULL, args ? args->data.str.len : 0);
/* returns either 1 or 0 depending on whether an RDP cookie is found or not */
static int
-smp_fetch_rdp_cookie_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_rdp_cookie_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int ret;
- ret = smp_fetch_rdp_cookie(px, strm, opt, args, smp, kw, private);
+ ret = smp_fetch_rdp_cookie(px, sess, strm, opt, args, smp, kw, private);
if (smp->flags & SMP_F_MAY_CHANGE)
return 0;
/* extracts part of a payload with offset and length at a given position */
static int
-smp_fetch_payload_lv(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_payload_lv(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *arg_p, struct sample *smp, const char *kw, void *private)
{
unsigned int len_offset = arg_p[0].data.uint;
/* extracts some payload at a fixed position and length */
static int
-smp_fetch_payload(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_payload(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *arg_p, struct sample *smp, const char *kw, void *private)
{
unsigned int buf_offset = arg_p[0].data.uint;
/* Check if we want to fail this monitor request or not */
list_for_each_entry(cond, &sess->fe->mon_fail_cond, list) {
- int ret = acl_exec_cond(cond, sess->fe, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ int ret = acl_exec_cond(cond, sess->fe, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (cond->pol == ACL_COND_UNLESS)
{
struct stats_admin_rule *stats_admin_rule;
struct stream_interface *si = &s->si[1];
+ struct session *sess = s->sess;
struct http_txn *txn = s->txn;
struct http_msg *msg = &txn->req;
struct uri_auth *uri_auth = s->be->uri_auth;
int ret = 1;
if (stats_admin_rule->cond) {
- ret = acl_exec_cond(stats_admin_rule->cond, s->be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(stats_admin_rule->cond, s->be, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (stats_admin_rule->cond->pol == ACL_COND_UNLESS)
ret = !ret;
if (rule->cond) {
int ret;
- ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(rule->cond, px, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (rule->cond->pol == ACL_COND_UNLESS)
void *ptr;
t = rule->act_prm.trk_ctr.table.t;
- key = stktable_fetch_key(t, s->be, s, SMP_OPT_DIR_REQ | SMP_OPT_FINAL, rule->act_prm.trk_ctr.expr, NULL);
+ key = stktable_fetch_key(t, s->be, sess, s, SMP_OPT_DIR_REQ | SMP_OPT_FINAL, rule->act_prm.trk_ctr.expr, NULL);
if (key && (ts = stktable_get_entry(t, key))) {
stream_track_stkctr(&s->stkctr[http_req_trk_idx(rule->action)], t, ts);
if (rule->cond) {
int ret;
- ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
+ ret = acl_exec_cond(rule->cond, px, sess, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (rule->cond->pol == ACL_COND_UNLESS)
/* add request headers from the rule sets in the same order */
list_for_each_entry(wl, &px->req_add, list) {
if (wl->cond) {
- int ret = acl_exec_cond(wl->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ int ret = acl_exec_cond(wl->cond, px, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (((struct acl_cond *)wl->cond)->pol == ACL_COND_UNLESS)
ret = !ret;
if (rule->cond) {
int ret;
- ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(rule->cond, px, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (rule->cond->pol == ACL_COND_UNLESS)
ret = !ret;
if (txn->status < 200 && txn->status != 101)
break;
if (wl->cond) {
- int ret = acl_exec_cond(wl->cond, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
+ int ret = acl_exec_cond(wl->cond, px, sess, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (((struct acl_cond *)wl->cond)->pol == ACL_COND_UNLESS)
ret = !ret;
*/
int apply_filters_to_request(struct stream *s, struct channel *req, struct proxy *px)
{
+ struct session *sess = s->sess;
struct http_txn *txn = s->txn;
struct hdr_exp *exp;
* next filter if the condition does not match.
*/
if (exp->cond) {
- ret = acl_exec_cond(exp->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(exp->cond, px, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (((struct acl_cond *)exp->cond)->pol == ACL_COND_UNLESS)
ret = !ret;
*/
int apply_filters_to_response(struct stream *s, struct channel *rtr, struct proxy *px)
{
+ struct session *sess = s->sess;
struct http_txn *txn = s->txn;
struct hdr_exp *exp;
* next filter if the condition does not match.
*/
if (exp->cond) {
- ret = acl_exec_cond(exp->cond, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
+ ret = acl_exec_cond(exp->cond, px, sess, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (((struct acl_cond *)exp->cond)->pol == ACL_COND_UNLESS)
ret = !ret;
smp_prefetch_http(struct proxy *px, struct stream *s, unsigned int opt,
const struct arg *args, struct sample *smp, int req_vol)
{
- struct http_txn *txn = s->txn;
- struct http_msg *msg = &txn->req;
+ struct http_txn *txn;
+ struct http_msg *msg;
/* Note: this function may only be used from places where
* http_init_txn() has already been done, and implies that <s>,
* against an eventual mistake in the fetch capability matrix.
*/
- if (unlikely(!s || !txn))
+ if (!s)
+ return 0;
+ txn = s->txn;
+
+ if (!txn)
return 0;
+ msg = &txn->req;
/* Check for a dependency on a request */
smp->type = SMP_T_BOOL;
* This is intended to be used with pat_match_meth() only.
*/
static int
-smp_fetch_meth(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_meth(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int meth;
}
static int
-smp_fetch_rqver(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_rqver(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = strm->txn;
}
static int
-smp_fetch_stver(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_stver(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
/* 3. Check on Status Code. We manipulate integers here. */
static int
-smp_fetch_stcode(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_stcode(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
/* 4. Check on URL/URI. A pointer to the URI is stored. */
static int
-smp_fetch_url(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_url(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
}
static int
-smp_fetch_url_ip(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_url_ip(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
}
static int
-smp_fetch_url_port(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_url_port(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
* returns full lines instead (useful for User-Agent or Date for example).
*/
static int
-smp_fetch_fhdr(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_fhdr(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct hdr_idx *idx;
* returns full lines instead (useful for User-Agent or Date for example).
*/
static int
-smp_fetch_fhdr_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_fhdr_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct hdr_idx *idx;
}
static int
-smp_fetch_hdr_names(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_hdr_names(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct hdr_idx *idx;
* headers are considered from the first one.
*/
static int
-smp_fetch_hdr(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_hdr(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct hdr_idx *idx;
* Accepts exactly 1 argument of type string.
*/
static int
-smp_fetch_hdr_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_hdr_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct hdr_idx *idx;
* may or may not be appropriate for everything.
*/
static int
-smp_fetch_hdr_val(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_hdr_val(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- int ret = smp_fetch_hdr(px, strm, opt, args, smp, kw, private);
+ int ret = smp_fetch_hdr(px, sess, strm, opt, args, smp, kw, private);
if (ret > 0) {
smp->type = SMP_T_UINT;
* It returns an IPv4 or IPv6 address.
*/
static int
-smp_fetch_hdr_ip(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_hdr_ip(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int ret;
- while ((ret = smp_fetch_hdr(px, strm, opt, args, smp, kw, private)) > 0) {
+ while ((ret = smp_fetch_hdr(px, sess, strm, opt, args, smp, kw, private)) > 0) {
if (url2ipv4((char *)smp->data.str.str, &smp->data.ipv4)) {
smp->type = SMP_T_IPV4;
break;
* the first '/' after the possible hostname, and ends before the possible '?'.
*/
static int
-smp_fetch_path(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_path(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
* The returned sample is of type string.
*/
static int
-smp_fetch_base(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_base(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
txn = strm->txn;
ctx.idx = 0;
if (!http_find_header2("Host", 4, txn->req.chn->buf->p, &txn->hdr_idx, &ctx) || !ctx.vlen)
- return smp_fetch_path(px, strm, opt, args, smp, kw, private);
+ return smp_fetch_path(px, sess, strm, opt, args, smp, kw, private);
/* OK we have the header value in ctx.line+ctx.val for ctx.vlen bytes */
temp = get_trash_chunk();
* high-traffic sites without having to store whole paths.
*/
int
-smp_fetch_base32(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_base32(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
* 8 bytes would still work.
*/
static int
-smp_fetch_base32_src(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_base32_src(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct chunk *temp;
- struct session *sess = strm_sess(strm);
struct connection *cli_conn = objt_conn(sess->origin);
if (!cli_conn)
return 0;
- if (!smp_fetch_base32(px, strm, opt, args, smp, kw, private))
+ if (!smp_fetch_base32(px, sess, strm, opt, args, smp, kw, private))
return 0;
temp = get_trash_chunk();
* of type string carrying the whole query string.
*/
static int
-smp_fetch_query(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_query(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
}
static int
-smp_fetch_proto_http(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_proto_http(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
/* Note: hdr_idx.v cannot be NULL in this ACL because the ACL is tagged
/* return a valid test if the current request is the first one on the connection */
static int
-smp_fetch_http_first_req(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_http_first_req(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
/* Accepts exactly 1 argument of type userlist */
static int
-smp_fetch_http_auth(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_http_auth(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
/* Accepts exactly 1 argument of type userlist */
static int
-smp_fetch_http_auth_grp(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_http_auth_grp(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
if (!args || args->type != ARGT_USR)
* the "capture" option in the configuration file
*/
static int
-smp_fetch_capture_header_req(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_capture_header_req(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct proxy *fe = strm_sess(strm)->fe;
* the "capture" option in the configuration file
*/
static int
-smp_fetch_capture_header_res(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_capture_header_res(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct proxy *fe = strm_sess(strm)->fe;
/* Extracts the METHOD in the HTTP request, the txn->uri should be filled before the call */
static int
-smp_fetch_capture_req_method(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_capture_req_method(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct chunk *temp;
/* Extracts the path in the HTTP request, the txn->uri should be filled before the call */
static int
-smp_fetch_capture_req_uri(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_capture_req_uri(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct chunk *temp;
* as a string (either "HTTP/1.0" or "HTTP/1.1").
*/
static int
-smp_fetch_capture_req_ver(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_capture_req_ver(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = strm->txn;
* as a string (either "HTTP/1.0" or "HTTP/1.1").
*/
static int
-smp_fetch_capture_res_ver(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_capture_res_ver(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn = strm->txn;
* The returned sample is of type CSTR. Can be used to parse cookies in other
* files.
*/
-int smp_fetch_cookie(struct proxy *px, struct stream *strm, unsigned int opt,
+int smp_fetch_cookie(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
* type UINT. Accepts exactly 1 argument of type string.
*/
static int
-smp_fetch_cookie_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_cookie_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
* takes a mandatory argument of type string. It relies on smp_fetch_cookie().
*/
static int
-smp_fetch_cookie_val(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_cookie_val(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- int ret = smp_fetch_cookie(px, strm, opt, args, smp, kw, private);
+ int ret = smp_fetch_cookie(px, sess, strm, opt, args, smp, kw, private);
if (ret > 0) {
smp->type = SMP_T_UINT;
}
static int
-smp_fetch_url_param(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_url_param(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
char delim = '?';
* above).
*/
static int
-smp_fetch_url_param_val(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_url_param_val(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- int ret = smp_fetch_url_param(px, strm, opt, args, smp, kw, private);
+ int ret = smp_fetch_url_param(px, sess, strm, opt, args, smp, kw, private);
if (ret > 0) {
smp->type = SMP_T_UINT;
* as well as the path
*/
static int
-smp_fetch_url32(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_url32(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct http_txn *txn;
* 8 bytes would still work.
*/
static int
-smp_fetch_url32_src(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_url32_src(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct chunk *temp;
- struct session *sess = strm_sess(strm);
struct connection *cli_conn = objt_conn(sess->origin);
- if (!smp_fetch_url32(px, strm, opt, args, smp, kw, private))
+ if (!smp_fetch_url32(px, sess, strm, opt, args, smp, kw, private))
return 0;
temp = get_trash_chunk();
enum acl_test_res ret = ACL_TEST_PASS;
if (rule->cond) {
- ret = acl_exec_cond(rule->cond, s->be, s, SMP_OPT_DIR_REQ | partial);
+ ret = acl_exec_cond(rule->cond, s->be, sess, s, SMP_OPT_DIR_REQ | partial);
if (ret == ACL_TEST_MISS)
goto missing_data;
continue;
t = rule->act_prm.trk_ctr.table.t;
- key = stktable_fetch_key(t, s->be, s, SMP_OPT_DIR_REQ | partial, rule->act_prm.trk_ctr.expr, &smp);
+ key = stktable_fetch_key(t, s->be, sess, s, SMP_OPT_DIR_REQ | partial, rule->act_prm.trk_ctr.expr, &smp);
if ((smp.flags & SMP_F_MAY_CHANGE) && !(partial & SMP_OPT_FINAL))
goto missing_data; /* key might appear later */
char **cap = s->req_cap;
int len;
- key = sample_fetch_string(s->be, s, SMP_OPT_DIR_REQ | partial, rule->act_prm.cap.expr);
+ key = sample_fetch_string(s->be, sess, s, SMP_OPT_DIR_REQ | partial, rule->act_prm.cap.expr);
if (!key)
continue;
enum acl_test_res ret = ACL_TEST_PASS;
if (rule->cond) {
- ret = acl_exec_cond(rule->cond, s->be, s, SMP_OPT_DIR_RES | partial);
+ ret = acl_exec_cond(rule->cond, s->be, sess, s, SMP_OPT_DIR_RES | partial);
if (ret == ACL_TEST_MISS) {
/* just set the analyser timeout once at the beginning of the response */
if (!tick_isset(rep->analyse_exp) && s->be->tcp_rep.inspect_delay)
ret = ACL_TEST_PASS;
if (rule->cond) {
- ret = acl_exec_cond(rule->cond, sess->fe, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(rule->cond, sess->fe, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (rule->cond->pol == ACL_COND_UNLESS)
ret = !ret;
continue;
t = rule->act_prm.trk_ctr.table.t;
- key = stktable_fetch_key(t, s->be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->act_prm.trk_ctr.expr, NULL);
+ key = stktable_fetch_key(t, s->be, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->act_prm.trk_ctr.expr, NULL);
if (key && (ts = stktable_get_entry(t, key)))
stream_track_stkctr(&s->stkctr[tcp_trk_idx(rule->action)], t, ts);
/* fetch the connection's source IPv4/IPv6 address */
static int
-smp_fetch_src(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_src(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *cli_conn = objt_conn(sess->origin);
if (!cli_conn)
/* set temp integer to the connection's source port */
static int
-smp_fetch_sport(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sport(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *k, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *cli_conn = objt_conn(sess->origin);
if (!cli_conn)
/* fetch the connection's destination IPv4/IPv6 address */
static int
-smp_fetch_dst(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_dst(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *cli_conn = objt_conn(sess->origin);
if (!cli_conn)
/* set temp integer to the frontend connexion's destination port */
static int
-smp_fetch_dport(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_dport(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *cli_conn = objt_conn(sess->origin);
if (!cli_conn)
* smp 1 0 Present, may change (eg: request length)
* smp 1 1 Present, last known value (eg: request length)
*/
-struct sample *sample_process(struct proxy *px, struct stream *strm, unsigned int opt,
+struct sample *sample_process(struct proxy *px, struct session *sess,
+ struct stream *strm, unsigned int opt,
struct sample_expr *expr, struct sample *p)
{
struct sample_conv_expr *conv_expr;
memset(p, 0, sizeof(*p));
}
- if (!expr->fetch->process(px, strm, opt, expr->arg_p, p, expr->fetch->kw, expr->fetch->private))
+ if (!expr->fetch->process(px, sess, strm, opt, expr->arg_p, p, expr->fetch->kw, expr->fetch->private))
return NULL;
list_for_each_entry(conv_expr, &expr->conv_exprs, list) {
* smp 1 0 Not present yet, may appear later (eg: header)
* smp 1 1 never happens (either flag is cleared on output)
*/
-struct sample *sample_fetch_string(struct proxy *px, struct stream *strm,
- unsigned int opt, struct sample_expr *expr)
+struct sample *sample_fetch_string(struct proxy *px, struct session *sess,
+ struct stream *strm, unsigned int opt,
+ struct sample_expr *expr)
{
struct sample *smp = &temp_smp;
memset(smp, 0, sizeof(*smp));
- if (!sample_process(px, strm, opt, expr, smp)) {
+ if (!sample_process(px, sess, strm, opt, expr, smp)) {
if ((smp->flags & SMP_F_MAY_CHANGE) && !(opt & SMP_OPT_FINAL))
return smp;
return NULL;
/* force TRUE to be returned at the fetch level */
static int
-smp_fetch_true(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_true(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
/* force FALSE to be returned at the fetch level */
static int
-smp_fetch_false(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_false(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
/* retrieve environment variable $1 as a string */
static int
-smp_fetch_env(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_env(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
char *env;
* of args[0] seconds.
*/
static int
-smp_fetch_date(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_date(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->data.uint = date.tv_sec;
/* returns the number of processes */
static int
-smp_fetch_nbproc(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_nbproc(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_UINT;
/* returns the number of the current process (between 1 and nbproc */
static int
-smp_fetch_proc(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_proc(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_UINT;
* range specified in argument.
*/
static int
-smp_fetch_rand(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_rand(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->data.uint = random();
/* returns true if the current process is stopping */
static int
-smp_fetch_stopping(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_stopping(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->type = SMP_T_BOOL;
/* boolean, returns true if client cert was present */
static int
-smp_fetch_ssl_fc_has_crt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_has_crt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *conn;
- struct session *sess = strm_sess(strm);
conn = objt_conn(sess->origin);
if (!conn || conn->xprt != &ssl_sock)
* should be use.
*/
static int
-smp_fetch_ssl_x_der(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_der(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
int ret = 0;
struct chunk *smp_trash;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_serial(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_serial(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
int ret = 0;
struct chunk *smp_trash;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_sha1(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_sha1(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
const EVP_MD *digest;
int ret = 0;
struct chunk *smp_trash;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_notafter(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_notafter(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
int ret = 0;
struct chunk *smp_trash;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_i_dn(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_i_dn(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509_NAME *name;
int ret = 0;
struct chunk *smp_trash;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_notbefore(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_notbefore(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt = NULL;
int ret = 0;
struct chunk *smp_trash;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_s_dn(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_s_dn(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509_NAME *name;
int ret = 0;
struct chunk *smp_trash;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
/* integer, returns true if current session use a client certificate */
static int
-smp_fetch_ssl_c_used(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_c_used(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
X509 *crt;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_version(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_version(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_sig_alg(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_sig_alg(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt;
int nid;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* should be use.
*/
static int
-smp_fetch_ssl_x_key_alg(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_x_key_alg(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int cert_peer = (kw[4] == 'c') ? 1 : 0;
X509 *crt;
int nid;
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* char is 'b'.
*/
static int
-smp_fetch_ssl_fc(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
/* boolean, returns true if client present a SNI */
static int
-smp_fetch_ssl_fc_has_sni(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_has_sni(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
- struct session *sess = strm_sess(l4);
struct connection *conn = objt_conn(sess->origin);
smp->type = SMP_T_BOOL;
* char is 'b'.
*/
static int
-smp_fetch_ssl_fc_cipher(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_cipher(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
* char is 'b'.
*/
static int
-smp_fetch_ssl_fc_alg_keysize(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_alg_keysize(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
* char is 'b'.
*/
static int
-smp_fetch_ssl_fc_use_keysize(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_use_keysize(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
#ifdef OPENSSL_NPN_NEGOTIATED
static int
-smp_fetch_ssl_fc_npn(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_npn(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *conn;
- struct session *sess = strm_sess(l4);
smp->flags = SMP_F_CONST;
smp->type = SMP_T_STR;
#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
static int
-smp_fetch_ssl_fc_alpn(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_alpn(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
struct connection *conn;
- struct session *sess = strm_sess(l4);
smp->flags = SMP_F_CONST;
smp->type = SMP_T_STR;
* char is 'b'.
*/
static int
-smp_fetch_ssl_fc_protocol(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_protocol(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
int back_conn = (kw[4] == 'b') ? 1 : 0;
* char is 'b'.
*/
static int
-smp_fetch_ssl_fc_session_id(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_session_id(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
#if OPENSSL_VERSION_NUMBER > 0x0090800fL
int back_conn = (kw[4] == 'b') ? 1 : 0;
- SSL_SESSION *sess;
+ SSL_SESSION *ssl_sess;
struct connection *conn;
smp->flags = SMP_F_CONST;
if (!conn || !conn->xprt_ctx || conn->xprt != &ssl_sock)
return 0;
- sess = SSL_get_session(conn->xprt_ctx);
- if (!sess)
+ ssl_sess = SSL_get_session(conn->xprt_ctx);
+ if (!ssl_sess)
return 0;
- smp->data.str.str = (char *)SSL_SESSION_get_id(sess, (unsigned int *)&smp->data.str.len);
+ smp->data.str.str = (char *)SSL_SESSION_get_id(ssl_sess, (unsigned int *)&smp->data.str.len);
if (!smp->data.str.str || !&smp->data.str.len)
return 0;
}
static int
-smp_fetch_ssl_fc_sni(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_sni(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
struct connection *conn;
- struct session *sess = strm_sess(l4);
smp->flags = SMP_F_CONST;
smp->type = SMP_T_STR;
}
static int
-smp_fetch_ssl_fc_unique_id(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_fc_unique_id(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
#if OPENSSL_VERSION_NUMBER > 0x0090800fL
/* integer, returns the first verify error in CA chain of client certificate chain. */
static int
-smp_fetch_ssl_c_ca_err(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_c_ca_err(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
/* integer, returns the depth of the first verify error in CA chain of client certificate chain. */
static int
-smp_fetch_ssl_c_ca_err_depth(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_c_ca_err_depth(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
/* integer, returns the first verify error on client certificate */
static int
-smp_fetch_ssl_c_err(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_c_err(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
/* integer, returns the verify result on client cert */
static int
-smp_fetch_ssl_c_verify(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_ssl_c_verify(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *conn;
conn = objt_conn(sess->origin);
* smp 1 0 not possible
* smp 1 1 Present, last known value (eg: request length)
*/
-struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px, struct stream *strm,
+struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px, struct session *sess, struct stream *strm,
unsigned int opt, struct sample_expr *expr, struct sample *smp)
{
if (smp)
memset(smp, 0, sizeof(*smp));
- smp = sample_process(px, strm, opt, expr, smp);
+ smp = sample_process(px, sess, strm, opt, expr, smp);
if (!smp)
return NULL;
static int process_switching_rules(struct stream *s, struct channel *req, int an_bit)
{
struct persist_rule *prst_rule;
- struct proxy *fe = strm_sess(s)->fe;
+ struct session *sess = s->sess;
+ struct proxy *fe = sess->fe;
req->analysers &= ~an_bit;
req->analyse_exp = TICK_ETERNITY;
int ret = 1;
if (rule->cond) {
- ret = acl_exec_cond(rule->cond, fe, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(rule->cond, fe, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (rule->cond->pol == ACL_COND_UNLESS)
ret = !ret;
int ret = 1;
if (prst_rule->cond) {
- ret = acl_exec_cond(prst_rule->cond, s->be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(prst_rule->cond, s->be, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (prst_rule->cond->pol == ACL_COND_UNLESS)
ret = !ret;
static int process_server_rules(struct stream *s, struct channel *req, int an_bit)
{
struct proxy *px = s->be;
+ struct session *sess = s->sess;
struct server_rule *rule;
DPRINTF(stderr,"[%u] %s: stream=%p b=%p, exp(r,w)=%u,%u bf=%08x bl=%d analysers=%02x\n",
list_for_each_entry(rule, &px->server_rules, list) {
int ret;
- ret = acl_exec_cond(rule->cond, s->be, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(rule->cond, s->be, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (rule->cond->pol == ACL_COND_UNLESS)
ret = !ret;
static int process_sticking_rules(struct stream *s, struct channel *req, int an_bit)
{
struct proxy *px = s->be;
+ struct session *sess = s->sess;
struct sticking_rule *rule;
DPRINTF(stderr,"[%u] %s: stream=%p b=%p, exp(r,w)=%u,%u bf=%08x bh=%d analysers=%02x\n",
continue;
if (rule->cond) {
- ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
+ ret = acl_exec_cond(rule->cond, px, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (rule->cond->pol == ACL_COND_UNLESS)
ret = !ret;
if (ret) {
struct stktable_key *key;
- key = stktable_fetch_key(rule->table.t, px, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->expr, NULL);
+ key = stktable_fetch_key(rule->table.t, px, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, rule->expr, NULL);
if (!key)
continue;
static int process_store_rules(struct stream *s, struct channel *rep, int an_bit)
{
struct proxy *px = s->be;
+ struct session *sess = s->sess;
struct sticking_rule *rule;
int i;
int nbreq = s->store_count;
continue;
if (rule->cond) {
- ret = acl_exec_cond(rule->cond, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
+ ret = acl_exec_cond(rule->cond, px, sess, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL);
ret = acl_pass(ret);
if (rule->cond->pol == ACL_COND_UNLESS)
ret = !ret;
if (ret) {
struct stktable_key *key;
- key = stktable_fetch_key(rule->table.t, px, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL, rule->expr, NULL);
+ key = stktable_fetch_key(rule->table.t, px, sess, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL, rule->expr, NULL);
if (!key)
continue;
* multiple tables).
*/
struct stkctr *
-smp_fetch_sc_stkctr(struct stream *l4, const struct arg *args, const char *kw)
+smp_fetch_sc_stkctr(struct session *sess, struct stream *strm, const struct arg *args, const char *kw)
{
- struct session *sess = strm_sess(l4);
static struct stkctr stkctr;
struct stksess *stksess;
unsigned int num = kw[2] - '0';
* the sc[0-9]_ form, or even higher using sc_(num) if needed.
* args[arg] is the first optional argument.
*/
- stksess = stkctr_entry(&l4->stkctr[num]);
+ stksess = stkctr_entry(&strm->stkctr[num]);
if (!stksess)
return NULL;
stkctr_set_entry(&stkctr, stktable_lookup(stkctr.table, stksess));
return &stkctr;
}
- return &l4->stkctr[num];
+ return &strm->stkctr[num];
}
/* set return a boolean indicating if the requested stream counter is
* Supports being called as "sc[0-9]_tracked" only.
*/
static int
-smp_fetch_sc_tracked(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_tracked(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
smp->type = SMP_T_BOOL;
- smp->data.uint = !!smp_fetch_sc_stkctr(strm, args, kw);
+ smp->data.uint = !!smp_fetch_sc_stkctr(sess, strm, args, kw);
return 1;
}
* zero is returned if the key is new.
*/
static int
-smp_fetch_sc_get_gpc0(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_get_gpc0(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* Value zero is returned if the key is new.
*/
static int
-smp_fetch_sc_gpc0_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_gpc0_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* Supports being called as "sc[0-9]_inc_gpc0" or "src_inc_gpc0" only.
*/
static int
-smp_fetch_sc_inc_gpc0(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_inc_gpc0(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* Supports being called as "sc[0-9]_clr_gpc0" or "src_clr_gpc0" only.
*/
static int
-smp_fetch_sc_clr_gpc0(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_clr_gpc0(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "src_conn_cnt" only.
*/
static int
-smp_fetch_sc_conn_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_conn_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* only.
*/
static int
-smp_fetch_sc_conn_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_conn_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* Accepts exactly 1 argument of type table.
*/
static int
-smp_fetch_src_updt_conn_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_src_updt_conn_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct session *sess = strm_sess(strm);
struct connection *conn = objt_conn(sess->origin);
struct stksess *ts;
struct stktable_key *key;
* "src_conn_cur" only.
*/
static int
-smp_fetch_sc_conn_cur(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_conn_cur(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "src_sess_cnt" only.
*/
static int
-smp_fetch_sc_sess_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_sess_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* Supports being called as "sc[0-9]_sess_rate" or "src_sess_rate" only.
*/
static int
-smp_fetch_sc_sess_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_sess_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "src_http_req_cnt" only.
*/
static int
-smp_fetch_sc_http_req_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_http_req_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "src_http_req_rate" only.
*/
static int
-smp_fetch_sc_http_req_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_http_req_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "src_http_err_cnt" only.
*/
static int
-smp_fetch_sc_http_err_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_http_err_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "src_http_err_rate" only.
*/
static int
-smp_fetch_sc_http_err_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_http_err_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "sc[0-9]_kbytes_in" or "src_kbytes_in" only.
*/
static int
-smp_fetch_sc_kbytes_in(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_kbytes_in(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "sc[0-9]_bytes_in_rate" or "src_bytes_in_rate" only.
*/
static int
-smp_fetch_sc_bytes_in_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_bytes_in_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "sc[0-9]_kbytes_out" or "src_kbytes_out" only.
*/
static int
-smp_fetch_sc_kbytes_out(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_kbytes_out(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* "sc[0-9]_bytes_out_rate" or "src_bytes_out_rate" only.
*/
static int
-smp_fetch_sc_bytes_out_rate(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_bytes_out_rate(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* tracked frontend counters. Supports being called as "sc[0-9]_trackers" only.
*/
static int
-smp_fetch_sc_trackers(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_sc_trackers(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
- struct stkctr *stkctr = smp_fetch_sc_stkctr(strm, args, kw);
+ struct stkctr *stkctr = smp_fetch_sc_stkctr(sess, strm, args, kw);
if (!stkctr)
return 0;
* Accepts exactly 1 argument of type table.
*/
static int
-smp_fetch_table_cnt(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_table_cnt(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
smp->flags = SMP_F_VOL_TEST;
* Accepts exactly 1 argument of type table.
*/
static int
-smp_fetch_table_avl(struct proxy *px, struct stream *strm, unsigned int opt,
+smp_fetch_table_avl(struct proxy *px, struct session *sess, struct stream *strm, unsigned int opt,
const struct arg *args, struct sample *smp, const char *kw, void *private)
{
px = args->data.prx;