mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-31 02:22:07 +00:00
MINOR: sample: fill the struct sample with the options.
Options are relative to the sample. Each sample fetched is associated with fetch options or fetch flags. This patch adds the 'opt' vaue in the sample struct. This permits to reduce the sample-fetch function prototype. In other way, the converters will have more detail about the origin of the sample.
This commit is contained in:
parent
0a9a2b8cec
commit
1d33b882d2
@ -252,6 +252,7 @@ struct sample {
|
||||
struct proxy *px;
|
||||
struct session *sess;
|
||||
struct stream *strm;
|
||||
unsigned int opt; /* fetch options (SMP_OPT_*) */
|
||||
};
|
||||
|
||||
/* Used to store sample constant */
|
||||
|
@ -2773,6 +2773,7 @@ __LJMP static int hlua_run_sample_fetch(lua_State *L)
|
||||
smp.px = hsmp->p;
|
||||
smp.sess = hsmp->s->sess;
|
||||
smp.strm = hsmp->s;
|
||||
smp.opt = 0;
|
||||
if (!f->process(0, args, &smp, f->kw, f->private)) {
|
||||
if (hsmp->stringsafe)
|
||||
lua_pushstring(L, "");
|
||||
@ -2894,6 +2895,7 @@ __LJMP static int hlua_run_sample_conv(lua_State *L)
|
||||
smp.px = hsmp->p;
|
||||
smp.sess = hsmp->s->sess;
|
||||
smp.strm = hsmp->s;
|
||||
smp.opt = 0;
|
||||
if (!conv->process(args, &smp, conv->private)) {
|
||||
if (hsmp->stringsafe)
|
||||
lua_pushstring(L, "");
|
||||
|
@ -1036,6 +1036,7 @@ struct sample *sample_process(struct proxy *px, struct session *sess,
|
||||
p->px = px;
|
||||
p->sess = sess;
|
||||
p->strm = strm;
|
||||
p->opt = opt;
|
||||
if (!expr->fetch->process(opt, expr->arg_p, p, expr->fetch->kw, expr->fetch->private))
|
||||
return NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user