From ed224e6a3530f54b5993e39066a8397d54e9517e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 22 Aug 2012 18:19:21 +0400 Subject: [PATCH] Fix deadlock in lua HTTP bindings. --- src/lua/lua_http.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c index 8f85ebee1..3fa5da2ab 100644 --- a/src/lua/lua_http.c +++ b/src/lua/lua_http.c @@ -115,12 +115,12 @@ lua_http_push_error (gint code, struct lua_http_ud *ud) g_list_free (ud->headers); ud->headers = NULL; } - - ud->parser_state = 3; - remove_normal_event (ud->s, lua_http_fin, ud); if (need_unlock) { g_mutex_unlock (lua_mtx); } + ud->parser_state = 3; + remove_normal_event (ud->s, lua_http_fin, ud); + } static void @@ -175,10 +175,11 @@ lua_http_push_reply (f_str_t *in, struct lua_http_ud *ud) ud->headers = NULL; } - remove_normal_event (ud->s, lua_http_fin, ud); if (need_unlock) { g_mutex_unlock (lua_mtx); } + remove_normal_event (ud->s, lua_http_fin, ud); + } /* -- 2.39.5