Skip to content

Commit

Permalink
fix(websockets): not calling on_close on TLS notify
Browse files Browse the repository at this point in the history
This commit fixes the issue that once a TLS notify was received, it wouldn't call on_close, ending up stuck in loop, not reconnecting.
  • Loading branch information
ThePedroo committed Jan 21, 2024
1 parent df0fa47 commit 6c50c70
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/websockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ _ws_curl_tls_check(
reason, url, ws->info.loginfo.counter);

_ws_set_status(ws, WS_DISCONNECTED);

if (ws->cbs.on_close)
ws->cbs.on_close(ws->cbs.data, ws, &ws->info,
WS_CLOSE_REASON_ABRUPTLY, reason, sizeof(reason) - 1);

}
return 0;
}
Expand Down

0 comments on commit 6c50c70

Please sign in to comment.