MINOR: stream: Use stream type instead of proxy mode when appropriate

We now use the stream instead of the proxy to know if we are processing HTTP
data or not. If the stream is an HTX stream, it means we are dealing with
HTTP data. It is more accurate than the proxy mode because when an HTTP
upgrade is performed, the proxy is not changed and only the stream may be
used.

Note that it was not a problem to rely on the proxy because HTTP upgrades
may only happen when an HTTP backend was set. But, we will add the support
of HTTP upgrades on the frontend side, after te tcp-request rules
evaluation.  In this context, we cannot rely on the proxy mode.
diff --git a/src/hlua.c b/src/hlua.c
index c162c84..a61809e 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2952,7 +2952,7 @@
 
 	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));
 	}
@@ -2982,7 +2982,7 @@
 
 	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));
 	}
@@ -3024,7 +3024,7 @@
 
 	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));
 	}
@@ -3074,7 +3074,7 @@
 	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));
 	}
@@ -3148,7 +3148,7 @@
 	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));
 	}
@@ -3179,7 +3179,7 @@
 		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));
 	}
@@ -3290,7 +3290,7 @@
 
 	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));
 	}
@@ -5505,7 +5505,7 @@
 
 	/* 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;
 	}