Changeset 64534 in vbox for trunk/src/VBox/Devices/Network/slirp
- Timestamp:
- Nov 3, 2016 3:30:38 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 111715
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/socket.c
r64346 r64534 377 377 else 378 378 { 379 LogRel 2(("NAT: sockerr %d, shuterr %d - %R[natsock]\n", sockerr, shuterr, so));379 LogRel(("NAT: sockerr %d, shuterr %d - %R[natsock]\n", sockerr, shuterr, so)); 380 380 tcp_drop(pData, sototcpcb(so), sockerr); 381 381 } … … 1118 1118 * If remote closes first and then sends an RST, the recv() in 1119 1119 * soread() will keep reporting EOF without any error 1120 * indication, so we must also check if shutdown() succeeds 1121 * here. 1120 * indication. As far as I can tell the only way to detect 1121 * this on Linux is to check if shutdown() succeeds here (but 1122 * see below). 1123 * 1124 * OTOH on OS X shutdown() "helpfully" checks if remote has 1125 * already closed and then always returns ENOTCONN 1126 * immediately. 1122 1127 */ 1123 int status = shutdown(so->s, 0); 1128 int status = shutdown(so->s, SHUT_RD); 1129 #if defined(RT_OS_LINUX) 1124 1130 if (status < 0) 1125 1131 err = errno; 1132 #else 1133 RT_NOREF(status); 1134 #endif 1126 1135 } 1127 1136 so->so_state &= ~(SS_ISFCONNECTING); 1128 1137 if (so->so_state & SS_FCANTSENDMORE) 1129 1138 { 1139 #if defined(RT_OS_LINUX) 1130 1140 /* 1131 1141 * If we have closed first, and remote closes, shutdown will … … 1135 1145 if (err == ENOTCONN) 1136 1146 err = 0; 1147 #endif 1137 1148 so->so_state = SS_NOFDREF; /* Don't select it */ 1138 1149 /* XXX close() here as well? */
Note:
See TracChangeset
for help on using the changeset viewer.