Changeset 52662 in vbox
- Timestamp:
- Sep 9, 2014 9:46:19 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r52283 r52662 967 967 LOG_NAT_SOCK(so, TCP, &NetworkEvents, readfds, writefds, xfds); 968 968 969 /*970 * It's hard to hide error condition check behind existing971 * macros without uglifying them further, so open-code it here972 * 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 #else990 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 #endif998 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 else1007 {1008 tcp_drop(pData, sototcpcb(so), pollerr);1009 }1010 ret = slirpVerifyAndFreeSocket(pData, so);1011 Assert(ret == 1); /* freed */1012 CONTINUE(tcp);1013 }1014 }1015 969 1016 970 /* … … 1116 1070 /* mark the socket for termination _after_ it was drained */ 1117 1071 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_WINDOWS 1075 if (CHECK_FD_SET(so, NetworkEvents, rderr)) 1076 sofcantsendmore(so); 1077 #endif 1118 1078 } 1119 1079 if (so_next->so_prev == so)
Note:
See TracChangeset
for help on using the changeset viewer.