VirtualBox

Changeset 63672 in vbox


Ignore:
Timestamp:
Aug 31, 2016 10:20:23 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
110418
Message:

NAT: soread - save errno from recv(2) that we check later on as it may
be clobbered by logging in the debug build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r63668 r63672  
    244244    struct iovec iov[2];
    245245    int mss = so->so_tcpcb->t_maxseg;
     246    int sockerr;
    246247
    247248    STAM_PROFILE_START(&pData->StatIOread, a);
     
    321322    nn = recv(so->s, iov[0].iov_base, iov[0].iov_len, (so->so_tcpcb->t_force? MSG_OOB:0));
    322323#endif
     324    sockerr = errno;  /* save it, as it may be clobbered by logging */
    323325    Log2(("%s: read(1) nn = %d bytes\n", RT_GCC_EXTENSION __PRETTY_FUNCTION__, nn));
    324326    Log2(("%s: so = %R[natsock] so->so_snd = %R[sbuf]\n", RT_GCC_EXTENSION __PRETTY_FUNCTION__, so, sb));
     
    344346        }
    345347        if (   nn < 0
    346             && soIgnorableErrorCode(errno))
     348            && soIgnorableErrorCode(sockerr))
    347349        {
    348350            SOCKET_UNLOCK(so);
     
    358360            /* nn == 0 means peer has performed an orderly shutdown */
    359361            Log2(("%s: disconnected, nn = %d, errno = %d (%s)\n",
    360                   RT_GCC_EXTENSION __PRETTY_FUNCTION__, nn, errno, strerror(errno)));
     362                  RT_GCC_EXTENSION __PRETTY_FUNCTION__, nn, sockerr, strerror(sockerr)));
    361363            sofcantrcvmore(so);
    362364            if (!fUninitializedTemplate)
    363365                tcp_sockclosed(pData, sototcpcb(so));
    364366            else
    365                 tcp_drop(pData, sototcpcb(so), errno);
     367                tcp_drop(pData, sototcpcb(so), sockerr);
    366368            SOCKET_UNLOCK(so);
    367369            STAM_PROFILE_STOP(&pData->StatIOread, a);
Note: See TracChangeset for help on using the changeset viewer.

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