VirtualBox

Changeset 16611 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Feb 10, 2009 3:30:04 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
42577
Message:

NAT:Poll specific error handling was added

File:
1 edited

Legend:

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

    r16578 r16611  
    3131
    3232#  define DO_CHECK_FD_SET(so, events, fdset) (FD_ISSET((so)->s, fdset))
     33#  define DO_UNIX_CHECK_FD_SET(so, events, fdset )  0 /*specific for Unix API */
    3334# else /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    3435#  define DO_ENGAGE_EVENT1(so, fdset, label)            \
     
    5152#  define DO_POLL_EVENTS(rc, error, so, events, label) do {} while (0)
    5253
    53 #  define DO_CHECK_FD_SET(so, events, fdset) (  ((so)->so_poll_index != -1)                     \
    54                                                 && ((so)->so_poll_index <= ndfs)                \
    55                                                 && ((so)->s == polls[so->so_poll_index].fd)     \
     54#  define DO_CHECK_FD_SET(so, events, fdset) (  ((so)->so_poll_index != -1)                                     \
     55                                                && ((so)->so_poll_index <= ndfs)                                \
     56                                                && ((so)->s == polls[so->so_poll_index].fd)                     \
    5657                                                && (polls[(so)->so_poll_index].revents & N_(fdset ## _poll)))
     58#  define DO_UNIX_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset) /*specific for Unix API */
     59#  define DO_WIN_CHECK_FD_SET(so, events, fdset ) 0 /* specific for Windows Winsock API */
    5760# endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    5861
    59 #  define DO_WIN_CHECK_FD_SET(so, events, fdset ) 0 /* specific for Windows Winsock API */
    6062# ifndef RT_OS_WINDOWS
    6163
     
    7981    } while (0)
    8082# else /* !RT_OS_WINDOWS */
     83#  define DO_WIN_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset)
    8184#  define ICMP_ENGAGE_EVENT(so, fdset) do {} while(0)
    8285#endif /* RT_OS_WINDOWS */
     
    130133    (((events).lNetworkEvents & fdset ## _win) && ((events).iErrorCode[fdset ## _win_bit] == 0))
    131134
    132 # define DO_WIN_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset)
     135# define DO_UNIX_CHECK_FD_SET(so, events, fdset ) 1 /*specific for Unix API */
    133136
    134137#endif /* defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */
     
    154157#define WIN_CHECK_FD_SET(so, events, set)           \
    155158    (DO_WIN_CHECK_FD_SET((so), (events), set))
     159#define UNIX_CHECK_FD_SET(so, events, set) \
     160    (DO_UNIX_CHECK_FD_SET(so, events, set))
    156161
    157162/*
     
    10751080            } /* SS_ISFCONNECTING */
    10761081#endif
     1082#ifndef RT_OS_WINDOWS
     1083            if (   UNIX_CHECK_FD_SET(so, NetworkEvents, rdhup)
     1084                && UNIX_CHECK_FD_SET(so, NetworkEvents, rderr))
     1085            {
     1086                if (so->so_state & SS_ISFCONNECTING)
     1087                {
     1088                    so->so_state = SS_NOFDREF;
     1089                    TCP_INPUT(pData, (struct mbuf *)NULL, sizeof(struct ip), so);
     1090                }
     1091                /* Here should be other error handlings */
     1092            }
     1093#endif
    10771094            LOOP_LABEL(tcp, so, so_next);
    10781095        }
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