VirtualBox

Changeset 60910 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
May 9, 2016 9:00:28 PM (9 years ago)
Author:
vboxsync
Message:

iprt/socket.cpp: set *pcbWritten to 0 on windows too when returning VINF_TRY_AGAIN. Don't bother check whether VINF_SUCCESS is VERR_TRY_AGAIN! Makes the code harder to read and potentially slower.

File:
1 edited

Legend:

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

    r60902 r60910  
    12671267    }
    12681268    else
     1269    {
    12691270        rc = rtSocketError();
    1270 
    1271     if (rc == VERR_TRY_AGAIN)
    1272     {
    1273         *pcbRead = 0;
    1274         rc = VINF_TRY_AGAIN;
    1275     }
     1271        if (rc == VERR_TRY_AGAIN)
     1272        {
     1273            *pcbRead = 0;
     1274            rc = VINF_TRY_AGAIN;
     1275        }
     1276    }
     1277
    12761278#else
    12771279    ssize_t cbRead = recv(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL);
     
    13281330    }
    13291331    else
     1332    {
    13301333        rc = rtSocketError();
    1331 
    1332     if (rc == VERR_TRY_AGAIN)
    1333         rc = VINF_TRY_AGAIN;
     1334        if (rc == VERR_TRY_AGAIN)
     1335        {
     1336            *pcbWritten = 0;
     1337            rc = VINF_TRY_AGAIN;
     1338        }
     1339    }
    13341340#else
    13351341    ssize_t cbWritten = send(pThis->hNative, pvBuffer, cbBuffer, MSG_NOSIGNAL);
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