Changeset 14119 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Nov 12, 2008 4:16:50 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r14086 r14119 303 303 # else /* RT_OS_WINDOWS */ 304 304 phEvents = slirp_get_events(pThis->pNATState); 305 phEvents[0] = pThis->hSendEvent;306 305 event = WSAWaitForMultipleEvents(nFDs, phEvents, FALSE, 2 /*ms*/, FALSE); 307 306 AssertRelease(event != WSA_WAIT_FAILED); … … 696 695 # else 697 696 pThis->hSendEvent = WSACreateEvent(); 697 slirp_register_external_event(pThis->pNATState, pThis->hSendEvent); 698 698 # endif 699 699 -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r14028 r14119 51 51 #if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 52 52 HANDLE *slirp_get_events(PNATState pData); 53 HANDLE *slirp_register_external_event(PNATState pData, HANDLE hEvent); 53 54 #endif 54 55 #ifdef __cplusplus -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r14089 r14119 222 222 WSAStartup(MAKEWORD(2,0), &Data); 223 223 } 224 #ifdef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC 225 /*XXX:probably should be configurable*/ 226 pData->phEvents = malloc(sizeof(HANDLE) * pData->cMaxEvent); 227 #endif 224 228 #endif 225 229 … … 307 311 "\n")); 308 312 #endif 313 #if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 314 free(pData->phEvents); 315 #endif 309 316 free(pData); 310 317 } … … 374 381 */ 375 382 cElements = 1; 376 for (so = tcb.so_next; so != &tcb; so = so_next, cElements++)377 so_next = so->so_next;378 for (so = udb.so_next; so != &udb; so = so_next, cElements++)379 so_next = so->so_next;380 if (pData->phEvents != NULL)381 free(pData->phEvents);382 pData->phEvents = malloc(sizeof(HANDLE) * cElements);383 383 #endif 384 384 … … 400 400 401 401 #if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 402 AssertRelease(cEvents >= pData->cMaxEvent); 402 403 WSAResetEvent(so->hNetworkEvent); 403 404 #endif … … 501 502 #else 502 503 WSAResetEvent(so->hNetworkEvent); 504 AssertRelease(cEvents >= pData->cMaxEvent); 503 505 rc = WSAEventSelect(so->s, so->hNetworkEvent, FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT); 504 506 AssertRelease(rc != SOCKET_ERROR); … … 936 938 return (pData->phEvents); 937 939 } 938 #endif 940 HANDLE *slirp_register_external_event(PNATState pData, HANDLE hEvent) 941 { 942 pData->phEvents[0] = hEvent; 943 } 944 #endif -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r14028 r14119 117 117 struct socket *udp_last_so; 118 118 #if defined(VBOX_WITH_SIMPLEFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 119 int cMaxEvent; 119 120 HANDLE *phEvents; 120 121 #endif
Note:
See TracChangeset
for help on using the changeset viewer.