VirtualBox

Ignore:
Timestamp:
Aug 6, 2014 2:08:59 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95398
Message:

NAT/Net: Ouch, FIONBIO argument has been wrong since initial check-in
so on Windows we have been doing blocking connect(). Fortunately,
WSAEventSelect() automatically switches sockets to non-blocking mode
when we start polling them.

Fix it and adjust the test of connect()'s errno, since Windows returns
EWOULDBLOCK instead of EINPROGRESS on non-blocking connect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/proxy.c

    r52286 r52288  
    338338#if defined(RT_OS_WINDOWS)
    339339    {
    340         u_long mode = 0;
     340        u_long mode = 1;
    341341        status = ioctlsocket(s, FIONBIO, &mode);
    342342        if (status == SOCKET_ERROR) {
     
    436436
    437437    status = connect(s, pdst_sa, dst_sa_len);
    438     if (status == SOCKET_ERROR && SOCKERRNO() != EINPROGRESS) {
     438    if (status == SOCKET_ERROR
     439#if !defined(RT_OS_WINDOWS)
     440        && SOCKERRNO() != EINPROGRESS
     441#else
     442        && SOCKERRNO() != EWOULDBLOCK
     443#endif
     444        )
     445    {
    439446        sockerr = SOCKERRNO();
    440447        DPRINTF(("socket %d: connect: %R[sockerr]\n", s, sockerr));
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