Skip to content

Commit fb89d02

Browse files
committed
Fixup after PR discussions
Signed-off-by: Aleksey Mikhaylov <[email protected]>
1 parent 406a052 commit fb89d02

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

fw/http.c

+5-13
Original file line numberDiff line numberDiff line change
@@ -5108,6 +5108,9 @@ tfw_http_req_mark_nip(TfwHttpReq *req)
51085108
goto nip_match;
51095109
}
51105110

5111+
if (test_bit(TFW_HTTP_B_UPGRADE_WEBSOCKET, req->flags))
5112+
goto nip_match;
5113+
51115114
if (safe_methods & (1 << req->method))
51125115
return;
51135116

@@ -6235,7 +6238,6 @@ tfw_http_msg_process_generic(TfwConn *conn, TfwStream *stream,
62356238
{
62366239
int r;
62376240
TfwHttpMsg *req;
6238-
bool websocket = false;
62396241

62406242
if (WARN_ON_ONCE(!stream))
62416243
return -EINVAL;
@@ -6258,9 +6260,10 @@ tfw_http_msg_process_generic(TfwConn *conn, TfwStream *stream,
62586260

62596261
/* That is paired request, it may be freed after resp processing */
62606262
req = ((TfwHttpMsg *)stream->msg)->pair;
6261-
websocket = test_bit(TFW_HTTP_B_UPGRADE_WEBSOCKET, req->flags);
62626263
if ((r = tfw_http_resp_process(conn, stream, skb))) {
62636264
TfwSrvConn *srv_conn = (TfwSrvConn *)conn;
6265+
bool websocket = test_bit(TFW_HTTP_B_UPGRADE_WEBSOCKET,
6266+
req->flags);
62646267
/*
62656268
* We must clear TFW_CONN_B_UNSCHED to make server connection
62666269
* available for request scheduling further if websocket upgrade
@@ -7035,17 +7038,6 @@ TfwMod tfw_http_mod = {
70357038
.specs = tfw_http_specs,
70367039
};
70377040

7038-
// /*
7039-
// * We do not use http fsm for message processing any more, but only for
7040-
// * frang checks, so to clearly show our intention we BUG() here.
7041-
// */
7042-
// static int
7043-
// tfw_http_msg_process_fsm(TfwConn *conn, TfwFsmData *data)
7044-
// {
7045-
// BUG();
7046-
// return 0;
7047-
// }
7048-
70497041
/*
70507042
* ------------------------------------------------------------------------
70517043
* init/exit

fw/http_sched_hash.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,6 @@ tfw_sched_hash_add_grp(TfwSrvGroup *sg, void *data)
395395
return 0;
396396
}
397397

398-
static void
399-
tfw_sched_hash_put_srv_data(struct rcu_head *rcu)
400-
{
401-
TfwHashConnList *cl = container_of(rcu, TfwHashConnList, rcu);
402-
kfree(cl);
403-
}
404-
405398
static int
406399
tfw_sched_hash_add_srv(TfwServer *srv)
407400
{
@@ -425,6 +418,13 @@ tfw_sched_hash_add_srv(TfwServer *srv)
425418
return 0;
426419
}
427420

421+
static void
422+
tfw_sched_hash_put_srv_data(struct rcu_head *rcu)
423+
{
424+
TfwHashConnList *cl = container_of(rcu, TfwHashConnList, rcu);
425+
kfree(cl);
426+
}
427+
428428
static void
429429
tfw_sched_hash_del_srv(TfwServer *srv)
430430
{

fw/websocket.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ tfw_ws_conn_alloc(void)
7272
{
7373
TfwConn *conn;
7474

75-
T_DBG2("%s: conn=[%p]\n", __func__, conn);
76-
7775
if (!(conn = kmem_cache_alloc(tfw_ws_conn_cache, GFP_ATOMIC)))
7876
return NULL;
7977

78+
T_DBG2("%s: conn=[%p]\n", __func__, conn);
79+
8080
tfw_connection_init(conn);
8181

8282
ss_proto_init(&conn->proto, &tfw_ws_srv_ss_hooks, Conn_WsSrv);

0 commit comments

Comments
 (0)