Changeset 14189 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Nov 13, 2008 5:13:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r14121 r14189 121 121 int rc; 122 122 /*notify select to wakeup*/ 123 memcpy(pThis->cBuffer,pvBuf, cb); 123 AssertRelease(cb <= sizeof(pThis->cBuffer)); 124 memcpy(pThis->cBuffer, pvBuf, cb); 124 125 pThis->sBufferSize = cb; 125 126 # ifndef RT_OS_WINDOWS … … 180 181 LogFlow(("drvNATNotifyLinkChanged: enmLinkState=%d\n", enmLinkState)); 181 182 183 LogRel(("drvNATNotifyLinkChanged\n")); 182 184 #ifndef VBOX_WITH_SIMPLEFIED_SLIRP_SYNC 183 185 int rc = RTCritSectEnter(&pThis->CritSect); … … 244 246 fd_set XcptFDs; 245 247 int nFDs = -1; 246 int rc;247 248 # ifdef RT_OS_WINDOWS 248 249 DWORD event; … … 256 257 if (pThread->enmState == PDMTHREADSTATE_INITIALIZING) 257 258 return VINF_SUCCESS; 259 260 #ifdef RT_OS_WINDOWS 261 phEvents = slirp_get_events(pThis->pNATState); 262 #endif 258 263 259 264 /* … … 302 307 } 303 308 # else /* RT_OS_WINDOWS */ 304 phEvents = slirp_get_events(pThis->pNATState);305 309 event = WSAWaitForMultipleEvents(nFDs, phEvents, FALSE, 2 /*ms*/, FALSE); 306 AssertRelease(event != WSA_WAIT_FAILED); 307 308 if (event == WSA_WAIT_TIMEOUT) { 310 if ( (event < WSA_WAIT_EVENT_0 || event > WSA_WAIT_EVENT_0 + nFDs - 1) 311 && event != WSA_WAIT_TIMEOUT) 312 { 313 int error = WSAGetLastError(); 314 LogRel(("WSAWaitForMultipleEvents returned %d (error %d)\n", event, error)); 315 RTAssertReleasePanic(); 316 } 317 318 if (event == WSA_WAIT_TIMEOUT) 319 { 309 320 slirp_select_poll(pThis->pNATState, NULL, NULL, NULL); 310 311 321 continue; 322 } 312 323 313 324 /* 314 325 * see WSAWaitForMultipleEvents documentation: return value is a minimal index in array 315 326 */ 316 if ((event - WSA_WAIT_EVENT_0) > 0) {327 if ((event - WSA_WAIT_EVENT_0) > 0) 317 328 slirp_select_poll(pThis->pNATState, &ReadFDs, &WriteFDs, &XcptFDs); 318 }319 329 320 330 if ((event - WSA_WAIT_EVENT_0) == 0) … … 696 706 # else 697 707 pThis->hSendEvent = WSACreateEvent(); 698 708 slirp_register_external_event(pThis->pNATState, pThis->hSendEvent); 699 709 # endif 700 710
Note:
See TracChangeset
for help on using the changeset viewer.