if (!htxn->s->txn)
return 1;
- /* Check if a valid response is parsed */
- if (unlikely(msg->msg_state < HTTP_MSG_BODY))
- return 1;
-
if (IS_HTX_STRM(htxn->s)) {
/* HTX version */
struct htx *htx = htxbuf(&msg->chn->buf);
const char *value = MAY_LJMP(luaL_checkstring(L, 4));
struct my_regex re;
- /* Check if a valid response is parsed */
- if (unlikely(msg->msg_state < HTTP_MSG_BODY))
- return 0;
-
if (!regex_comp(reg, &re, 1, 1, NULL))
WILL_LJMP(luaL_argerror(L, 3, "invalid regex"));
size_t len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &len));
- /* Check if a valid response is parsed */
- if (unlikely(msg->msg_state < HTTP_MSG_BODY))
- return 0;
-
if (IS_HTX_STRM(htxn->s)) {
/* HTX version */
struct htx *htx = htxbuf(&msg->chn->buf);
const char *value = MAY_LJMP(luaL_checklstring(L, 3, &value_len));
char *p;
- /* Check if a valid message is parsed */
- if (unlikely(msg->msg_state < HTTP_MSG_BODY))
- return 0;
-
if (IS_HTX_STRM(htxn->s)) {
/* HTX version */
struct htx *htx = htxbuf(&msg->chn->buf);
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- /* Check if a valid request is parsed */
- if (unlikely(htxn->s->txn->req.msg_state < HTTP_MSG_BODY)) {
- lua_pushboolean(L, 0);
- return 1;
- }
-
lua_pushboolean(L, http_replace_req_line(0, name, name_len, htxn->p, htxn->s) != -1);
return 1;
}
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- /* Check if a valid request is parsed */
- if (unlikely(htxn->s->txn->req.msg_state < HTTP_MSG_BODY)) {
- lua_pushboolean(L, 0);
- return 1;
- }
-
lua_pushboolean(L, http_replace_req_line(1, name, name_len, htxn->p, htxn->s) != -1);
return 1;
}
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- /* Check if a valid request is parsed */
- if (unlikely(htxn->s->txn->req.msg_state < HTTP_MSG_BODY)) {
- lua_pushboolean(L, 0);
- return 1;
- }
-
/* Check length. */
if (name_len > trash.size - 1) {
lua_pushboolean(L, 0);
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- /* Check if a valid request is parsed */
- if (unlikely(htxn->s->txn->req.msg_state < HTTP_MSG_BODY)) {
- lua_pushboolean(L, 0);
- return 1;
- }
-
lua_pushboolean(L, http_replace_req_line(3, name, name_len, htxn->p, htxn->s) != -1);
return 1;
}
unsigned int code = MAY_LJMP(luaL_checkinteger(L, 2));
const char *reason = MAY_LJMP(luaL_optlstring(L, 3, NULL, NULL));
- /* Check if a valid response is parsed */
- if (unlikely(htxn->s->txn->rsp.msg_state < HTTP_MSG_BODY))
- return 0;
-
http_set_status(code, reason, htxn->s);
return 0;
}
/* Set the currently running flag. */
if (!HLUA_IS_RUNNING(hlua) &&
!(ctx->ctx.hlua_apphttp.flags & APPLET_DONE)) {
-
- /* Wait for full HTTP analysys. */
- if (unlikely(strm->txn->req.msg_state < HTTP_MSG_BODY)) {
- si_cant_get(si);
- return;
- }
-
/* Store the max amount of bytes that we can read. */
ctx->ctx.hlua_apphttp.left_bytes = strm->txn->req.body_len;