]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: lua: Stop using lua txn in hlua_http_del_hdr() and hlua_http_add_hdr()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 25 Feb 2020 08:37:57 +0000 (09:37 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Mar 2020 13:13:00 +0000 (14:13 +0100)
In these functions, the lua txn was not used. So it can be removed from the
function argument list.

This patch is mandatory to allow the support of the filters written in lua.

src/hlua.c

index c41f04a5f23e18c746a1d90fe1677b39c9765c67..c5bd5678802cea21dca66c4304bbe6ebc33e90a0 100644 (file)
@@ -4822,7 +4822,7 @@ __LJMP static int hlua_http_res_rep_val(lua_State *L)
 /* This function deletes all the occurrences of an header.
  * It is a wrapper for the 2 following functions.
  */
-__LJMP static inline int hlua_http_del_hdr(lua_State *L, struct hlua_txn *htxn, struct http_msg *msg)
+__LJMP static inline int hlua_http_del_hdr(lua_State *L, struct http_msg *msg)
 {
        size_t len;
        const char *name = MAY_LJMP(luaL_checklstring(L, 2, &len));
@@ -4845,7 +4845,7 @@ __LJMP static int hlua_http_req_del_hdr(lua_State *L)
        if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
                WILL_LJMP(lua_error(L));
 
-       return hlua_http_del_hdr(L, htxn, &htxn->s->txn->req);
+       return hlua_http_del_hdr(L, &htxn->s->txn->req);
 }
 
 __LJMP static int hlua_http_res_del_hdr(lua_State *L)
@@ -4858,13 +4858,13 @@ __LJMP static int hlua_http_res_del_hdr(lua_State *L)
        if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
                WILL_LJMP(lua_error(L));
 
-       return hlua_http_del_hdr(L, htxn, &htxn->s->txn->rsp);
+       return hlua_http_del_hdr(L, &htxn->s->txn->rsp);
 }
 
 /* This function adds an header. It is a wrapper used by
  * the 2 following functions.
  */
-__LJMP static inline int hlua_http_add_hdr(lua_State *L, struct hlua_txn *htxn, struct http_msg *msg)
+__LJMP static inline int hlua_http_add_hdr(lua_State *L, struct http_msg *msg)
 {
        size_t name_len;
        const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
@@ -4887,7 +4887,7 @@ __LJMP static int hlua_http_req_add_hdr(lua_State *L)
        if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
                WILL_LJMP(lua_error(L));
 
-       return hlua_http_add_hdr(L, htxn, &htxn->s->txn->req);
+       return hlua_http_add_hdr(L, &htxn->s->txn->req);
 }
 
 __LJMP static int hlua_http_res_add_hdr(lua_State *L)
@@ -4900,7 +4900,7 @@ __LJMP static int hlua_http_res_add_hdr(lua_State *L)
        if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
                WILL_LJMP(lua_error(L));
 
-       return hlua_http_add_hdr(L, htxn, &htxn->s->txn->rsp);
+       return hlua_http_add_hdr(L, &htxn->s->txn->rsp);
 }
 
 static int hlua_http_req_set_hdr(lua_State *L)
@@ -4913,8 +4913,8 @@ static int hlua_http_req_set_hdr(lua_State *L)
        if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
                WILL_LJMP(lua_error(L));
 
-       hlua_http_del_hdr(L, htxn, &htxn->s->txn->req);
-       return hlua_http_add_hdr(L, htxn, &htxn->s->txn->req);
+       hlua_http_del_hdr(L, &htxn->s->txn->req);
+       return hlua_http_add_hdr(L, &htxn->s->txn->req);
 }
 
 static int hlua_http_res_set_hdr(lua_State *L)
@@ -4927,8 +4927,8 @@ static int hlua_http_res_set_hdr(lua_State *L)
        if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
                WILL_LJMP(lua_error(L));
 
-       hlua_http_del_hdr(L, htxn, &htxn->s->txn->rsp);
-       return hlua_http_add_hdr(L, htxn, &htxn->s->txn->rsp);
+       hlua_http_del_hdr(L, &htxn->s->txn->rsp);
+       return hlua_http_add_hdr(L, &htxn->s->txn->rsp);
 }
 
 /* This function set the method. */