Fix sent close code when failing the connection

This commit is contained in:
Přemysl Eric Janouch 2018-05-11 22:33:47 +02:00
parent 5c380878d5
commit 2e1127e371
Signed by: p
GPG Key ID: B715679E3A361BE6

View File

@ -1832,7 +1832,7 @@ backend_ws_send_control (struct ws_context *self,
static bool
backend_ws_fail (struct ws_context *self, enum ws_status reason)
{
uint8_t payload[2] = { reason << 8, reason };
uint8_t payload[2] = { reason >> 8, reason };
(void) backend_ws_send_control (self, WS_OPCODE_CLOSE,
payload, sizeof payload);