diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-23 13:45:19 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-23 13:45:19 +0100 |
commit | adecd4884dab63de2a43406467155f92dde6a358 (patch) | |
tree | 656a7c6080a0832f8677ad8de96c4dfab4afa2c5 | |
parent | f4bf42266b6fc8e2e994e5fdbbb8f0d60a4808d9 (diff) | |
download | rspamd-adecd4884dab63de2a43406467155f92dde6a358.tar.gz rspamd-adecd4884dab63de2a43406467155f92dde6a358.zip |
[Minor] Allow to parse GString memory pool vars
-rw-r--r-- | src/lua/lua_mempool.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lua/lua_mempool.c b/src/lua/lua_mempool.c index 15d0e6897..38482748f 100644 --- a/src/lua/lua_mempool.c +++ b/src/lua/lua_mempool.c @@ -374,6 +374,12 @@ lua_mempool_get_variable (lua_State *L) lua_pushlstring (L, (const gchar *)pv, slen); pv += slen + 1; } + else if (len == sizeof ("gstring") - 1 && + g_ascii_strncasecmp (pt, "gstring", len) == 0) { + GString *st = (GString *)pv; + lua_pushlstring (L, st->str, st->len); + pv += sizeof (GString *); + } else { msg_err ("unknown type for get_variable: %s", pt); lua_pushnil (L); |