fix close packet index coding

https://github.com/warmcat/libwebsockets/issues/792
This commit is contained in:
Silas Parker 2017-02-14 23:26:13 +08:00 committed by Andy Green
parent 7270aebadf
commit eb76310c52

View file

@ -331,7 +331,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;
}