1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

context destroy just kill wsis

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2015-03-25 01:53:58 +08:00
parent 106d4a8a50
commit 8ec7802935
2 changed files with 5 additions and 2 deletions

View file

@ -52,7 +52,7 @@ libwebsocket_close_and_free_session(struct libwebsocket_context *context,
old_state = wsi->state;
if (wsi->socket_is_permanently_unusable)
if (wsi->socket_is_permanently_unusable || reason == LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY)
goto just_kill_connection;
switch (old_state) {
@ -164,7 +164,8 @@ libwebsocket_close_and_free_session(struct libwebsocket_context *context,
*/
if (old_state == WSI_STATE_ESTABLISHED &&
reason != LWS_CLOSE_STATUS_NOSTATUS) {
reason != LWS_CLOSE_STATUS_NOSTATUS &&
reason != LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY) {
lwsl_debug("sending close indication...\n");

View file

@ -524,6 +524,8 @@ enum lws_close_status {
LWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010,
LWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011,
LWS_CLOSE_STATUS_TLS_FAILURE = 1015,
LWS_CLOSE_STATUS_NOSTATUS_CONTEXT_DESTROY = 9999,
};
enum http_status {