diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-05-27 23:07:19 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-05-27 23:07:19 +0200 |
commit | 13b6d9bb553e996f76bc5f9bb1d9f7094e0e104b (patch) | |
tree | 39a52d2a6ad9aa745e1a9f4c870814e885d3689b | |
parent | d96d0533b8326570db57d13b8f808bc62d1a7fa4 (diff) |
removes restriction on the count of waiters
in fact, using more than on web socket, the same client (same session)
can lock itself using wait and unlock itself using move...
Change-Id: I4ebd8fa93d3373589e9bb7fac7c250e29f94c460
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | plugins/samples/tic-tac-toe.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/plugins/samples/tic-tac-toe.c b/plugins/samples/tic-tac-toe.c index c372e99f..31682d94 100644 --- a/plugins/samples/tic-tac-toe.c +++ b/plugins/samples/tic-tac-toe.c @@ -549,7 +549,6 @@ static void play(struct afb_req req) static void wait(struct afb_req req) { - int count; struct board *board; struct waiter *waiter; @@ -557,21 +556,6 @@ static void wait(struct afb_req req) board = board_of_req(req); INFO(afbitf, "method 'wait' called for boardid %d", board->id); - /* counts the waiters */ - count = 0; - waiter = board->waiters; - while (waiter != NULL) { - count++; - waiter = waiter->next; - } - - /* checks ability to wait */ - if (count + 1 >= board->use_count) { - WARNING(afbitf, "can't wait: count=%d and use_count=%d", count, board->use_count); - afb_req_fail(req, "error", "can't wait"); - return; - } - /* creates the waiter and enqueues it */ waiter = calloc(1, sizeof *waiter); waiter->req = req; |