From e2fcf47f0350a7f7beba64e96191b02acb754406 Mon Sep 17 00:00:00 2001
From: Silas Parker <skyhisi@user.github.invalid.com>
Date: Tue, 14 Feb 2017 23:25:15 +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 e2d08f94..d25e51fd 100755
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -341,7 +341,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;
 		}
-- 
GitLab