Merge branch 'master' of ssh.ucc.asn.au:tpg/acess2
[tpg/acess2.git] / AcessNative / ld-acess_src / request.c
index 1560eb7..c9e8565 100644 (file)
@@ -293,7 +293,7 @@ int ReadData(void *Dest, int MaxLength, int Timeout)
        
        if( !ret ) {
                printf("[ERROR %i] Timeout reading from socket\n", giSyscall_ClientID);
-               return 0;       // Timeout
+               return -2;      // Timeout
        }
        
        #if USE_TCP
@@ -307,6 +307,10 @@ int ReadData(void *Dest, int MaxLength, int Timeout)
                perror("ReadData");
                exit(-1);
        }
+       if( ret == 0 ) {
+               fprintf(stderr, "[ERROR %i] Connection closed.\n", giSyscall_ClientID);
+               exit(0);
+       }
        
        DEBUG_S("%i bytes read from socket\n", ret);
        

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