Fix corruption of close reason code in close frame

According to specification, close reason code is part of body
This commit is contained in:
Andrejs Hanins 2015-12-15 13:31:23 +02:00 committed by Andy Green
parent 3decfe60ab
commit ea592fa869

View file

@ -337,7 +337,6 @@ LWS_VISIBLE int lws_write(struct lws *wsi, unsigned char *buf,
if (wsi->u.ws.close_reason) {
/* reason codes count as data bytes */
buf -= 2;
buf[0] = (unsigned char)(wsi->u.ws.close_reason >> 8);
buf[1] = (unsigned char)wsi->u.ws.close_reason;
len += 2;