struct meth meth; /* used for http method */
} data; /* sample data */
union smp_ctx ctx;
+
+ /* Some sample analyzer (sample-fetch or converters) needs to
+ * known the attached proxy, session and stream. The sample-fetches
+ * and the converters function pointers cannot be called without
+ * these 3 pointers filled.
+ */
+ struct proxy *px;
+ struct session *sess;
+ struct stream *strm;
};
/* Used to store sample constant */
memset(&smp, 0, sizeof(smp));
/* Run the sample fetch process. */
+ smp.px = hsmp->p;
+ smp.sess = hsmp->s->sess;
+ smp.strm = hsmp->s;
if (!f->process(hsmp->p, hsmp->s->sess, hsmp->s, 0, args, &smp, f->kw, f->private)) {
if (hsmp->stringsafe)
lua_pushstring(L, "");
}
/* Run the sample conversion process. */
+ smp.px = hsmp->p;
+ smp.sess = hsmp->s->sess;
+ smp.strm = hsmp->s;
if (!conv->process(hsmp->s, args, &smp, conv->private)) {
if (hsmp->stringsafe)
lua_pushstring(L, "");
memset(p, 0, sizeof(*p));
}
+ p->px = px;
+ p->sess = sess;
+ p->strm = strm;
if (!expr->fetch->process(px, sess, strm, opt, expr->arg_p, p, expr->fetch->kw, expr->fetch->private))
return NULL;