From 9509d10fe69bf2084adbe3c7714a9b1fa20e8318 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 20 Feb 2011 16:22:07 +0800 Subject: [PATCH] Fixed timeout for coke handler --- src/server/handler_coke.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server/handler_coke.c b/src/server/handler_coke.c index 9ec2576..4eb3710 100644 --- a/src/server/handler_coke.c +++ b/src/server/handler_coke.c @@ -198,6 +198,14 @@ int Coke_DoDispense(int UNUSED(User), int Item) Writef("d7\r\n"); ret ++; } + if( ret == 3 ) + { + #if TRACE_COKE + printf("Coke_DoDispense: timed out\n"); + #endif + pthread_mutex_unlock(&gCoke_Mutex); + return -1; + } #if TRACE_COKE printf("Coke_DoDispense: sending 'd%i'\n", Item); -- 2.20.1