]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: lua: rename last occurrences of "*s" to "*htxn" for hlua_txn
authorWilly Tarreau <w@1wt.eu>
Mon, 6 Apr 2015 09:21:44 +0000 (11:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Apr 2015 09:23:23 +0000 (11:23 +0200)
These ones were found in the actions to set the query/path/method/uri.
Where it's used, "s" makes one think about session or something like
this, especially when mixed with http_txn.

src/hlua.c

index 266a8b74d398eb9b596829c73189a8536086d765..67308d8893a031a398fbfd5f31e2558ef9334d1a 100644 (file)
@@ -3198,34 +3198,34 @@ static int hlua_http_res_set_hdr(lua_State *L)
 /* This function set the method. */
 static int hlua_http_req_set_meth(lua_State *L)
 {
-       struct hlua_txn *s = MAY_LJMP(hlua_checkhttp(L, 1));
+       struct hlua_txn *htxn = MAY_LJMP(hlua_checkhttp(L, 1));
        size_t name_len;
        const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
-       struct http_txn *txn = &s->s->txn;
+       struct http_txn *txn = &htxn->s->txn;
 
-       lua_pushboolean(L, http_replace_req_line(0, name, name_len, s->p, s->s, txn) != -1);
+       lua_pushboolean(L, http_replace_req_line(0, name, name_len, htxn->p, htxn->s, txn) != -1);
        return 1;
 }
 
 /* This function set the method. */
 static int hlua_http_req_set_path(lua_State *L)
 {
-       struct hlua_txn *s = MAY_LJMP(hlua_checkhttp(L, 1));
+       struct hlua_txn *htxn = MAY_LJMP(hlua_checkhttp(L, 1));
        size_t name_len;
        const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
-       struct http_txn *txn = &s->s->txn;
+       struct http_txn *txn = &htxn->s->txn;
 
-       lua_pushboolean(L, http_replace_req_line(1, name, name_len, s->p, s->s, txn) != -1);
+       lua_pushboolean(L, http_replace_req_line(1, name, name_len, htxn->p, htxn->s, txn) != -1);
        return 1;
 }
 
 /* This function set the query-string. */
 static int hlua_http_req_set_query(lua_State *L)
 {
-       struct hlua_txn *s = MAY_LJMP(hlua_checkhttp(L, 1));
+       struct hlua_txn *htxn = MAY_LJMP(hlua_checkhttp(L, 1));
        size_t name_len;
        const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
-       struct http_txn *txn = &s->s->txn;
+       struct http_txn *txn = &htxn->s->txn;
 
        /* Check length. */
        if (name_len > trash.size - 1) {
@@ -3239,19 +3239,19 @@ static int hlua_http_req_set_query(lua_State *L)
        memcpy(trash.str + trash.len, name, name_len);
        trash.len += name_len;
 
-       lua_pushboolean(L, http_replace_req_line(2, trash.str, trash.len, s->p, s->s, txn) != -1);
+       lua_pushboolean(L, http_replace_req_line(2, trash.str, trash.len, htxn->p, htxn->s, txn) != -1);
        return 1;
 }
 
 /* This function set the uri. */
 static int hlua_http_req_set_uri(lua_State *L)
 {
-       struct hlua_txn *s = MAY_LJMP(hlua_checkhttp(L, 1));
+       struct hlua_txn *htxn = MAY_LJMP(hlua_checkhttp(L, 1));
        size_t name_len;
        const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
-       struct http_txn *txn = &s->s->txn;
+       struct http_txn *txn = &htxn->s->txn;
 
-       lua_pushboolean(L, http_replace_req_line(3, name, name_len, s->p, s->s, txn) != -1);
+       lua_pushboolean(L, http_replace_req_line(3, name, name_len, htxn->p, htxn->s, txn) != -1);
        return 1;
 }