diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2012-02-25 11:36:16 +0100 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2012-02-25 11:36:16 +0100 |
commit | 29aa15f713f9d0baded0ebdc3cb3f7be46df0ccb (patch) | |
tree | 560eeb6186533f41a2b1e4a13258f46366635cbd /src/task_proto.cc | |
parent | 48fdf4cb3b39fdce585582d8714e18784d3f4b68 (diff) |
Now handling protocol as described - with quoting with '"' and escaping of '"'.
Now handling multiple cmd's in one msg.
Diffstat (limited to 'src/task_proto.cc')
-rw-r--r-- | src/task_proto.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/task_proto.cc b/src/task_proto.cc index f1d22d1..39232dd 100644 --- a/src/task_proto.cc +++ b/src/task_proto.cc @@ -172,8 +172,10 @@ int callback_lws_task(struct libwebsocket_context * context, char buf[1024]; size_t buf_len = 0; - msg_t m = parse_msg(data)[0]; - + MsgVector msglist = parse_msg(data); + MsgVector::iterator it_msg; + for(it_msg = msglist.begin(); it_msg != msglist.end(); it_msg++) { + msg_t m = *it_msg; switch(m.cmd) { case cmd::add: { printf("Handling add cmd:\n"); @@ -279,6 +281,7 @@ int callback_lws_task(struct libwebsocket_context * context, libwebsocket_callback_on_writable_all_protocol(libwebsockets_get_protocol(wsi)); //libwebsocket_rx_flow_control(wsi, 0); } + } break; /* * this just demonstrates how to use the protocol filter. If you won't |