From: Willy Tarreau Date: Mon, 6 Apr 2015 09:21:44 +0000 (+0200) Subject: CLEANUP: lua: rename last occurrences of "*s" to "*htxn" for hlua_txn X-Git-Tag: v1.6-dev2~281 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcb39cc339cee5362ee8d1a4f9252e714b5bddd3;p=thirdparty%2Fhaproxy.git CLEANUP: lua: rename last occurrences of "*s" to "*htxn" for hlua_txn 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. --- diff --git a/src/hlua.c b/src/hlua.c index 266a8b74d3..67308d8893 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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; }