From b4f3419a47ba418d57eb40650c954a66d0276f28 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 6 Oct 2015 09:24:12 +0200 Subject: [PATCH] Quit properly when the socket is died --- src/DDClientLibCpp/DD_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DDClientLibCpp/DD_client.cc b/src/DDClientLibCpp/DD_client.cc index 832763d..d68d6af 100644 --- a/src/DDClientLibCpp/DD_client.cc +++ b/src/DDClientLibCpp/DD_client.cc @@ -268,7 +268,7 @@ int DD_Client::ReceiveFromNet(char *buf, int PacketSize) int i = 0; int cc = 0; while(( (cc = recv(SocketID,buf+ CurLength,PacketSize - CurLength,0)) < 0) && (i < TRY)) i++; - if(cc < 0) return -1; + if(cc <= 0) return -1; CurLength = CurLength + cc; } while(CurLength < PacketSize); return 1; -- libgit2 0.21.2