diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-08-22 21:41:48 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-08-22 21:41:48 +0400 |
commit | b90267a71cc8cdc8b38675322ef9fa7a9cb5468c (patch) | |
tree | 3bff8af523d19ec9cff93134b067fc404795000d /src/lua/lua_http.c | |
parent | ed224e6a3530f54b5993e39066a8397d54e9517e (diff) | |
download | rspamd-b90267a71cc8cdc8b38675322ef9fa7a9cb5468c.tar.gz rspamd-b90267a71cc8cdc8b38675322ef9fa7a9cb5468c.zip |
* Rework thread pools locking logic to avoid global lua mutex usage.
Fixed several memory leaks with modern glib.
Fixed memory leak in dkim code.
Fixed a problem with static global variables in shared libraries.
Diffstat (limited to 'src/lua/lua_http.c')
-rw-r--r-- | src/lua/lua_http.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c index 3fa5da2ab..433529940 100644 --- a/src/lua/lua_http.c +++ b/src/lua/lua_http.c @@ -81,12 +81,6 @@ lua_http_push_error (gint code, struct lua_http_ud *ud) { struct worker_task **ptask; gint num; - gboolean need_unlock = FALSE; - - /* Avoid LOR here as mutex can be acquired before in lua_call */ - if (g_mutex_trylock (lua_mtx)) { - need_unlock = TRUE; - } /* Push error */ if (ud->callback) { @@ -115,9 +109,7 @@ lua_http_push_error (gint code, struct lua_http_ud *ud) g_list_free (ud->headers); ud->headers = NULL; } - if (need_unlock) { - g_mutex_unlock (lua_mtx); - } + ud->parser_state = 3; remove_normal_event (ud->s, lua_http_fin, ud); @@ -130,12 +122,6 @@ lua_http_push_reply (f_str_t *in, struct lua_http_ud *ud) struct lua_http_header *header; struct worker_task **ptask; gint num; - gboolean need_unlock = FALSE; - - /* Avoid LOR here as mutex can be acquired before in lua_call */ - if (g_mutex_trylock (lua_mtx)) { - need_unlock = TRUE; - } if (ud->callback) { /* Push error */ @@ -175,9 +161,6 @@ lua_http_push_reply (f_str_t *in, struct lua_http_ud *ud) ud->headers = NULL; } - if (need_unlock) { - g_mutex_unlock (lua_mtx); - } remove_normal_event (ud->s, lua_http_fin, ud); } |