OPTION(ENABLE_UTILS "Build rspamd internal utils [default: OFF]" OFF)
OPTION(ENABLE_TORCH "Install torch7 with Rspamd [default: ON]" ON)
OPTION(ENABLE_LIBUNWIND "Use libunwind to print crash traces [default: OFF]" OFF)
+OPTION(ENABLE_LUA_TRACE "Trace all Lua C API invocations [default: OFF]" OFF)
INCLUDE(FindArch.cmake)
TARGET_ARCHITECTURE(ARCH)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
ENDIF(ENABLE_COVERAGE)
+IF(ENABLE_LUA_TRACE)
+ SET(WITH_LUA_TRACE 1)
+ENDIF(ENABLE_LUA_TRACE)
+
SET(CMAKE_C_FLAGS "${CMAKE_C_OPT_FLAGS} ${CMAKE_C_FLAGS} ${CMAKE_C_WARN_FLAGS}")
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
#cmakedefine WITH_SYSTEM_HIREDIS 1
#cmakedefine WITH_TORCH 1
#cmakedefine WITH_LIBUNWIND 1
+#cmakedefine WITH_LUA_TRACE 1
#cmakedefine DISABLE_PTHREAD_MUTEX 1
/* Lua module init function */
#define MODULE_INIT_FUNC "module_init"
+#ifdef WITH_LUA_TRACE
+ucl_object_t *lua_traces;
+#endif
+
const luaL_reg null_reg[] = {
{"__tostring", rspamd_lua_class_tostring},
{NULL, NULL}
#define RSPAMD_PREFIX_INDEX "PREFIX"
#define RSPAMD_VERSION_INDEX "VERSION"
+#ifdef WITH_LUA_TRACE
+extern ucl_object_t *lua_traces;
+#define LUA_TRACE_POINT do { \
+ ucl_object_t *func_obj; \
+ if (lua_traces == NULL) { lua_traces = ucl_object_typed_new (UCL_OBJECT); } \
+ func_obj = (ucl_object_t *)ucl_object_lookup (lua_traces, G_STRFUNC); \
+ if (func_obj == NULL) { \
+ func_obj = ucl_object_typed_new (UCL_INT); \
+ ucl_object_insert_key (lua_traces, func_obj, G_STRFUNC, 0, false); \
+ } \
+ func_obj->value.iv ++; \
+} while(0)
+#else
+#define LUA_TRACE_POINT
+#endif
+
#endif /* WITH_LUA */
#endif /* RSPAMD_LUA_H */
static gint
lua_config_get_module_opt (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *mname, *optname;
const ucl_object_t *obj;
static int
lua_config_get_mempool (lua_State * L)
{
+ LUA_TRACE_POINT;
rspamd_mempool_t **ppool;
struct rspamd_config *cfg = lua_check_config (L, 1);
static int
lua_config_get_resolver (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_dns_resolver **pres;
struct rspamd_config *cfg = lua_check_config (L, 1);
static gint
lua_config_get_all_opt (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *mname;
const ucl_object_t *obj, *cur, *cur_elt;
static gint
lua_config_get_ucl (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_lua_cached_config *cached;
static gint
lua_config_get_classifier (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_classifier_config *clc = NULL, **pclc = NULL;
const gchar *name;
static gint
lua_config_register_post_filter (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
gint order = 0, cbref, ret;
static gint
lua_config_register_pre_filter (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
gint order = 0, cbref, ret;
static gint
lua_config_get_key (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *name;
size_t namelen;
static gint
lua_config_register_symbol (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *name = NULL, *flags_str = NULL, *type_str = NULL,
*description = NULL, *group = NULL;
static gint
lua_config_register_symbols (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
gint i, top, idx, ret = -1;
const gchar *sym;
static gint
lua_config_register_virtual_symbol (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *name;
double weight;
static gint
lua_config_register_callback_symbol (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *name = NULL;
double weight;
static gint
lua_config_register_callback_symbol_priority (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *name = NULL;
double weight;
static gint
lua_config_register_dependency (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *parent = NULL, *child = NULL;
gint child_id;
static gint
lua_config_set_metric_symbol (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *description = NULL,
*group = NULL, *name = NULL, *flags_str = NULL;
static gint
lua_config_get_metric_symbol (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *sym_name = luaL_checkstring (L, 2);
struct rspamd_symbol *sym_def;
static gint
lua_config_set_metric_action (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *name = NULL;
double weight;
static gint
lua_config_get_metric_action (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *act_name = luaL_checkstring (L, 2);
gint act = 0;
static gint
lua_config_get_all_actions (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
gint act = 0;
static gint
lua_config_add_composite (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_expression *expr;
gchar *name;
static gint
lua_config_newindex (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *name;
gint id, nshots;
static gint
lua_config_add_condition (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *sym = luaL_checkstring (L, 2);
gboolean ret = FALSE;
static gint
lua_config_set_peak_cb (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
gint condref;
static gint
lua_config_enable_symbol (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *sym = luaL_checkstring (L, 2);
static gint
lua_config_disable_symbol (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *sym = luaL_checkstring (L, 2);
static gint
lua_config_register_regexp (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_lua_regexp *re = NULL;
rspamd_regexp_t *cache_re;
static gint
lua_config_replace_regexp (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_lua_regexp *old_re = NULL, *new_re = NULL;
GError *err = NULL;
static gint
lua_config_register_worker_script (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *worker_type = luaL_checkstring (L, 2), *wtype;
struct rspamd_worker_conf *cf;
static gint
lua_config_add_on_load (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_config_post_load_script *sc;
static gint
lua_config_add_periodic (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct event_base *ev_base = lua_check_ev_base (L, 2);
gdouble timeout = lua_tonumber (L, 3);
static gint
lua_config_get_symbols_count (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
guint res = 0;
static gint
lua_config_get_symbols_cksum (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
guint64 res = 0, *pres;
static gint
lua_config_get_symbols_counters (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
ucl_object_t *counters;
static gint
lua_config_get_symbols_scores (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
if (cfg != NULL) {
static gint
lua_config_get_symbol_callback (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *sym = luaL_checkstring (L, 2);
struct rspamd_abstract_callback_data *abs_cbdata;
static gint
lua_config_set_symbol_callback (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *sym = luaL_checkstring (L, 2);
struct rspamd_abstract_callback_data *abs_cbdata;
static gint
lua_config_get_symbol_stat (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *sym = luaL_checkstring (L, 2);
gdouble freq, stddev, tm;
static gint
lua_config_register_finish_script (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_config_post_load_script *sc;
static gint
lua_config_register_monitored (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_monitored *m, **pm;
const gchar *url, *type;
static gint
lua_config_add_doc (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg;
const gchar *path = NULL, *option, *doc_string;
const gchar *type_str = NULL, *default_value = NULL;
static gint
lua_config_add_example (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg;
const gchar *path = NULL, *option, *doc_string, *example;
gsize example_len;
static gint
lua_config_get_cpu_flags (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_cryptobox_library_ctx *crypto_ctx;
static gint
lua_config_has_torch (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_cryptobox_library_ctx *crypto_ctx;
static gint
lua_config_experimental_enabled (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
if (cfg != NULL) {
static gint
lua_config_parse_rcl (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
GHashTable *excluded = g_hash_table_new_full (rspamd_str_hash, rspamd_str_equal,
g_free, NULL);
static gint
lua_config_init_modules (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
if (cfg != NULL) {
static gint
lua_config_init_subsystem (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *subsystem = luaL_checkstring (L, 2);
gchar **parts;
static gint
lua_config_get_tld_path (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
if (cfg != NULL) {
static gint
lua_monitored_alive (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_monitored *m = lua_check_monitored (L, 1);
if (m) {
static gint
lua_monitored_offline (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_monitored *m = lua_check_monitored (L, 1);
if (m) {
static gint
lua_monitored_total_offline (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_monitored *m = lua_check_monitored (L, 1);
if (m) {
static gint
lua_monitored_latency (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_monitored *m = lua_check_monitored (L, 1);
if (m) {
static gint
lua_cryptobox_pubkey_load (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_pubkey *pkey = NULL, **ppkey;
const gchar *filename, *arg;
gint type = RSPAMD_KEYPAIR_SIGN;
static gint
lua_cryptobox_pubkey_create (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_pubkey *pkey = NULL, **ppkey;
const gchar *buf, *arg;
gsize len;
static gint
lua_cryptobox_pubkey_gc (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_pubkey *pkey = lua_check_cryptobox_pubkey (L, 1);
if (pkey != NULL) {
static gint
lua_cryptobox_keypair_load (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp, **pkp;
const gchar *buf;
gsize len;
static gint
lua_cryptobox_keypair_create (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp, **pkp;
enum rspamd_cryptobox_keypair_type type = RSPAMD_KEYPAIR_KEX;
enum rspamd_cryptobox_mode alg = RSPAMD_CRYPTOBOX_MODE_25519;
static gint
lua_cryptobox_keypair_gc (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp = lua_check_cryptobox_keypair (L, 1);
if (kp != NULL) {
static gint
lua_cryptobox_keypair_totable (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp = lua_check_cryptobox_keypair (L, 1);
ucl_object_t *obj;
gboolean hex = FALSE;
static gint
lua_cryptobox_keypair_get_type (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp = lua_check_cryptobox_keypair (L, 1);
if (kp) {
static gint
lua_cryptobox_keypair_get_alg (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp = lua_check_cryptobox_keypair (L, 1);
if (kp) {
static gint
lua_cryptobox_keypair_get_pk (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp = lua_check_cryptobox_keypair (L, 1);
struct rspamd_cryptobox_pubkey *pk, **ppk;
const guchar *data;
static gint
lua_cryptobox_signature_load (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_fstring_t *sig, **psig;
const gchar *filename;
gpointer data;
static gint
lua_cryptobox_signature_save (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_fstring_t *sig;
gint fd, flags;
const gchar *filename;
static gint
lua_cryptobox_signature_create (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_fstring_t *sig, **psig;
struct rspamd_lua_text *t;
const gchar *data;
static gint
lua_cryptobox_signature_hex (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_fstring_t *sig = lua_check_cryptobox_sign (L, 1);
gchar *encoded;
static gint
lua_cryptobox_signature_base32 (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_fstring_t *sig = lua_check_cryptobox_sign (L, 1);
gchar *encoded;
static gint
lua_cryptobox_signature_base64 (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_fstring_t *sig = lua_check_cryptobox_sign (L, 1);
gsize dlen;
gchar *encoded;
static gint
lua_cryptobox_signature_bin (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_fstring_t *sig = lua_check_cryptobox_sign (L, 1);
if (sig) {
static gint
lua_cryptobox_signature_gc (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_fstring_t *sig = lua_check_cryptobox_sign (L, 1);
rspamd_fstring_free (sig);
static gint
lua_cryptobox_hash_create (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h, **ph;
const gchar *s = NULL;
struct rspamd_lua_text *t;
static gint
lua_cryptobox_hash_create_specific (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h, **ph;
const gchar *s = NULL, *type = luaL_checkstring (L, 1);
gsize len = 0;
static gint
lua_cryptobox_hash_create_keyed (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h, **ph;
const gchar *key, *s = NULL;
struct rspamd_lua_text *t;
static gint
lua_cryptobox_hash_update (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h = lua_check_cryptobox_hash (L, 1);
const gchar *data;
struct rspamd_lua_text *t;
static gint
lua_cryptobox_hash_reset (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h = lua_check_cryptobox_hash (L, 1);
if (h) {
static gint
lua_cryptobox_hash_hex (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h = lua_check_cryptobox_hash (L, 1);
guchar out[rspamd_cryptobox_HASHBYTES],
out_hex[rspamd_cryptobox_HASHBYTES * 2 + 1];
static gint
lua_cryptobox_hash_base32 (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h = lua_check_cryptobox_hash (L, 1);
guchar out[rspamd_cryptobox_HASHBYTES],
out_b32[rspamd_cryptobox_HASHBYTES * 2];
static gint
lua_cryptobox_hash_base64 (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h = lua_check_cryptobox_hash (L, 1);
guchar out[rspamd_cryptobox_HASHBYTES], *b64;
gsize len;
static gint
lua_cryptobox_hash_bin (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h = lua_check_cryptobox_hash (L, 1);
guchar out[rspamd_cryptobox_HASHBYTES];
guint dlen;
static gint
lua_cryptobox_hash_gc (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cryptobox_hash *h = lua_check_cryptobox_hash (L, 1);
if (h->is_ssl) {
static gint
lua_cryptobox_verify_memory (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_pubkey *pk;
rspamd_fstring_t *signature;
struct rspamd_lua_text *t;
static gint
lua_cryptobox_verify_file (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *fname;
struct rspamd_cryptobox_pubkey *pk;
rspamd_fstring_t *signature;
static gint
lua_cryptobox_sign_memory (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp;
const gchar *data;
struct rspamd_lua_text *t;
static gint
lua_cryptobox_sign_file (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp;
const gchar *filename;
gchar *data;
static gint
lua_cryptobox_encrypt_memory (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp = NULL;
struct rspamd_cryptobox_pubkey *pk = NULL;
const gchar *data;
static gint
lua_cryptobox_encrypt_file (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp = NULL;
struct rspamd_cryptobox_pubkey *pk = NULL;
const gchar *filename;
static gint
lua_cryptobox_decrypt_memory (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp;
const gchar *data;
guchar *out;
static gint
lua_cryptobox_decrypt_file (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_cryptobox_keypair *kp;
const gchar *filename;
gchar *data;
enum rdns_request_type type,
int first)
{
+ LUA_TRACE_POINT;
struct rspamd_async_session *session = NULL;
rspamd_mempool_t *pool = NULL;
const gchar *to_resolve = NULL, *user_str = NULL;
static gint
lua_expr_process (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_expression *e = rspamd_lua_expression (L, 1);
gdouble res;
gint flags = 0;
static gint
lua_expr_process_traced (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_expression *e = rspamd_lua_expression (L, 1);
rspamd_expression_atom_t *atom;
gint res;
static gint
lua_expr_create (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_expression *e, **pe;
const char *line;
gsize len;
static gint
lua_expr_to_string (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_expression *e = rspamd_lua_expression (L, 1);
GString *str;
static gint
lua_expr_atoms (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_expression *e = rspamd_lua_expression (L, 1);
struct lua_expr_atoms_cbdata cbdata;
static gint
lua_html_has_tag (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_content *hc = lua_check_html (L, 1);
const gchar *tagname = luaL_checkstring (L, 2);
gboolean ret = FALSE;
static gint
lua_html_has_property (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_content *hc = lua_check_html (L, 1);
const gchar *propname = luaL_checkstring (L, 2);
gboolean ret = FALSE;
static void
lua_html_push_image (lua_State *L, struct html_image *img)
{
+ LUA_TRACE_POINT;
struct html_tag **ptag;
lua_newtable (L);
static gint
lua_html_get_images (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_content *hc = lua_check_html (L, 1);
struct html_image *img;
static void
lua_html_push_block (lua_State *L, struct html_block *bl)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t;
lua_createtable (L, 0, 6);
static gint
lua_html_get_blocks (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_content *hc = lua_check_html (L, 1);
struct html_block *bl;
static gint
lua_html_foreach_tag (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_content *hc = lua_check_html (L, 1);
struct lua_html_traverse_ud ud;
const gchar *tagname;
static gint
lua_html_tag_get_type (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_tag *tag = lua_check_html_tag (L, 1);
const gchar *tagname;
static gint
lua_html_tag_get_parent (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_tag *tag = lua_check_html_tag (L, 1), **ptag;
GNode *node;
static gint
lua_html_tag_get_flags (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_tag *tag = lua_check_html_tag (L, 1);
gint i = 1;
static gint
lua_html_tag_get_content (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_tag *tag = lua_check_html_tag (L, 1);
struct rspamd_lua_text *t;
static gint
lua_html_tag_get_content_length (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_tag *tag = lua_check_html_tag (L, 1);
if (tag) {
static gint
lua_html_tag_get_extra (lua_State *L)
{
+ LUA_TRACE_POINT;
struct html_tag *tag = lua_check_html_tag (L, 1);
struct html_image *img;
struct rspamd_url **purl;
static gint
lua_http_request (lua_State *L)
{
+ LUA_TRACE_POINT;
struct event_base *ev_base;
struct rspamd_http_message *msg;
struct lua_http_cbdata *cbd;
static gint
lua_ip_to_table (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
guint max, i;
guint8 *ptr;
static gint
lua_ip_str_octets (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
guint max, i;
guint8 *ptr;
static gint
lua_ip_inversed_str_octets (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
guint max, i;
guint8 *ptr;
static gint
lua_ip_to_string (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
if (ip != NULL && ip->addr) {
static gint
lua_ip_get_port (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
if (ip != NULL && ip->addr) {
static gint
lua_ip_from_string (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip;
const gchar *ip_str;
static gint
lua_ip_to_number (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
guint32 c;
guint max, i;
static gint
lua_ip_destroy (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
if (ip) {
static gint
lua_ip_get_version (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
if (ip && ip->addr) {
static gint
lua_ip_is_valid (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
if (ip) {
static gint
lua_ip_apply_mask (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1), *nip;
gint mask;
static gint
lua_ip_equal (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip1 = lua_check_ip (L, 1),
*ip2 = lua_check_ip (L, 2);
gboolean res = FALSE;
static gint
lua_ip_copy (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *ip = lua_check_ip (L, 1);
if (ip) {
static gint
lua_logger_err (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *msg;
msg = luaL_checkstring (L, 1);
lua_common_log_line (G_LOG_LEVEL_CRITICAL, L, msg, NULL, NULL);
static gint
lua_logger_warn (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *msg;
msg = luaL_checkstring (L, 1);
lua_common_log_line (G_LOG_LEVEL_WARNING, L, msg, NULL, NULL);
static gint
lua_logger_info (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *msg;
msg = luaL_checkstring (L, 1);
lua_common_log_line (G_LOG_LEVEL_INFO, L, msg, NULL, NULL);
static gint
lua_logger_message (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *msg;
msg = luaL_checkstring (L, 1);
lua_common_log_line (G_LOG_LEVEL_MESSAGE, L, msg, NULL, NULL);
static gint
lua_logger_debug (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *msg;
msg = luaL_checkstring (L, 1);
lua_common_log_line (G_LOG_LEVEL_DEBUG, L, msg, NULL, NULL);
static gint
lua_logger_errx (lua_State *L)
{
+ LUA_TRACE_POINT;
return lua_logger_logx (L, G_LOG_LEVEL_CRITICAL, FALSE);
}
static gint
lua_logger_warnx (lua_State *L)
{
+ LUA_TRACE_POINT;
return lua_logger_logx (L, G_LOG_LEVEL_WARNING, FALSE);
}
static gint
lua_logger_infox (lua_State *L)
{
+ LUA_TRACE_POINT;
return lua_logger_logx (L, G_LOG_LEVEL_INFO, FALSE);
}
static gint
lua_logger_messagex (lua_State *L)
{
+ LUA_TRACE_POINT;
return lua_logger_logx (L, G_LOG_LEVEL_MESSAGE, FALSE);
}
static gint
lua_logger_debugx (lua_State *L)
{
+ LUA_TRACE_POINT;
return lua_logger_logx (L, G_LOG_LEVEL_DEBUG, FALSE);
}
static gint
lua_logger_debugm (lua_State *L)
{
+ LUA_TRACE_POINT;
gchar logbuf[RSPAMD_LOGBUF_SIZE - 128];
const gchar *uid = NULL, *module = NULL;
gboolean ret;
gint
lua_config_add_radix_map (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *map_line, *description;
struct rspamd_lua_map *map, **pmap;
gint
lua_config_radix_from_config (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *mname, *optname;
const ucl_object_t *obj;
gint
lua_config_radix_from_ucl (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
ucl_object_t *obj;
struct rspamd_lua_map *map, **pmap;
gint
lua_config_add_hash_map (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *map_line, *description;
struct rspamd_lua_map *map, **pmap;
gint
lua_config_add_kv_map (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *map_line, *description;
struct rspamd_lua_map *map, **pmap;
gint
lua_config_add_map (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const char *description = NULL;
const gchar *type = NULL;
gint
lua_config_get_maps (lua_State*L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
struct rspamd_lua_map *map, **pmap;
struct rspamd_map *m;
static gint
lua_map_get_key (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
struct rspamd_radix_map_helper *radix;
struct rspamd_lua_ip *addr = NULL;
static gint
lua_map_get_stats (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
gboolean do_reset = FALSE;
static gint
lua_map_get_data_digest (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
gchar numbuf[64];
static gint
lua_map_get_nelts (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
if (map != NULL) {
static int
lua_map_is_signed (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
gboolean ret = FALSE;
struct rspamd_map_backend *bk;
static int
lua_map_get_proto (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
const gchar *ret = "undefined";
struct rspamd_map_backend *bk;
static int
lua_map_get_sign_key (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
struct rspamd_map_backend *bk;
guint i;
static int
lua_map_set_sign_key (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
struct rspamd_map_backend *bk;
const gchar *pk_str;
static int
lua_map_set_callback (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
if (!map || map->type != RSPAMD_LUA_MAP_CALLBACK || map->data.cbdata == NULL) {
static int
lua_map_get_uri (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_map *map = lua_check_map (L, 1);
const gchar *ret = "undefined";
struct rspamd_map_backend *bk;
static int
lua_mempool_create (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_mempool_new (
rspamd_mempool_suggest_size (), "lua"), **pmempool;
static int
lua_mempool_add_destructor (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
struct lua_mempool_udata *ud;
static int
lua_mempool_delete (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
if (mempool) {
static int
lua_mempool_stat (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
if (mempool) {
static int
lua_mempool_suggest_size (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
if (mempool) {
static int
lua_mempool_set_bucket (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
const gchar *var = luaL_checkstring (L, 2);
struct lua_numbers_bucket *bucket;
static int
lua_mempool_set_variable (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
const gchar *var = luaL_checkstring (L, 2);
gpointer value;
static int
lua_mempool_get_variable (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
const gchar *var = luaL_checkstring (L, 2);
const gchar *type = NULL, *pt;
static int
lua_mempool_has_variable (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
const gchar *var = luaL_checkstring (L, 2);
gboolean ret = FALSE;
static int
lua_mempool_delete_variable (lua_State *L)
{
+ LUA_TRACE_POINT;
struct memory_pool_s *mempool = rspamd_lua_check_mempool (L, 1);
const gchar *var = luaL_checkstring (L, 2);
gboolean ret = FALSE;
static gint
lua_textpart_is_utf (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part == NULL || IS_PART_EMPTY (part)) {
static gint
lua_textpart_has_8bit_raw (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part) {
static gint
lua_textpart_has_8bit (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part) {
static gint
lua_textpart_get_content (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
struct rspamd_lua_text *t;
gsize len;
static gint
lua_textpart_get_raw_content (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
struct rspamd_lua_text *t;
static gint
lua_textpart_get_content_oneline (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
struct rspamd_lua_text *t;
static gint
lua_textpart_get_length (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part == NULL) {
static gint
lua_textpart_get_raw_length (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part == NULL) {
static gint
lua_textpart_get_urls_length (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
GList *cur;
guint total = 0;
static gint
lua_textpart_get_lines_count (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part == NULL) {
static gint
lua_textpart_get_words_count (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part == NULL) {
static gint
lua_textpart_get_words (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
rspamd_stat_token_t *w;
guint i;
static gint
lua_textpart_is_empty (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part == NULL) {
static gint
lua_textpart_is_html (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part == NULL) {
static gint
lua_textpart_get_html (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
struct html_content **phc;
static gint
lua_textpart_get_language (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part != NULL) {
static gint
lua_textpart_get_languages (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
guint i;
struct rspamd_lang_detector_res *cur;
static gint
lua_textpart_get_fuzzy_hashes (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
rspamd_mempool_t *pool = rspamd_lua_check_mempool (L, 2);
guchar key[rspamd_cryptobox_HASHBYTES], digest[rspamd_cryptobox_HASHBYTES],
static gint
lua_textpart_get_mimepart (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
struct rspamd_mime_part **pmime;
static gint
lua_textpart_get_stats (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_text_part *part = lua_check_textpart (L);
if (part != NULL) {
static gint
lua_mimepart_get_content (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
struct rspamd_lua_text *t;
static gint
lua_mimepart_get_raw_content (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
struct rspamd_lua_text *t;
static gint
lua_mimepart_get_length (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
if (part == NULL) {
static gint
lua_mimepart_get_type (lua_State * L)
{
+ LUA_TRACE_POINT;
return lua_mimepart_get_type_common (L, FALSE);
}
static gint
lua_mimepart_get_type_full (lua_State * L)
{
+ LUA_TRACE_POINT;
return lua_mimepart_get_type_common (L, TRUE);
}
static gint
lua_mimepart_get_cte (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
if (part == NULL) {
static gint
lua_mimepart_get_filename (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
if (part == NULL || part->cd == NULL || part->cd->filename.len == 0) {
static gint
lua_mimepart_get_header_full (lua_State * L)
{
+ LUA_TRACE_POINT;
return lua_mimepart_get_header_common (L, RSPAMD_TASK_HEADER_PUSH_FULL);
}
static gint
lua_mimepart_get_header (lua_State * L)
{
+ LUA_TRACE_POINT;
return lua_mimepart_get_header_common (L, RSPAMD_TASK_HEADER_PUSH_SIMPLE);
}
static gint
lua_mimepart_get_header_raw (lua_State * L)
{
+ LUA_TRACE_POINT;
return lua_mimepart_get_header_common (L, RSPAMD_TASK_HEADER_PUSH_RAW);
}
static gint
lua_mimepart_get_header_count (lua_State * L)
{
+ LUA_TRACE_POINT;
return lua_mimepart_get_header_common (L, RSPAMD_TASK_HEADER_PUSH_COUNT);
}
static gint
lua_mimepart_is_image (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
if (part == NULL) {
static gint
lua_mimepart_is_archive (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
if (part == NULL) {
static gint
lua_mimepart_is_multipart (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
if (part == NULL) {
static gint
lua_mimepart_is_text (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
if (part == NULL) {
static gint
lua_mimepart_is_broken (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
if (part == NULL) {
static gint
lua_mimepart_get_image (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
struct rspamd_image **pimg;
static gint
lua_mimepart_get_archive (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
struct rspamd_archive **parch;
static gint
lua_mimepart_get_children (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
struct rspamd_mime_part **pcur, *cur;
guint i;
static gint
lua_mimepart_get_text (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
struct rspamd_mime_text_part **ppart;
static gint
lua_mimepart_get_digest (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
gchar digestbuf[rspamd_cryptobox_HASHBYTES * 2 + 1];
static gint
lua_mimepart_headers_foreach (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_mime_part *part = lua_check_mimepart (L);
enum rspamd_lua_task_header_type how = RSPAMD_TASK_HEADER_PUSH_SIMPLE;
struct rspamd_lua_regexp *re = NULL;
static int
lua_redis_make_request (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_redis_specific_userdata *sp_ud;
struct lua_redis_userdata *ud;
struct lua_redis_ctx *ctx, **pctx;
static int
lua_redis_make_request_sync (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *addr = NULL;
rspamd_inet_addr_t *ip = NULL;
const gchar *cmd = NULL, *host;
static int
lua_redis_connect (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_redis_userdata *ud;
struct lua_redis_ctx *ctx, **pctx;
gdouble timeout = REDIS_DEFAULT_TIMEOUT;
static int
lua_redis_connect_sync (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_ip *addr = NULL;
rspamd_inet_addr_t *ip = NULL;
const gchar *host;
static int
lua_redis_add_cmd (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_redis_ctx *ctx = lua_check_redis (L, 1);
struct lua_redis_specific_userdata *sp_ud;
struct lua_redis_userdata *ud;
static int
lua_redis_exec (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_redis_ctx *ctx = lua_check_redis (L, 1);
redisReply *r;
gint ret;
static int
lua_regexp_create (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_regexp_t *re;
struct rspamd_lua_regexp *new, **pnew;
const gchar *string, *flags_str = NULL;
static int
lua_regexp_get_cached (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_regexp_t *re;
struct rspamd_lua_regexp *new, **pnew;
const gchar *string, *flags_str = NULL;
static int
lua_regexp_create_cached (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_regexp_t *re;
struct rspamd_lua_regexp *new, **pnew;
const gchar *string, *flags_str = NULL;
static int
lua_regexp_get_pattern (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *re = lua_check_regexp (L);
if (re && re->re && !IS_DESTROYED (re)) {
static int
lua_regexp_set_limit (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *re = lua_check_regexp (L);
gint64 lim;
static int
lua_regexp_set_max_hits (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *re = lua_check_regexp (L);
guint lim;
static int
lua_regexp_get_max_hits (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *re = lua_check_regexp (L);
if (re && re->re && !IS_DESTROYED (re)) {
static int
lua_regexp_search (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *re = lua_check_regexp (L);
const gchar *data = NULL;
struct rspamd_lua_text *t;
static int
lua_regexp_match (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *re = lua_check_regexp (L);
struct rspamd_lua_text *t;
const gchar *data = NULL;
static int
lua_regexp_matchn (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *re = lua_check_regexp (L);
struct rspamd_lua_text *t;
const gchar *data = NULL, *start = NULL, *end = NULL;
static int
lua_regexp_split (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *re = lua_check_regexp (L);
const gchar *data = NULL;
struct rspamd_lua_text *t;
static gint
lua_regexp_destroy (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *to_del = lua_check_regexp (L);
if (to_del) {
static gint
lua_regexp_gc (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_regexp *to_del = lua_check_regexp (L);
if (to_del) {
static gint
lua_sqlite3_sql (lua_State *L)
{
+ LUA_TRACE_POINT;
sqlite3 *db = lua_check_sqlite3 (L, 1);
const gchar *query = luaL_checkstring (L, 2);
sqlite3_stmt *stmt;
static gint
lua_sqlite3_next_row (lua_State *L)
{
+ LUA_TRACE_POINT;
sqlite3_stmt *stmt = *(sqlite3_stmt **)lua_touserdata (L, lua_upvalueindex (1));
gint rc;
static gint
lua_sqlite3_rows (lua_State *L)
{
+ LUA_TRACE_POINT;
sqlite3 *db = lua_check_sqlite3 (L, 1);
const gchar *query = luaL_checkstring (L, 2);
sqlite3_stmt *stmt, **pstmt;
static gint
lua_sqlite3_close (lua_State *L)
{
+ LUA_TRACE_POINT;
sqlite3 *db = lua_check_sqlite3 (L, 1);
if (db) {
lua_task_set_cached (lua_State *L, struct rspamd_task *task, const gchar *key,
gint pos, guint id)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cached_entry *entry;
lua_pushvalue (L, pos);
lua_task_get_cached (lua_State *L, struct rspamd_task *task, const gchar *key,
guint id)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_cached_entry *entry;
entry = g_hash_table_lookup (task->lua_cache, key);
static int
lua_task_process_message (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task != NULL) {
static int
lua_task_get_cfg (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_config **pcfg;
static int
lua_task_set_cfg (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
void *ud = rspamd_lua_check_udata (L, 2, "rspamd{config}");
static int
lua_task_destroy (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task != NULL) {
static int
lua_task_get_message (lua_State * L)
{
+ LUA_TRACE_POINT;
return luaL_error (L, "task:get_message is no longer supported");
}
static gint
lua_task_load_from_file (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = NULL, **ptask;
const gchar *fname = luaL_checkstring (L, 1), *err = NULL;
struct rspamd_config *cfg = NULL;
static gint
lua_task_load_from_string (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = NULL, **ptask;
const gchar *str_message;
gsize message_len;
static int
lua_task_get_mempool (lua_State * L)
{
+ LUA_TRACE_POINT;
rspamd_mempool_t **ppool;
struct rspamd_task *task = lua_check_task (L, 1);
static int
lua_task_get_session (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_async_session **psession;
struct rspamd_task *task = lua_check_task (L, 1);
static int
lua_task_get_ev_base (lua_State * L)
{
+ LUA_TRACE_POINT;
struct event_base **pbase;
struct rspamd_task *task = lua_check_task (L, 1);
static int
lua_task_get_worker (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_worker **pworker;
struct rspamd_task *task = lua_check_task (L, 1);
static gint
lua_task_insert_result (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *symbol_name, *param;
double weight;
static gint
lua_task_adjust_result (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *symbol_name, *param;
struct rspamd_metric_result *metric_res;
static gint
lua_task_set_pre_result (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gchar *action_str;
gint action = METRIC_ACTION_MAX;
static gint
lua_task_has_pre_result (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_append_message (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *message = luaL_checkstring (L, 2), *category;
static gint
lua_task_get_urls (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct lua_tree_cb_data cb;
gboolean need_emails = FALSE;
static gint
lua_task_has_urls (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gboolean need_emails = FALSE, ret = FALSE;
static gint
lua_task_get_content (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_lua_text *t;
static gint
lua_task_get_filename (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_get_rawbody (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_lua_text *t;
static gint
lua_task_get_emails (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct lua_tree_cb_data cb;
static gint
lua_task_get_text_parts (lua_State * L)
{
+ LUA_TRACE_POINT;
guint i;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_mime_text_part *part, **ppart;
static gint
lua_task_get_parts (lua_State * L)
{
+ LUA_TRACE_POINT;
guint i;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_mime_part *part, **ppart;
static gint
lua_task_get_request_header (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_ftok_t *hdr;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *s;
static gint
lua_task_set_request_header (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *s, *v = NULL;
rspamd_fstring_t *buf;
rspamd_lua_push_header (lua_State *L, struct rspamd_mime_header *rh,
enum rspamd_lua_task_header_type how)
{
-
+ LUA_TRACE_POINT;
switch (how) {
case RSPAMD_TASK_HEADER_PUSH_FULL:
/* Create new associated table for a header */
GPtrArray *ar,
enum rspamd_lua_task_header_type how)
{
-
+ LUA_TRACE_POINT;
struct rspamd_mime_header *rh;
guint i;
static gint
lua_task_get_header_common (lua_State *L, enum rspamd_lua_task_header_type how)
{
+ LUA_TRACE_POINT;
gboolean strong = FALSE;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *name;
static gint
lua_task_get_raw_headers (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_lua_text *t;
static gint
lua_task_get_received_headers (lua_State * L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct received_header *rh;
const gchar *proto;
static gint
lua_task_get_queue_id (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_get_uid (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_get_resolver (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_dns_resolver **presolver;
static gint
lua_task_inc_dns_req (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task != NULL) {
static gint
lua_task_get_dns_req (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task != NULL) {
static gint
lua_task_get_recipients (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
GPtrArray *ptrs = NULL;
gint what = 0;
static gint
lua_task_set_recipients (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
GPtrArray *ptrs = NULL;
struct rspamd_email_address *addr = NULL;
static gint
lua_task_has_from (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gint what = 0;
gboolean ret = FALSE;
static gint
lua_task_has_recipients (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gint what = 0;
gboolean ret = FALSE;
static gint
lua_task_get_from (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
GPtrArray *addrs = NULL;
struct rspamd_email_address *addr = NULL;
static gint
lua_task_set_from (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
GPtrArray *addrs = NULL;
struct rspamd_email_address **paddr = NULL, *addr;
static gint
lua_task_get_principal_recipient (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *r;
static gint
lua_task_get_user (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_set_user (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *new_user;
static gint
lua_task_get_from_ip (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_set_from_ip (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *ip_str = luaL_checkstring (L, 2);
rspamd_inet_addr_t *addr = NULL;
static gint
lua_task_get_from_ip_num (lua_State *L)
{
+ LUA_TRACE_POINT;
msg_err ("this function is deprecated and should no longer be used");
lua_pushnil (L);
return 1;
static gint
lua_task_get_client_ip (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_get_helo (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_get_subject (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_set_helo (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *new_helo;
static gint
lua_task_get_hostname (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_set_hostname (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *new_hostname;
static gint
lua_task_get_images (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
guint nelt = 0, i;
struct rspamd_mime_part *part;
static gint
lua_task_get_archives (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
guint nelt = 0, i;
struct rspamd_mime_part *part;
static gint
lua_task_get_symbol (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *symbol;
gboolean found = FALSE;
static gint
lua_task_has_symbol (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *symbol;
gboolean found = FALSE;
static gint
lua_task_get_symbols (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_metric_result *mres;
gint i = 1;
static gint
lua_task_get_symbols_all (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_metric_result *mres;
struct rspamd_symbol_result *s;
static gint
lua_task_get_symbols_numeric (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_metric_result *mres;
gint i = 1, id;
static gint
lua_task_get_symbols_tokens (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct tokens_foreach_cbdata cbd;
static gint
lua_task_get_date (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
GPtrArray *hdrs;
gdouble tim;
static gint
lua_task_get_message_id (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task != NULL) {
static gint
lua_task_get_timeval (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task != NULL) {
static gint
lua_task_get_size (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task != NULL) {
static gint
lua_task_set_flag (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *flag = luaL_checkstring (L, 2);
gboolean set = TRUE, found = FALSE;
static gint
lua_task_has_flag (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *flag = luaL_checkstring (L, 2);
gboolean found = FALSE;
static gint
lua_task_get_flags (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gint idx = 1;
guint flags, bit, i;
static gint
lua_task_get_digest (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gchar hexbuf[33];
gint r;
static gint
lua_task_learn (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gboolean is_spam = FALSE;
const gchar *clname = NULL;
static gint
lua_task_set_settings (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
ucl_object_t *settings;
const ucl_object_t *act, *elt, *metric_elt, *vars, *cur;
static gint
lua_task_set_milter_reply (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
ucl_object_t *reply, *prev;
static gint
lua_task_get_settings (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task != NULL) {
static gint
lua_task_lookup_settings (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *key = NULL;
const ucl_object_t *elt;
static gint
lua_task_get_settings_id (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
guint32 *hp;
static gint
lua_task_cache_get (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *key = luaL_checkstring (L, 2);
guint id = 0;
static gint
lua_task_cache_set (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *key = luaL_checkstring (L, 2);
guint id = 0;
static gint
lua_task_store_in_file (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gboolean force_new = FALSE, keep = FALSE;
gchar fpath[PATH_MAX];
static gint
lua_task_process_regexp (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_lua_regexp *re = NULL;
gboolean strong = FALSE;
static gint
lua_task_get_metric_score (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
gdouble rs;
struct rspamd_metric_result *metric_res;
static gint
lua_task_get_metric_action (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_metric_result *metric_res;
enum rspamd_action_type action;
static gint
lua_task_set_metric_score (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
struct rspamd_metric_result *metric_res;
gdouble nscore;
static gint
lua_task_disable_action (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *action_name;
gint action;
static gint
lua_task_get_newlines_type (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
static gint
lua_task_get_stat_tokens (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
guint i;
rspamd_token_t *tok;
static gint
lua_task_set_metric_subject (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
const gchar *subject;
static gint
lua_task_get_protocol_reply (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
guint flags = 0;
ucl_object_t *obj;
static gint
lua_task_headers_foreach (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
enum rspamd_lua_task_header_type how = RSPAMD_TASK_HEADER_PUSH_SIMPLE;
struct rspamd_lua_regexp *re = NULL;
static gint
lua_image_get_width (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_image *img = lua_check_image (L);
if (img != NULL) {
static gint
lua_image_get_height (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_image *img = lua_check_image (L);
if (img != NULL) {
static gint
lua_image_get_type (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_image *img = lua_check_image (L);
if (img != NULL) {
static gint
lua_image_get_size (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_image *img = lua_check_image (L);
if (img != NULL) {
static gint
lua_image_get_filename (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_image *img = lua_check_image (L);
if (img != NULL && img->filename != NULL) {
static gint
lua_archive_get_type (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_archive *arch = lua_check_archive (L);
if (arch != NULL) {
static gint
lua_archive_get_files (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_archive *arch = lua_check_archive (L);
guint i;
struct rspamd_archive_file *f;
static gint
lua_archive_get_files_full (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_archive *arch = lua_check_archive (L);
guint i;
struct rspamd_archive_file *f;
static gint
lua_archive_is_encrypted (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_archive *arch = lua_check_archive (L);
if (arch != NULL) {
static gint
lua_archive_get_size (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_archive *arch = lua_check_archive (L);
if (arch != NULL) {
static gint
lua_archive_get_filename (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_archive *arch = lua_check_archive (L);
if (arch != NULL) {
static gint
lua_text_len (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = lua_check_text (L, 1);
gsize l = 0;
static gint
lua_text_str (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = lua_check_text (L, 1);
if (t != NULL) {
static gint
lua_text_ptr (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = lua_check_text (L, 1);
if (t != NULL) {
static gint
lua_text_take_ownership (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = lua_check_text (L, 1);
gchar *dest;
static gint
lua_text_save_in_file (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = lua_check_text (L, 1);
const gchar *fname = NULL;
guint mode = 00644;
static gint
lua_text_gc (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = lua_check_text (L, 1);
if (t != NULL) {
static gint
lua_tcp_request (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *host;
gchar *stop_pattern = NULL;
guint port;
static gint
lua_tcp_close (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_tcp_cbdata *cbd = lua_check_tcp (L, 1);
if (cbd == NULL) {
static gint
lua_tcp_set_timeout (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_tcp_cbdata *cbd = lua_check_tcp (L, 1);
gdouble ms = lua_tonumber (L, 2);
static gint
lua_tcp_add_read (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_tcp_cbdata *cbd = lua_check_tcp (L, 1);
struct lua_tcp_handler *rh;
gchar *stop_pattern = NULL;
static gint
lua_tcp_add_write (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_tcp_cbdata *cbd = lua_check_tcp (L, 1);
struct lua_tcp_handler *wh;
gint cbref = -1, tp;
static gint
lua_tcp_shift_callback (lua_State *L)
{
+ LUA_TRACE_POINT;
struct lua_tcp_cbdata *cbd = lua_check_tcp (L, 1);
if (cbd == NULL) {
static gint
lua_trie_match (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_multipattern *trie = lua_check_trie (L, 1);
const gchar *text;
gsize len;
static gint
lua_trie_search_mime (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_multipattern *trie = lua_check_trie (L, 1);
struct rspamd_task *task = lua_check_task (L, 2);
struct rspamd_mime_text_part *part;
static gint
lua_trie_search_rawmsg (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_multipattern *trie = lua_check_trie (L, 1);
struct rspamd_task *task = lua_check_task (L, 2);
const gchar *text;
static gint
lua_trie_search_rawbody (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_multipattern *trie = lua_check_trie (L, 1);
struct rspamd_task *task = lua_check_task (L, 2);
const gchar *text;
static gint
lua_upstream_get_addr (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream *up = lua_check_upstream (L);
if (up) {
static gint
lua_upstream_fail (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream *up = lua_check_upstream (L);
gboolean fail_addr = FALSE;
static gint
lua_upstream_ok (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream *up = lua_check_upstream (L);
if (up) {
static gint
lua_upstream_list_create (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream_list *new = NULL, **pnew;
struct rspamd_config *cfg = NULL;
const gchar *def;
static gint
lua_upstream_list_destroy (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream_list *upl = lua_check_upstream_list (L);
rspamd_upstreams_destroy (upl);
static gint
lua_upstream_list_get_upstream_by_hash (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream_list *upl;
struct upstream *selected, **pselected;
const gchar *key;
static gint
lua_upstream_list_get_upstream_round_robin (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream_list *upl;
struct upstream *selected, **pselected;
static gint
lua_upstream_list_get_upstream_master_slave (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream_list *upl;
struct upstream *selected, **pselected;
static gint
lua_upstream_list_all_upstreams (lua_State *L)
{
+ LUA_TRACE_POINT;
struct upstream_list *upl;
upl = lua_check_upstream_list (L);
static gint
lua_url_get_length (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_get_host (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_get_port (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_get_user (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL && url->url->user != NULL) {
static gint
lua_url_get_path (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL && url->url->datalen > 0) {
static gint
lua_url_get_query (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL && url->url->querylen > 0) {
static gint
lua_url_get_fragment (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL && url->url->fragmentlen > 0) {
static gint
lua_url_get_text (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_get_raw (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_is_phished (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_is_redirected (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_is_obscured (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_is_html_displayed (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_is_subject (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL) {
static gint
lua_url_get_tag (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
guint i;
const gchar *tag = luaL_checkstring (L, 2);
static gint
lua_url_get_tags (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
guint i;
GHashTableIter it;
static gint
lua_url_add_tag (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
rspamd_mempool_t *mempool = rspamd_lua_check_mempool (L, 4);
const gchar *tag = luaL_checkstring (L, 2);
static gint
lua_url_get_phished (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *purl, *url = lua_check_url (L, 1);
if (url) {
static gint
lua_url_get_tld (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL && url->url->tldlen > 0) {
static gint
lua_url_get_count (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
if (url != NULL && url->url != NULL) {
static gint
lua_url_to_table (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
struct rspamd_url *u;
static gint
lua_url_create (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_mempool_t *pool;
const gchar *text;
size_t length;
static gint
lua_url_all (lua_State *L)
{
+ LUA_TRACE_POINT;
rspamd_mempool_t *pool = rspamd_lua_check_mempool (L, 1);
const gchar *text;
size_t length;
static gint
lua_url_get_flags (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_url *url = lua_check_url (L, 1);
enum rspamd_url_flags flags;
static gint
lua_util_create_event_base (lua_State *L)
{
+ LUA_TRACE_POINT;
struct event_base **pev_base;
pev_base = lua_newuserdata (L, sizeof (struct event_base *));
static gint
lua_util_load_rspamd_config (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg, **pcfg;
const gchar *cfg_name;
static gint
lua_util_config_from_ucl (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = NULL, **pcfg;
struct rspamd_rcl_section *top;
GError *err = NULL;
static gint
lua_util_process_message (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_config *cfg = lua_check_config (L, 1);
const gchar *message;
gsize mlen;
static gint
lua_util_encode_base64 (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t;
const gchar *s = NULL;
gchar *out;
static gint
lua_util_decode_base64 (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t;
const gchar *s = NULL;
gsize inlen, outlen;
static gint
lua_util_encode_base32 (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t;
const gchar *s = NULL;
gchar *out;
static gint
lua_util_decode_base32 (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t;
const gchar *s = NULL;
gsize inlen, outlen;
static gint
lua_util_decode_url (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t;
const gchar *s = NULL;
gsize inlen;
static gint
lua_util_tokenize_text (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *in = NULL;
gsize len, pos, ex_len, i;
GList *exceptions = NULL, *cur;
static gint
lua_util_tanh (lua_State *L)
{
+ LUA_TRACE_POINT;
gdouble in = luaL_checknumber (L, 1);
lua_pushnumber (L, tanh (in));
static gint
lua_util_parse_html (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t;
const gchar *start = NULL;
gsize len;
static gint
lua_util_levenshtein_distance (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *s1, *s2;
gsize s1len, s2len;
gint dist = 0;
static gint
lua_util_parse_addr (lua_State *L)
{
+ LUA_TRACE_POINT;
GPtrArray *addrs;
gsize len;
const gchar *str = luaL_checklstring (L, 1, &len);
static gint
lua_util_fold_header (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *name, *value, *how, *stop_chars = NULL;
GString *folded;
static gint
lua_util_is_uppercase (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *str;
gsize sz;
gint32 i = 0;
static gint
lua_util_humanize_number (lua_State *L)
{
+ LUA_TRACE_POINT;
gdouble number = luaL_checknumber (L, 1);
gchar numbuf[32];
static gint
lua_util_get_tld (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *host;
gsize hostlen;
rspamd_ftok_t tld;
static gint
lua_util_glob (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *pattern;
glob_t gl;
gint top, i, flags;
static gint
lua_util_parse_mail_address (lua_State *L)
{
+ LUA_TRACE_POINT;
GPtrArray *addrs;
gsize len;
const gchar *str = luaL_checklstring (L, 1, &len);
static gint
lua_util_strlen_utf8 (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *str, *end;
gsize len;
static gint
lua_util_strcasecmp_utf8 (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *str1, *str2;
gsize len1, len2;
gint ret = -1;
static gint
lua_util_strcasecmp_ascii (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *str1, *str2;
gsize len1, len2;
gint ret = -1;
static gint
lua_util_strequal_caseless (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *str1, *str2;
gsize len1, len2;
gint ret = -1;
static gint
lua_util_get_ticks (lua_State *L)
{
+ LUA_TRACE_POINT;
gdouble ticks;
gboolean rdtsc = FALSE;
static gint
lua_util_get_time (lua_State *L)
{
+ LUA_TRACE_POINT;
gdouble seconds;
struct timeval tv;
static gint
lua_util_time_to_string (lua_State *L)
{
+ LUA_TRACE_POINT;
gdouble seconds;
struct timeval tv;
char timebuf[128];
static gint
lua_util_stat (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *fpath;
struct stat st;
static gint
lua_util_unlink (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *fpath;
gint ret;
static gint
lua_util_lock_file (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *fpath;
gint fd = -1;
gboolean own = FALSE;
static gint
lua_util_unlock_file (lua_State *L)
{
+ LUA_TRACE_POINT;
gint fd = -1, ret, serrno;
gboolean do_close = TRUE;
static gint
lua_util_create_file (lua_State *L)
{
+ LUA_TRACE_POINT;
gint fd, mode = 00644;
const gchar *fpath;
static gint
lua_util_close_file (lua_State *L)
{
+ LUA_TRACE_POINT;
gint fd = -1;
if (lua_isnumber (L, 1)) {
static gint
lua_util_random_hex (lua_State *L)
{
+ LUA_TRACE_POINT;
gchar *buf;
gint buflen;
static gint
lua_util_zstd_compress (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = NULL, *res, tmp;
gsize sz, r;
static gint
lua_util_zstd_decompress (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = NULL, *res;
gsize outlen, sz, r;
ZSTD_DStream *zstream;
static gint
lua_util_gzip_compress (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = NULL, *res, tmp;
gsize sz;
z_stream strm;
static gint
lua_util_gzip_decompress (lua_State *L)
{
+ LUA_TRACE_POINT;
struct rspamd_lua_text *t = NULL, *res, tmp;
gsize sz;
z_stream strm;
static gint
lua_util_normalize_prob (lua_State *L)
{
+ LUA_TRACE_POINT;
gdouble x, bias = 0.5;
x = lua_tonumber (L, 1);
static gint
lua_util_caseless_hash (lua_State *L)
{
+ LUA_TRACE_POINT;
guint64 seed = 0xdeadbabe, h;
struct rspamd_lua_text *t = NULL;
gint64 *r;
static gint
lua_util_caseless_hash_fast (lua_State *L)
{
+ LUA_TRACE_POINT;
guint64 seed = 0xdeadbabe, h;
struct rspamd_lua_text *t = NULL;
gsize sz;
static gint
lua_util_is_utf_spoofed (lua_State *L)
{
+ LUA_TRACE_POINT;
gsize l1, l2;
gint ret, nres = 2;
const gchar *s1 = lua_tolstring (L, 1, &l1),
static gint
lua_util_get_hostname (lua_State *L)
{
+ LUA_TRACE_POINT;
gchar *hostbuf;
gsize hostlen;
static gint
lua_util_is_valid_utf8 (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *str;
gsize len;
static gint
lua_util_readline (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *prompt = NULL;
gchar *input;
static gint
lua_util_readpassphrase (lua_State *L)
{
+ LUA_TRACE_POINT;
gchar test_password[8192];
gsize r;
static gint
lua_util_file_exists (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *fname = luaL_checkstring (L, 1);
gint serrno;
static gint
lua_util_mkdir (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *dname = luaL_checkstring (L, 1);
gboolean recursive = FALSE;
gint r = -1;
static gint
lua_util_umask (lua_State *L)
{
+ LUA_TRACE_POINT;
mode_t mask = 0, old;
if (lua_type (L, 1) == LUA_TSTRING) {
static gint
lua_util_isatty (lua_State *L)
{
+ LUA_TRACE_POINT;
if (isatty (STDOUT_FILENO)) {
lua_pushboolean (L, true);
}
static gint
lua_xmlrpc_parse_reply (lua_State *L)
{
+ LUA_TRACE_POINT;
const gchar *data;
GMarkupParseContext *ctx;
GError *err = NULL;
static gint
lua_xmlrpc_make_request (lua_State *L)
{
+ LUA_TRACE_POINT;
gchar databuf[BUFSIZ * 2];
const gchar *func;
gint r, top, i, num;