Use quit shutdown for SSL to prevent races
Some checks are pending
C/C++ CI / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (windows-2022) (push) Waiting to run

This commit is contained in:
Vladimir Dubrovin 2026-03-27 12:00:57 +03:00
parent a2edecfbad
commit 6143dfcb18

View File

@ -109,13 +109,15 @@ static void addSSL(
void delSSL(void *state, SOCKET s){
if(!state || s == INVALID_SOCKET) return;
if(STATE->cli.s == s) {
if(STATE->cli.s == s && STATE->cli.conn) {
SSL_set_quiet_shutdown(STATE->cli.conn, 1);
SSL_shutdown(STATE->cli.conn);
ssl_conn_free(STATE->cli.conn);
STATE->cli.conn = NULL;
STATE->cli.s = INVALID_SOCKET;
}
else if(STATE->srv.s == s) {
else if(STATE->srv.s == s && STATE->srv.conn) {
SSL_set_quiet_shutdown(STATE->srv.conn, 1);
SSL_shutdown(STATE->srv.conn);
ssl_conn_free(STATE->srv.conn);
STATE->srv.conn = NULL;