aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2018-05-11 22:33:47 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2018-05-11 22:34:06 +0200
commit2e1127e3711b53f8fa0d3ed6619bed88cbf80ce4 (patch)
treed4dac5cb3c83459d5b38f4e37decc710e9e3cf34
parent5c380878d5b1c3dd677a3674b5bc0bcb4c6aef80 (diff)
downloadjson-rpc-shell-2e1127e3711b53f8fa0d3ed6619bed88cbf80ce4.tar.gz
json-rpc-shell-2e1127e3711b53f8fa0d3ed6619bed88cbf80ce4.tar.xz
json-rpc-shell-2e1127e3711b53f8fa0d3ed6619bed88cbf80ce4.zip
Fix sent close code when failing the connection
-rw-r--r--json-rpc-shell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/json-rpc-shell.c b/json-rpc-shell.c
index 716e74c..7d104a2 100644
--- a/json-rpc-shell.c
+++ b/json-rpc-shell.c
@@ -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);