]> 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, 24 Jul 2026 09:58:24 +0000 (11:58 +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 38f82182e61b2f52dbd8cd32c1785a1200d6890b..7bdd3d4b75d21b0872046e39c7cfe4cbab3de8cf 100644 (file)
@@ -7342,15 +7342,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;