]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lua: http - Fix parent_event setting
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Aug 2024 14:20:44 +0000 (17:20 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Aug 2024 19:39:40 +0000 (22:39 +0300)
Broken by 85449f6a6cf3f0df1d63728ab107413436595b49

src/lib-lua/dlua-dovecot-http.c

index 0df01aa7c135e0cf0f5df47ec4ed997c528617f9..ebab5212c08083a6e1626e38357a61f5ac64f5fb 100644 (file)
@@ -476,6 +476,8 @@ static int parse_client_settings(lua_State *L, struct http_client_settings *set,
                        set->proxy_url = parsed_url;
                        set->proxy_username = parsed_url->user;
                        set->proxy_password = parsed_url->password;
+               } else if (strcmp(key, "event_parent") == 0) {
+                       set->event_parent = dlua_check_event(L, -1);
                } CLIENT_SETTING_STR(dns_client_socket_path)
                CLIENT_SETTING_STR(user_agent)
                CLIENT_SETTING_STR(rawlog_dir)
@@ -510,10 +512,7 @@ static int parse_client_settings(lua_State *L, struct http_client_settings *set,
                        t_strconcat(master_set->base_dir, "/dns-client", NULL);
        }
 
-       lua_getfield(L, -1, "event_parent");
-       if (!lua_isnil(L, -1))
-               set->event_parent = dlua_check_event(L, -1);
-       else {
+       if (set->event_parent == NULL) {
                struct dlua_script *script = dlua_script_from_state(L);
                set->event_parent = script->event;
        }