]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: hlua: Always return nil if there is no data to dup for HTTP messages
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Jul 2026 12:06:26 +0000 (14:06 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Sep 2026 08:23:47 +0000 (10:23 +0200)
In _hlua_http_msg_dup(), we must always return nil if no data was
duplicated. The fact the end of the message was reached or not should not
interfere. So let's remove the extra condition on HTX_FL_EOM flag and always
return nil if no data was duplicated.

This patch could be backported to all supported versions.

src/hlua.c

index 211ba603a157f6f73ee1487d79ecb05bd0f9ec3b..67f13483d761cb71ad215151d2a228a4cccca08b 100644 (file)
@@ -7354,15 +7354,13 @@ static int _hlua_http_msg_dup(struct http_msg *msg, lua_State *L, size_t offset,
                                break;
 
                        default:
-                               if (!ret)
-                                       goto no_data;
                                goto end;
                }
                offset = 0;
        }
 
-end:
-       if (!ret && (htx->flags & HTX_FL_EOM))
+  end:
+       if (!ret)
                goto no_data;
        luaL_pushresult(&b);
        return ret;