#define HLUA_NOYIELD 0x00000020
#define HLUA_BUSY 0x00000040
-#define HLUA_F_AS_STRING 0x01
-#define HLUA_F_MAY_USE_HTTP 0x02
+#define HLUA_F_AS_STRING 0x01
+#define HLUA_F_MAY_USE_CHANNELS_DATA 0x02
/* HLUA TXN flags */
#define HLUA_TXN_NOTERM 0x00000001
hsmp = MAY_LJMP(hlua_checkfetches(L, 1));
/* Check execution authorization. */
- if (f->use & SMP_USE_HTTP_ANY &&
- !(hsmp->flags & HLUA_F_MAY_USE_HTTP)) {
- lua_pushfstring(L, "the sample-fetch '%s' needs an HTTP parser which "
- "is not available in Lua services", f->kw);
+ if ((f->use & (SMP_USE_L6REQ|SMP_USE_L6RES|SMP_USE_HTTP_ANY)) &&
+ !(hsmp->flags & HLUA_F_MAY_USE_CHANNELS_DATA)) {
+ lua_pushfstring(L, "the sample-fetch '%s' needs to access data from channel's buffer which"
+ " is not available in Lua services", f->kw);
WILL_LJMP(lua_error(L));
}
/* Create the "f" field that contains a list of fetches. */
lua_pushstring(L, "f");
- if (!hlua_fetches_new(L, htxn, HLUA_F_MAY_USE_HTTP))
+ if (!hlua_fetches_new(L, htxn, HLUA_F_MAY_USE_CHANNELS_DATA))
return 0;
lua_rawset(L, -3);
/* Create the "sf" field that contains a list of stringsafe fetches. */
lua_pushstring(L, "sf");
- if (!hlua_fetches_new(L, htxn, HLUA_F_MAY_USE_HTTP | HLUA_F_AS_STRING))
+ if (!hlua_fetches_new(L, htxn, HLUA_F_MAY_USE_CHANNELS_DATA | HLUA_F_AS_STRING))
return 0;
lua_rawset(L, -3);