fix close packet index coding
authorSilas Parker <skyhisi@user.github.invalid.com>
Tue, 14 Feb 2017 15:14:09 +0000 (23:14 +0800)
committerAndy Green <andy@warmcat.com>
Sat, 18 Feb 2017 09:27:22 +0000 (17:27 +0800)
https://github.com/warmcat/libwebsockets/issues/792

lib/libwebsockets.c

index 8ee906a..bf78584 100755 (executable)
@@ -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;
                }