VirtualBox

Changeset 23666 in vbox


Ignore:
Timestamp:
Oct 10, 2009 1:18:36 AM (15 years ago)
Author:
vboxsync
Message:

RTTcpRead: recv returns 0 and errno = 0 when the server shuts down the socket in a normal fashion. Return VERR_NET_SHUTDOWN instead of spinning for ever.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/tcp.cpp

    r23665 r23666  
    800800        rtTcpErrorReset();
    801801        ssize_t cbBytesRead = recv(Sock, (char *)pvBuffer + cbRead, cbToRead, MSG_NOSIGNAL);
    802         if (cbBytesRead < 0)
    803             return rtTcpError();
    804         if (cbBytesRead == 0 && rtTcpError())
    805             return rtTcpError();
     802        if (cbBytesRead <= 0)
     803        {
     804            int rc = rtTcpError();
     805            Assert(RT_FAILURE_NP(rc) || cbBytesRead == 0);
     806            if (RT_FAILURE_NP(rc))
     807                return rc;
     808            if (pcbRead)
     809            {
     810                *pcbRead = 0;
     811                return VINF_SUCCESS;
     812            }
     813            return VERR_NET_SHUTDOWN;
     814        }
    806815        if (pcbRead)
    807816        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette