Changeset 40835 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Apr 9, 2012 8:13:57 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77350
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r40583 r40835 1307 1307 || (so->so_close == 1)) 1308 1308 { 1309 struct socket *pPrevSo = NULL; 1310 /** 1311 * we need easy way to detection mechanism if socket has been freed or not 1312 * before continuing any further diagnostic. 1313 */ 1314 pPrevSo = so->so_prev; 1315 AssertPtr(pPrevSo); 1309 1316 /* 1310 1317 * drain the socket 1311 1318 */ 1312 for (; ;)1319 for (; pPrevSo->so_next == so ;) 1313 1320 { 1314 1321 ret = soread(pData, so); 1315 1322 if (ret > 0) 1316 1323 TCP_OUTPUT(pData, sototcpcb(so)); 1317 else 1324 else if (pPrevSo->so_next == so) 1318 1325 { 1319 1326 Log2(("%R[natsock] errno %d (%s)\n", so, errno, strerror(errno))); … … 1321 1328 } 1322 1329 } 1323 /* mark the socket for termination _after_ it was drained */ 1324 so->so_close = 1; 1325 /* No idea about Windows but on Posix, POLLHUP means that we can't send more. 1326 * Actually in the specific error scenario, POLLERR is set as well. */ 1330 if (pPrevSo->so_next == so) 1331 { 1332 /* mark the socket for termination _after_ it was drained */ 1333 so->so_close = 1; 1334 /* No idea about Windows but on Posix, POLLHUP means that we can't send more. 1335 * Actually in the specific error scenario, POLLERR is set as well. */ 1327 1336 #ifndef RT_OS_WINDOWS 1328 if (CHECK_FD_SET(so, NetworkEvents, rderr)) 1329 sofcantsendmore(so); 1330 #endif 1337 if (CHECK_FD_SET(so, NetworkEvents, rderr)) 1338 sofcantsendmore(so); 1339 #endif 1340 } 1331 1341 CONTINUE(tcp); 1332 1342 }
Note:
See TracChangeset
for help on using the changeset viewer.