fix: tear down SSL connection on read failure to force reconnect

This commit is contained in:
nicolas 2026-05-28 20:39:02 -03:00
parent 7253d34983
commit 6005b5ca88
1 changed files with 3 additions and 0 deletions

View File

@ -205,6 +205,9 @@ static bool do_signed_request(rest_conn_t *rc,
if (n <= 0) { if (n <= 0) {
int err = SSL_get_error(rc->ssl, n); int err = SSL_get_error(rc->ssl, n);
if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) continue; 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; break;
} }
total += n; total += n;