ssl close: do explicit ssl shutdown instead of socket shutdown if ssl mode
This commit is contained in:
parent
b8034bb1e5
commit
052a685435
1 changed files with 9 additions and 2 deletions
|
@ -428,8 +428,15 @@ just_kill_connection:
|
|||
wsi->state != LWSS_CLIENT_UNCONNECTED &&
|
||||
reason != LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY &&
|
||||
!wsi->socket_is_permanently_unusable) {
|
||||
lwsl_info("%s: shutting down connection: %p (sock %d, state %d)\n", __func__, wsi, (int)(long)wsi->sock, wsi->state);
|
||||
n = shutdown(wsi->sock, SHUT_WR);
|
||||
#ifdef LWS_OPENSSL_SUPPORT
|
||||
if (lws_is_ssl(wsi) && wsi->ssl)
|
||||
n = SSL_shutdown(wsi->ssl);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
lwsl_info("%s: shutting down connection: %p (sock %d, state %d)\n", __func__, wsi, (int)(long)wsi->sock, wsi->state);
|
||||
n = shutdown(wsi->sock, SHUT_WR);
|
||||
}
|
||||
if (n)
|
||||
lwsl_debug("closing: shutdown (state %d) ret %d\n", wsi->state, LWS_ERRNO);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue