diff --git a/fw/http.c b/fw/http.c index 2e5a26e55c..659544eba0 100644 --- a/fw/http.c +++ b/fw/http.c @@ -5108,6 +5108,9 @@ tfw_http_req_mark_nip(TfwHttpReq *req) goto nip_match; } + if (test_bit(TFW_HTTP_B_UPGRADE_WEBSOCKET, req->flags)) + goto nip_match; + if (safe_methods & (1 << req->method)) return; @@ -6235,7 +6238,6 @@ tfw_http_msg_process_generic(TfwConn *conn, TfwStream *stream, { int r; TfwHttpMsg *req; - bool websocket = false; if (WARN_ON_ONCE(!stream)) return -EINVAL; @@ -6258,9 +6260,10 @@ tfw_http_msg_process_generic(TfwConn *conn, TfwStream *stream, /* That is paired request, it may be freed after resp processing */ req = ((TfwHttpMsg *)stream->msg)->pair; - websocket = test_bit(TFW_HTTP_B_UPGRADE_WEBSOCKET, req->flags); if ((r = tfw_http_resp_process(conn, stream, skb))) { TfwSrvConn *srv_conn = (TfwSrvConn *)conn; + bool websocket = test_bit(TFW_HTTP_B_UPGRADE_WEBSOCKET, + req->flags); /* * We must clear TFW_CONN_B_UNSCHED to make server connection * available for request scheduling further if websocket upgrade @@ -7035,17 +7038,6 @@ TfwMod tfw_http_mod = { .specs = tfw_http_specs, }; -// /* -// * We do not use http fsm for message processing any more, but only for -// * frang checks, so to clearly show our intention we BUG() here. -// */ -// static int -// tfw_http_msg_process_fsm(TfwConn *conn, TfwFsmData *data) -// { -// BUG(); -// return 0; -// } - /* * ------------------------------------------------------------------------ * init/exit diff --git a/fw/http_sched_hash.c b/fw/http_sched_hash.c index 39a98ef02b..b97ec84394 100644 --- a/fw/http_sched_hash.c +++ b/fw/http_sched_hash.c @@ -395,13 +395,6 @@ tfw_sched_hash_add_grp(TfwSrvGroup *sg, void *data) return 0; } -static void -tfw_sched_hash_put_srv_data(struct rcu_head *rcu) -{ - TfwHashConnList *cl = container_of(rcu, TfwHashConnList, rcu); - kfree(cl); -} - static int tfw_sched_hash_add_srv(TfwServer *srv) { @@ -425,6 +418,13 @@ tfw_sched_hash_add_srv(TfwServer *srv) return 0; } +static void +tfw_sched_hash_put_srv_data(struct rcu_head *rcu) +{ + TfwHashConnList *cl = container_of(rcu, TfwHashConnList, rcu); + kfree(cl); +} + static void tfw_sched_hash_del_srv(TfwServer *srv) { diff --git a/fw/websocket.c b/fw/websocket.c index bc2924a596..a082c6e09d 100644 --- a/fw/websocket.c +++ b/fw/websocket.c @@ -72,11 +72,11 @@ tfw_ws_conn_alloc(void) { TfwConn *conn; - T_DBG2("%s: conn=[%p]\n", __func__, conn); - if (!(conn = kmem_cache_alloc(tfw_ws_conn_cache, GFP_ATOMIC))) return NULL; + T_DBG2("%s: conn=[%p]\n", __func__, conn); + tfw_connection_init(conn); ss_proto_init(&conn->proto, &tfw_ws_srv_ss_hooks, Conn_WsSrv);