From: John Hodge Date: Sun, 20 Feb 2011 08:22:07 +0000 (+0800) Subject: Fixed timeout for coke handler X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=9509d10fe69bf2084adbe3c7714a9b1fa20e8318;p=tpg%2Fopendispense2.git Fixed timeout for coke handler --- 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);