From 25863b59a6f688d23a660837d3dd9b2d315e5801 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Fri, 21 Sep 2012 09:05:45 +0100 Subject: [PATCH] Sending MG_WEBSOCKET_CLOSE --- mongoose.c | 1 + mongoose.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mongoose.c b/mongoose.c index 83901c22..71aaeccb 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3710,6 +3710,7 @@ static void handle_websocket_request(struct mg_connection *conn) { send_websocket_handshake(conn); call_user(conn, MG_WEBSOCKET_READY); read_websocket(conn); + call_user(conn, MG_WEBSOCKET_CLOSE); } } diff --git a/mongoose.h b/mongoose.h index 52f3070d..f72cfc0d 100644 --- a/mongoose.h +++ b/mongoose.h @@ -62,7 +62,7 @@ enum mg_event { // with handshake, otherwise it closes the connection. MG_WEBSOCKET_READY, // Handshake has been successfully completed. MG_WEBSOCKET_MESSAGE, // Incoming message from the client - MG_WEBSOCKET_CLOSE, // Client has sent FIN frame + MG_WEBSOCKET_CLOSE, // Client has closed the connection };