aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-02-06 20:48:14 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2017-02-06 20:48:14 +0100
commitb85d1d74a435ca706f7285d47bbfd8b48e8778e1 (patch)
treecd0d65c0947b75fea074c29d2bd75c503079ddb8
parentd35e733c6ef9ac43639c1d1361446ecb3e94b6f6 (diff)
downloadjson-rpc-shell-b85d1d74a435ca706f7285d47bbfd8b48e8778e1.tar.gz
json-rpc-shell-b85d1d74a435ca706f7285d47bbfd8b48e8778e1.tar.xz
json-rpc-shell-b85d1d74a435ca706f7285d47bbfd8b48e8778e1.zip
Don't respond to notifications
-rw-r--r--demo-json-rpc-server.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/demo-json-rpc-server.c b/demo-json-rpc-server.c
index 2e855bf..85b54a9 100644
--- a/demo-json-rpc-server.c
+++ b/demo-json-rpc-server.c
@@ -2149,8 +2149,9 @@ client_ws_on_message (void *user_data,
struct str response;
str_init (&response);
process_json_rpc (self->client.ctx, data, len, &response);
- ws_handler_send (&self->handler,
- WS_OPCODE_TEXT, response.str, response.len);
+ if (response.len)
+ ws_handler_send (&self->handler,
+ WS_OPCODE_TEXT, response.str, response.len);
str_free (&response);
return true;
}