From 6005b5ca88b64d8556cc5a87aa6239072b08f93a Mon Sep 17 00:00:00 2001 From: nicolas Date: Thu, 28 May 2026 20:39:02 -0300 Subject: [PATCH] fix: tear down SSL connection on read failure to force reconnect --- src/rest_client.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rest_client.c b/src/rest_client.c index a85ebf8..478ee9b 100644 --- a/src/rest_client.c +++ b/src/rest_client.c @@ -205,6 +205,9 @@ static bool do_signed_request(rest_conn_t *rc, if (n <= 0) { int err = SSL_get_error(rc->ssl, n); if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) continue; + /* Connection dead — tear down so next call reconnects */ + SSL_free(rc->ssl); rc->ssl = NULL; + close(rc->fd); rc->fd = -1; break; } total += n;