MAY_LJMP(check_args(L, 1, "req_get_headers"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return hlua_http_get_headers(L, &htxn->s->txn->req);
MAY_LJMP(check_args(L, 1, "res_get_headers"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_RES || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return hlua_http_get_headers(L, &htxn->s->txn->rsp);
MAY_LJMP(check_args(L, 4, "req_rep_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return MAY_LJMP(hlua_http_rep_hdr(L, &htxn->s->txn->req, 1));
MAY_LJMP(check_args(L, 4, "res_rep_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_RES || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return MAY_LJMP(hlua_http_rep_hdr(L, &htxn->s->txn->rsp, 1));
MAY_LJMP(check_args(L, 4, "req_rep_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return MAY_LJMP(hlua_http_rep_hdr(L, &htxn->s->txn->req, 0));
MAY_LJMP(check_args(L, 4, "res_rep_val"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_RES || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return MAY_LJMP(hlua_http_rep_hdr(L, &htxn->s->txn->rsp, 0));
MAY_LJMP(check_args(L, 2, "req_del_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return hlua_http_del_hdr(L, &htxn->s->txn->req);
MAY_LJMP(check_args(L, 2, "res_del_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_RES || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return hlua_http_del_hdr(L, &htxn->s->txn->rsp);
MAY_LJMP(check_args(L, 3, "req_add_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return hlua_http_add_hdr(L, &htxn->s->txn->req);
MAY_LJMP(check_args(L, 3, "res_add_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_RES || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
return hlua_http_add_hdr(L, &htxn->s->txn->rsp);
MAY_LJMP(check_args(L, 3, "req_set_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
hlua_http_del_hdr(L, &htxn->s->txn->req);
MAY_LJMP(check_args(L, 3, "res_set_hdr"));
htxn = MAY_LJMP(hlua_checkhttp(L, 1));
- if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_RES || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
hlua_http_del_hdr(L, &htxn->s->txn->rsp);
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
lua_pushboolean(L, http_req_replace_stline(0, name, name_len, htxn->p, htxn->s) != -1);
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
lua_pushboolean(L, http_req_replace_stline(1, name, name_len, htxn->p, htxn->s) != -1);
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
/* Check length. */
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- if (htxn->dir != SMP_OPT_DIR_REQ || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_REQ || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
lua_pushboolean(L, http_req_replace_stline(3, name, name_len, htxn->p, htxn->s) != -1);
const char *str = MAY_LJMP(luaL_optlstring(L, 3, NULL, NULL));
const struct ist reason = ist2(str, (str ? strlen(str) : 0));
- if (htxn->dir != SMP_OPT_DIR_RES || !(htxn->flags & HLUA_TXN_HTTP_RDY))
+ if (htxn->dir != SMP_OPT_DIR_RES || !IS_HTX_STRM(htxn->s))
WILL_LJMP(lua_error(L));
http_res_set_status(code, reason, htxn->s);
WILL_LJMP(hlua_done(L));
s = htxn->s;
- if (!(htxn->flags & HLUA_TXN_HTTP_RDY)) {
+ if (!IS_HTX_STRM(htxn->s)) {
struct channel *req = &s->req;
struct channel *res = &s->res;
int ret, status;
htxn = MAY_LJMP(hlua_checktxn(L, 1));
- if (!(htxn->flags & HLUA_TXN_HTTP_RDY)) {
+ if (!IS_HTX_STRM(htxn->s)) {
hlua_pusherror(L, "txn object is not an HTTP transaction.");
WILL_LJMP(lua_error(L));
}
}
}
- if (stream->be->mode == PR_MODE_HTTP) {
- if ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_REQ)
- hflags |= ((stream->txn->req.msg_state < HTTP_MSG_BODY) ? 0 : HLUA_TXN_HTTP_RDY);
- else
- hflags |= ((stream->txn->rsp.msg_state < HTTP_MSG_BODY) ? 0 : HLUA_TXN_HTTP_RDY);
- }
-
/* If it is the first run, initialize the data for the call. */
if (!HLUA_IS_RUNNING(stream->hlua)) {
const char *error;
switch (rule->from) {
- case ACT_F_TCP_REQ_CNT: ; dir = SMP_OPT_DIR_REQ; break;
- case ACT_F_TCP_RES_CNT: ; dir = SMP_OPT_DIR_RES; break;
- case ACT_F_HTTP_REQ: hflags = HLUA_TXN_HTTP_RDY ; dir = SMP_OPT_DIR_REQ; break;
- case ACT_F_HTTP_RES: hflags = HLUA_TXN_HTTP_RDY ; dir = SMP_OPT_DIR_RES; break;
+ case ACT_F_TCP_REQ_CNT: dir = SMP_OPT_DIR_REQ; break;
+ case ACT_F_TCP_RES_CNT: dir = SMP_OPT_DIR_RES; break;
+ case ACT_F_HTTP_REQ: dir = SMP_OPT_DIR_REQ; break;
+ case ACT_F_HTTP_RES: dir = SMP_OPT_DIR_RES; break;
default:
SEND_ERR(px, "Lua: internal error while execute action.\n");
goto end;