From 535231642d8fbe5f65052507e4527ea1d28d4657 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 17 Feb 2011 17:33:15 +0300 Subject: [PATCH] Fix received headers passing to lua. --- src/lua/lua_task.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 892bbdf073..8b02ac5e7a 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -324,6 +324,13 @@ lua_task_get_received_headers (lua_State * L) cur = g_list_first (task->received); while (cur) { rh = cur->data; + if (rh->is_error || ( + rh->from_ip == NULL && + rh->real_ip == NULL && + rh->real_hostname == NULL)) { + cur = g_list_next (cur); + continue; + } lua_newtable (L); lua_set_table_index (L, "from_hostname", rh->from_hostname); lua_set_table_index (L, "from_ip", rh->from_ip); -- 2.47.3