]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add an error return to asyncsocket
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:30 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:30 +0000 (11:23 -0700)
Change asyncsocket to return a ASOCKERR_REMOTE_DISCONNECT when a
disconnection is detected during a send attempt.

open-vm-tools/lib/asyncsocket/asyncsocket.c

index 786acb340d61a7362357c91f099c9f5dcdb695f6..7a2a28db64cba61637cbc9dd2a3b68c8f087b511 100644 (file)
@@ -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 {
          /*