Fixed timeout for coke handler
[tpg/opendispense2.git] / src / server / handler_coke.c
index 79ae262..4eb3710 100644 (file)
@@ -196,6 +196,15 @@ int Coke_DoDispense(int UNUSED(User), int Item)
                printf("Coke_DoDispense: sending 'd7'\n");
                #endif
                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

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