X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fld-acess_src%2Frequest.c;h=5bcf8cd302c65b9e9e73fcc9f5c3ef3aed350540;hb=a01b96ccf4ec884e5b894d08a819a37ea3f5f749;hp=1560eb7b4ea99a7c05f382ce72749d6d5fd76b42;hpb=c366e1c60e7c6c3fc12be52583dda26ca9fd2b00;p=tpg%2Facess2.git diff --git a/AcessNative/ld-acess_src/request.c b/AcessNative/ld-acess_src/request.c index 1560eb7b..5bcf8cd3 100644 --- a/AcessNative/ld-acess_src/request.c +++ b/AcessNative/ld-acess_src/request.c @@ -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,11 @@ int ReadData(void *Dest, int MaxLength, int Timeout) perror("ReadData"); exit(-1); } + if( ret == 0 ) { + fprintf(stderr, "[ERROR %i] Connection closed.\n", giSyscall_ClientID); + close(gSocket); + exit(0); + } DEBUG_S("%i bytes read from socket\n", ret);