Changeset 15 in Main for trunk/Server/server.c


Ignore:
Timestamp:
Sep 13, 2024, 10:49:53 PM (2 months ago)
Author:
Nishi
Message:

close socket properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/server.c

    r14 r15  
    132132        SSL_CTX* ctx = NULL;
    133133        SSL* s = NULL;
     134        bool sslworks = false;
    134135        if(ssl) {
    135136                ctx = tw_create_ssl_ctx(port);
     
    137138                SSL_set_fd(s, sock);
    138139                if(SSL_accept(s) <= 0) goto cleanup;
     140                sslworks = true;
    139141        }
    140142cleanup:
     143        if(sslworks){
     144                SSL_shutdown(s);
     145        }
     146        SSL_free(s);
    141147        close_socket(sock);
    142148#ifdef __MINGW32__
Note: See TracChangeset for help on using the changeset viewer.