From: John Hodge Date: Thu, 4 Oct 2012 13:52:23 +0000 (+0800) Subject: AcessNative - Handling for connection closures X-Git-Tag: rel0.15~694^2~1 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1cbe6bb7cb39e4aff37c541fa45f56432dbe9d53;p=tpg%2Facess2.git AcessNative - Handling for connection closures --- diff --git a/AcessNative/ld-acess_src/request.c b/AcessNative/ld-acess_src/request.c index 7a9b3b39..63419d56 100644 --- a/AcessNative/ld-acess_src/request.c +++ b/AcessNative/ld-acess_src/request.c @@ -275,7 +275,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 @@ -289,6 +289,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);