aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/task.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-06-17 15:20:27 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-06-17 15:20:27 +0100
commit63e72fc5d4f6712fb4ad41659f8189500386546d (patch)
treecbb8e8d5bb47929e80fbb8a34e0a1420c1f099f0 /src/libserver/task.h
parentdc5d99e5cf918d594f52dfce7c7250eb1da8c766 (diff)
downloadrspamd-63e72fc5d4f6712fb4ad41659f8189500386546d.tar.gz
rspamd-63e72fc5d4f6712fb4ad41659f8189500386546d.zip
[Minor] Get rid of one more GHashTable
Diffstat (limited to 'src/libserver/task.h')
-rw-r--r--src/libserver/task.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libserver/task.h b/src/libserver/task.h
index d0169d896..3a4d24187 100644
--- a/src/libserver/task.h
+++ b/src/libserver/task.h
@@ -155,7 +155,14 @@ struct rspamd_request_header_chain {
struct rspamd_request_header_chain *next;
};
-__KHASH_TYPE (rspamd_req_headers_hash, rspamd_ftok_t *, struct rspamd_request_header_chain *)
+__KHASH_TYPE (rspamd_req_headers_hash, rspamd_ftok_t *, struct rspamd_request_header_chain *);
+
+struct rspamd_lua_cached_entry {
+ gint ref;
+ guint id;
+};
+
+KHASH_INIT(rspamd_task_lua_cache, char *, struct rspamd_lua_cached_entry, 1, kh_str_hash_func, kh_str_hash_equal);
/**
* Worker task structure
@@ -180,7 +187,7 @@ struct rspamd_task {
struct rspamd_http_connection *http_conn; /**< HTTP server connection */
struct rspamd_async_session *s; /**< async session object */
struct rspamd_scan_result *result; /**< Metric result */
- GHashTable *lua_cache; /**< cache of lua objects */
+ khash_t(rspamd_task_lua_cache) lua_cache; /**< cache of lua objects */
GPtrArray *tokens; /**< statistics tokens */
GArray *meta_words; /**< rspamd_stat_token_t produced from meta headers
(e.g. Subject) */