Changeset 15077 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Dec 8, 2008 3:37:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r15054 r15077 10 10 #include <VBox/pdmdrv.h> 11 11 #include <iprt/assert.h> 12 13 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) 14 # if !defined(RT_OS_WINDOWS) 15 # define DO_ENGAGE_EVENT1(so, fdset, label) \ 16 do { \ 17 FD_SET((so)->s, (fdset0)); \ 18 UPD_NFDS((so)->s); \ 19 while(0) 20 21 22 # define DO_ENGAGE_EVENT2(so, fdset0, fdset1, label) \ 23 do { \ 24 FD_SET((so)->s, (fdset0)); \ 25 FD_SET((so)->s, (fdset1)); \ 26 UPD_NFDS((so)->s); \ 27 while(0) 28 # else /* !RT_OS_WINDOWS */ 29 # define DO_ENGAGE_EVENT1(so, fdset0, label) \ 30 goto label; 31 32 # define DO_ENGAGE_EVENT2(so, fdset0, fdset1, label) DO_ENGAGE_EVENT1((so), (fdset0), label) 33 # endif /* RT_OS_WINDOWS */ 34 35 # define TCP_ENGAGE_EVENT1(so, fdset0) \ 36 DO_ENGAGE_EVENT1((so), (fdset0), tcp_engage_event) 37 38 # define TCP_ENGAGE_EVENT2(so, fdset0, fdset1) \ 39 DO_ENGAGE_EVENT2((so), (fdset0), (fdset1), tcp_engage_event) 40 #endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */ 12 41 13 42 static const uint8_t special_ethaddr[6] = { … … 461 490 { 462 491 STAM_REL_COUNTER_INC(&pData->StatTCPHot); 463 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 464 FD_SET(so->s, readfds); 465 UPD_NFDS(so->s); 466 #else 467 engage_event: 492 TCP_ENGAGE_EVENT1(so, readfs); 493 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 494 tcp_engage_event: 468 495 rc = WSAEventSelect(so->s, VBOX_SOCKET_EVENT, FD_ALL_EVENTS); 469 496 if (rc == SOCKET_ERROR) … … 484 511 { 485 512 STAM_REL_COUNTER_INC(&pData->StatTCPHot); 486 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 487 FD_SET(so->s, writefds); 488 UPD_NFDS(so->s); 489 continue; 490 #else 491 goto engage_event; 492 #endif 513 TCP_ENGAGE_EVENT1(so, writefds); 493 514 } 494 515 … … 500 521 { 501 522 STAM_REL_COUNTER_INC(&pData->StatTCPHot); 502 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 503 FD_SET(so->s, writefds); 504 UPD_NFDS(so->s); 505 #else 506 goto engage_event; 507 #endif 523 TCP_ENGAGE_EVENT1(so, writefds); 508 524 } 509 525 … … 515 531 { 516 532 STAM_REL_COUNTER_INC(&pData->StatTCPHot); 517 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 518 FD_SET(so->s, readfds); 519 FD_SET(so->s, xfds); 520 UPD_NFDS(so->s); 521 #else 522 goto engage_event; 523 #endif 533 TCP_ENGAGE_EVENT2(so->s, readfds, xfds); 524 534 } 525 535 } … … 857 867 if (so->s != -1 && FD_ISSET(so->s, readfds)) 858 868 #else 859 if ((NetworkEvents.lNetworkEvents & FD_READ) && (NetworkEvents.iErrorCode[FD_READ_BIT] == 0)) 869 if (((NetworkEvents.lNetworkEvents & FD_READ) && (NetworkEvents.iErrorCode[FD_READ_BIT] == 0)) 870 #ifdef VBOX_WITH_SLIRP_ICMP 871 || (so->s == pData->icmp_socket.s) /* XXX: How check equality of handles */ 872 #endif 873 ) 860 874 #endif 861 875 {
Note:
See TracChangeset
for help on using the changeset viewer.