diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-27 15:33:04 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-27 15:33:04 +0000 |
commit | 2623065a8f9441f78c33466f847df77807a31230 (patch) | |
tree | 3c00698f7f1f5746881b9494c7a4d879051ed895 /src/lua/lua_map.c | |
parent | 67baaadfa3556aa4bd257a7c52e5cd5eedfbade1 (diff) | |
download | rspamd-2623065a8f9441f78c33466f847df77807a31230.tar.gz rspamd-2623065a8f9441f78c33466f847df77807a31230.zip |
[Fix] Fix opaque maps logic
Diffstat (limited to 'src/lua/lua_map.c')
-rw-r--r-- | src/lua/lua_map.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lua/lua_map.c b/src/lua/lua_map.c index b279bacbd..a5defd011 100644 --- a/src/lua/lua_map.c +++ b/src/lua/lua_map.c @@ -444,13 +444,14 @@ lua_map_fin (struct map_cb_data *data, void **target) else if (cbdata->data != NULL && cbdata->data->len != 0) { lua_rawgeti (cbdata->L, LUA_REGISTRYINDEX, cbdata->ref); - if (cbdata->opaque) { + if (!cbdata->opaque) { lua_pushlstring (cbdata->L, cbdata->data->str, cbdata->data->len); } else { struct rspamd_lua_text *t; t = lua_newuserdata (cbdata->L, sizeof (*t)); + rspamd_lua_setclass (cbdata->L, "rspamd{text}", -1); t->flags = 0; t->len = cbdata->data->len; t->start = cbdata->data->str; |