From 13b6d9bb553e996f76bc5f9bb1d9f7094e0e104b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Fri, 27 May 2016 23:07:19 +0200 Subject: [PATCH] removes restriction on the count of waiters MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- plugins/samples/tic-tac-toe.c | 16 ---------------- 1 file changed, 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; -- 2.16.6