diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-04-03 23:14:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-03 23:14:01 +0200 |
commit | 1710582473330dc6e7758953e3378187b5e3f226 (patch) | |
tree | 7dc769e2f23c15c639129845882e308ea3b0b430 /thirdparty/lws/libwebsockets.c | |
parent | 60d89d0ab315d957bb858eecb5c8b837eb160fa1 (diff) | |
parent | 2e078142a0803ee5b411959734f857fbac666951 (diff) |
Merge pull request #17847 from Faless/lws_update
LWS v2.4.2, mbedTLS v2.8.0, Websocket SSL support
Diffstat (limited to 'thirdparty/lws/libwebsockets.c')
-rw-r--r-- | thirdparty/lws/libwebsockets.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/thirdparty/lws/libwebsockets.c b/thirdparty/lws/libwebsockets.c index 50f975d21e..8fe0854041 100644 --- a/thirdparty/lws/libwebsockets.c +++ b/thirdparty/lws/libwebsockets.c @@ -482,8 +482,9 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason) wsi->mode == LWSCM_WSCL_ISSUE_HANDSHAKE) goto just_kill_connection; - if (wsi->mode == LWSCM_HTTP_SERVING || - wsi->mode == LWSCM_HTTP2_SERVING) { + if (!wsi->told_user_closed && + (wsi->mode == LWSCM_HTTP_SERVING || + wsi->mode == LWSCM_HTTP2_SERVING)) { if (wsi->user_space) wsi->vhost->protocols->callback(wsi, LWS_CALLBACK_HTTP_DROP_PROTOCOL, @@ -583,7 +584,7 @@ just_kill_connection: lws_remove_child_from_any_parent(wsi); n = 0; - if (wsi->user_space) { + if (!wsi->told_user_closed && wsi->user_space) { lwsl_debug("%s: %p: DROP_PROTOCOL %s\n", __func__, wsi, wsi->protocol->name); wsi->protocol->callback(wsi, @@ -656,8 +657,10 @@ just_kill_connection: __func__, wsi, (int)(long)wsi->desc.sockfd, wsi->state); if (!wsi->socket_is_permanently_unusable && - lws_sockfd_valid(wsi->desc.sockfd)) + lws_sockfd_valid(wsi->desc.sockfd)) { + wsi->socket_is_permanently_unusable = 1; n = shutdown(wsi->desc.sockfd, SHUT_WR); + } } if (n) lwsl_debug("closing: shutdown (state %d) ret %d\n", |