Fixed timeout for coke handler
authorJohn Hodge <[email protected]>
Sun, 20 Feb 2011 08:22:07 +0000 (16:22 +0800)
committerJohn Hodge <[email protected]>
Sun, 20 Feb 2011 08:22:07 +0000 (16:22 +0800)
src/server/handler_coke.c

index 9ec2576..4eb3710 100644 (file)
@@ -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);

UCC git Repository :: git.ucc.asn.au