From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:30 +0000 (-0700) Subject: Add an error return to asyncsocket X-Git-Tag: stable-10.2.0~294 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cb35ce39ee24ea40fca08a0913dac79c662cf2d;p=thirdparty%2Fopen-vm-tools.git Add an error return to asyncsocket Change asyncsocket to return a ASOCKERR_REMOTE_DISCONNECT when a disconnection is detected during a send attempt. --- diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c index 786acb340..7a2a28db6 100644 --- a/open-vm-tools/lib/asyncsocket/asyncsocket.c +++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c @@ -3465,7 +3465,11 @@ AsyncTCPSocketWriteBuffers(AsyncTCPSocket *s) // IN } else if ((error = ASOCK_LASTERROR()) != ASOCK_EWOULDBLOCK) { TCPSOCKLG0(s, ("send error %d: %s\n", error, Err_Errno2String(error))); s->genericErrno = error; - result = ASOCKERR_GENERIC; + if (error == ASOCK_EPIPE || error == ASOCK_ECONNRESET) { + result = ASOCKERR_REMOTE_DISCONNECT; + } else { + result = ASOCKERR_GENERIC; + } goto exit; } else { /*