Skip to content

Commit

Permalink
websocket: clean up ws structures without an active tcp connection
Browse files Browse the repository at this point in the history
- GH #3236
  • Loading branch information
miconda committed Sep 16, 2022
1 parent 0a61ec2 commit abe6083
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/modules/websocket/ws_conn.c
Expand Up @@ -679,6 +679,7 @@ void ws_timer(unsigned int ticks, void *param)
ws_connection_list_t rmlist;
ws_connection_t *wsc;
ws_connection_t *next;
struct tcp_connection *con = NULL;
ticks_t nticks;
int h;

Expand All @@ -695,6 +696,15 @@ void ws_timer(unsigned int ticks, void *param)
wsconn_detach_connection(wsc);
wsc->id_next = rmlist.head;
rmlist.head = wsc;
} else if(wsc->state != WS_S_REMOVING) {
con = tcpconn_get(wsc->id, 0, 0, 0, 0);
if(con == NULL) {
LM_DBG("ws structure without active tcp connection\n");
wsc->state = WS_S_REMOVING;
wsc->rmticks = get_ticks();
} else {
tcpconn_put(con);
}
}
wsc = next;
}
Expand Down

0 comments on commit abe6083

Please sign in to comment.