From f2c6e48eb8c41e887e483bb4a010742e269e9441 Mon Sep 17 00:00:00 2001 From: Silas Parker Date: Tue, 14 Feb 2017 23:14:09 +0800 Subject: [PATCH] fix close packet index coding https://github.com/warmcat/libwebsockets/issues/792 --- lib/libwebsockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 8ee906a5..bf78584a 100755 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -349,7 +349,7 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason) if (!wsi->u.ws.close_in_ping_buffer_len) { wsi->u.ws.close_in_ping_buffer_len = 2; wsi->u.ws.ping_payload_buf[LWS_PRE] = - (reason >> 16) & 0xff; + (reason >> 8) & 0xff; wsi->u.ws.ping_payload_buf[LWS_PRE + 1] = reason & 0xff; }