chn = MAY_LJMP(hlua_checkchannel(L, 1));
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP)
+ if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
+ }
if (_hlua_channel_dup(chn, L) == 0)
MAY_LJMP(hlua_yieldk(L, 0, 0, hlua_channel_dup_yield, TICK_ETERNITY, 0));
chn = MAY_LJMP(hlua_checkchannel(L, 1));
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP)
+ if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
+ }
ret = _hlua_channel_dup(chn, L);
if (unlikely(ret == 0))
chn = MAY_LJMP(hlua_checkchannel(L, 1));
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP)
+ if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
+ }
ret = ci_getline_nc(chn, &blk1, &len1, &blk2, &len2);
if (ret == 0)
int ret;
int max;
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP)
+ if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
+ }
/* Check if the buffer is available because HAProxy doesn't allocate
* the request buffer if its not required.
chn = MAY_LJMP(hlua_checkchannel(L, 1));
lua_pushinteger(L, 0);
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP)
+ if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
+ }
b_set_data(&chn->buf, co_data(chn));
int max;
struct hlua *hlua = hlua_gethlua(L);
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP)
+ if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
+ }
if (unlikely(channel_output_closed(chn))) {
lua_pushinteger(L, -1);
chn = MAY_LJMP(hlua_checkchannel(L, 1));
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP)
+ if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
+ }
len = MAY_LJMP(luaL_checkinteger(L, 2));
l = MAY_LJMP(luaL_checkinteger(L, -1));