From 6c50c70e7d4068a7c5c6cdc7db6f865304b7fb73 Mon Sep 17 00:00:00 2001 From: ThePedroo Date: Sun, 21 Jan 2024 19:30:29 -0300 Subject: [PATCH] fix(websockets): not calling on_close on TLS notify 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. --- core/websockets.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/websockets.c b/core/websockets.c index c48f9a77..7d3d7677 100644 --- a/core/websockets.c +++ b/core/websockets.c @@ -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; }