Changeset 52283 in vbox
- Timestamp:
- Aug 5, 2014 3:34:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r52230 r52283 967 967 LOG_NAT_SOCK(so, TCP, &NetworkEvents, readfds, writefds, xfds); 968 968 969 /* 970 * It's hard to hide error condition check behind existing 971 * macros without uglifying them further, so open-code it here 972 * instead. 973 */ 974 { 975 int pollerr = 0; 976 #if defined(RT_OS_WINDOWS) 977 { 978 int bit; 979 for (bit = 0; bit <= FD_CLOSE_BIT; ++bit) 980 { 981 if ( NetworkEvents.lNetworkEvents & (1 << bit) 982 && NetworkEvents.iErrorCode[bit] != 0) 983 { 984 pollerr = NetworkEvents.iErrorCode[bit]; 985 break; 986 } 987 } 988 } 989 #else 990 if (CHECK_FD_SET(so, NetworkEvents, rderr)) 991 { 992 socklen_t optlen = (socklen_t)sizeof(int); 993 ret = getsockopt(so->s, SOL_SOCKET, SO_ERROR, &pollerr, &optlen); 994 if (ret < 0) 995 pollerr = ENETDOWN; 996 } 997 #endif 998 if (pollerr) 999 { 1000 if (so->so_state & SS_ISFCONNECTING) 1001 { 1002 /* "continue" tcp_input() to reject connection from guest */ 1003 so->so_state = SS_NOFDREF; 1004 TCP_INPUT(pData, NULL, 0, so); 1005 } 1006 else 1007 { 1008 tcp_drop(pData, sototcpcb(so), pollerr); 1009 } 1010 ret = slirpVerifyAndFreeSocket(pData, so); 1011 Assert(ret == 1); /* freed */ 1012 CONTINUE(tcp); 1013 } 1014 } 969 1015 970 1016 /* … … 1070 1116 /* mark the socket for termination _after_ it was drained */ 1071 1117 so->so_close = 1; 1072 /* No idea about Windows but on Posix, POLLHUP means that we can't send more.1073 * Actually in the specific error scenario, POLLERR is set as well. */1074 #ifndef RT_OS_WINDOWS1075 if (CHECK_FD_SET(so, NetworkEvents, rderr))1076 sofcantsendmore(so);1077 #endif1078 1118 } 1079 1119 if (so_next->so_prev == so)
Note:
See TracChangeset
for help on using the changeset viewer.