Changeset 16755 in vbox
- Timestamp:
- Feb 14, 2009 3:59:57 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r16725 r16755 8 8 #include <iprt/assert.h> 9 9 #ifndef RT_OS_WINDOWS 10 #include <sys/ioctl.h> 10 11 #include <poll.h> 11 12 #endif … … 1107 1108 #ifndef RT_OS_WINDOWS 1108 1109 if ( UNIX_CHECK_FD_SET(so, NetworkEvents, rdhup) 1109 && UNIX_CHECK_FD_SET(so, NetworkEvents, rderr)) 1110 { 1110 || UNIX_CHECK_FD_SET(so, NetworkEvents, rderr)) 1111 { 1112 int err; 1113 int inq, outq; 1114 int status; 1115 inq = -1; 1116 socklen_t optlen = sizeof(int); 1117 status = getsockopt(so->s, SOL_SOCKET, SO_ERROR, &err, &optlen); 1118 AssertRelease(status == 0 ); 1119 status = ioctl(so->s, FIONREAD, &inq); /* tcp(7) recommends SIOCINQ which is Linux specific */ 1120 AssertRelease(status == 0 || status == EINVAL);/* EINVAL returned if socket in listen state tcp(7)*/ 1121 status = ioctl(so->s, TIOCOUTQ, &outq); /* SIOCOUTQ see previous comment */ 1122 AssertRelease(status == 0); 1123 1111 1124 if ( so->so_state & SS_ISFCONNECTING 1112 || (polls[poll_index].revents & POLLIN) != 0)1125 || UNIX_CHECK_FD_SET(so, NetworkEvents, readfds)) 1113 1126 { 1114 1127 /** … … 1116 1129 * @todo try with proxy server 1117 1130 */ 1118 if ((polls[poll_index].revents & POLLIN) != 0) 1119 LogRel(("NAT: err happens on read I/O, other side close connection \n")); 1131 if (UNIX_CHECK_FD_SET(so, NetworkEvents, readfds)) 1132 { 1133 /* 1134 * Never meet inq != 0 or outq != 0, anyway let it stay for a while 1135 * in case it happens we'll able to detect it. 1136 */ 1137 LogRel(("NAT:%R[natsock] err(%d:%s) s(in:%d,out:%d)happens on read I/O, " 1138 "other side close connection \n", so, err, strerror(err), inq, outq)); 1139 } 1120 1140 so->so_state = SS_NOFDREF; 1121 1141 TCP_INPUT(pData, (struct mbuf *)NULL, sizeof(struct ip), so); 1122 1142 CONTINUE(tcp); 1123 1143 } 1144 LogRel(("NAT:%R[natsock] we've met(%d:%s) s(in:%d, out:%d) unhandled combination hup (%d) " 1145 "rederr(%d) on (r:%d, w:%d, x:%d)\n", 1146 so, err, strerror(err), 1147 inq, outq, 1148 UNIX_CHECK_FD_SET(so, ign, rdhup), 1149 UNIX_CHECK_FD_SET(so, ign, rderr), 1150 UNIX_CHECK_FD_SET(so, ign, readfds), 1151 UNIX_CHECK_FD_SET(so, ign, writefds), 1152 UNIX_CHECK_FD_SET(so, ign, xfds))); 1124 1153 /* Here should be other error handlings */ 1125 1154 AssertRelease(!"shouldn't be here!!!");
Note:
See TracChangeset
for help on using the changeset viewer.