Skip to content

Commit

Permalink
Fixup after PR discussions
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksey Mikhaylov <[email protected]>
  • Loading branch information
ttaym committed Apr 27, 2022
1 parent 406a052 commit fb89d02
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
18 changes: 5 additions & 13 deletions fw/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions fw/http_sched_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions fw/websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fb89d02

Please sign in to comment.