MEDIUM: sample: fill the struct sample with the session, proxy and stream pointers
Some sample analyzer (sample-fetch or converters) needs to known the proxy,
session and stream attached to the sampel. The sample-fetches and the converters
function pointers cannot be called without these 3 pointers filled.
This patch permits to reduce the sample-fetch and the converters called
prototypes, and provides a new mean to add information for this type of
functions.
diff --git a/src/hlua.c b/src/hlua.c
index 37fce89..d0eb7f5 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2770,6 +2770,9 @@
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, "");
@@ -2888,6 +2891,9 @@
}
/* 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, "");