From 3b58cc46176ae34cc9eaca99b6c589eaeb94a322 Mon Sep 17 00:00:00 2001
From: Silas Parker <skyhisi@user.github.invalid.com>
Date: Tue, 14 Feb 2017 23:26:43 +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 dc4aa5f4..cef68bd5 100755
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -264,7 +264,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