si_release_endpoint(&s->si[1]);
/* do not reuse if mode is not http */
- if (s->be->mode != PR_MODE_HTTP)
+ if (!IS_HTX_STRM(s))
goto skip_reuse;
/* first, search for a matching connection in the session's idle conns */
#if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
if (!srv ||
(srv->use_ssl != 1 || (!(srv->ssl_ctx.alpn_str) && !(srv->ssl_ctx.npn_str)) ||
- srv->mux_proto || s->be->mode != PR_MODE_HTTP))
+ srv->mux_proto || !IS_HTX_STRM(s)))
#endif
init_mux = 1;
conn_full_close(srv_conn);
return SF_ERR_INTERNAL;
}
- if (s->be->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(s)) {
/* If we're doing http-reuse always, and the connection
* is not private with available streams (an http2
* connection), add it to the available list, so that
chn = MAY_LJMP(hlua_checkchannel(L, 1));
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(chn_strm(chn))) {
lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
}
chn = MAY_LJMP(hlua_checkchannel(L, 1));
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(chn_strm(chn))) {
lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
}
chn = MAY_LJMP(hlua_checkchannel(L, 1));
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(chn_strm(chn))) {
lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
}
int ret;
int max;
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(chn_strm(chn))) {
lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
}
chn = MAY_LJMP(hlua_checkchannel(L, 1));
lua_pushinteger(L, 0);
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(chn_strm(chn))) {
lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
}
return 1;
}
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(chn_strm(chn))) {
lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
}
chn = MAY_LJMP(hlua_checkchannel(L, 1));
- if (chn_strm(chn)->be->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(chn_strm(chn))) {
lua_pushfstring(L, "Cannot manipulate HAProxy channels in HTTP mode.");
WILL_LJMP(lua_error(L));
}
/* Creates the HTTP object is the current proxy allows http. */
lua_pushstring(L, "http");
- if (p->mode == PR_MODE_HTTP) {
+ if (IS_HTX_STRM(s)) {
if (!hlua_http_new(L, htxn))
return 0;
}
if (objt_server(s->target))
health_adjust(objt_server(s->target), HANA_STATUS_L4_OK);
- if (s->be->mode == PR_MODE_TCP) { /* let's allow immediate data connection in this case */
+ if (!IS_HTX_STRM(s)) { /* let's allow immediate data connection in this case */
/* if the user wants to log as soon as possible, without counting
* bytes from the server, then this is the right moment. */
if (!LIST_ISEMPTY(&strm_fe(s)->logformat) && !(s->logs.logwait & LW_BYTES)) {
/* Be sure to filter response headers if the backend is an HTTP proxy
* and if there are filters attached to the stream. */
- if (s->be->mode == PR_MODE_HTTP && HAS_FILTERS(s))
+ if (IS_HTX_STRM(s) && HAS_FILTERS(s))
rep->analysers |= AN_RES_FLT_HTTP_HDRS;
si_rx_endp_more(si);