Changeset 106675 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Oct 24, 2024 9:37:40 PM (4 months ago)
- svn:sync-xref-src-repo-rev:
- 165539
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNATlibslirp.cpp
r106619 r106675 775 775 * so to avoid false alarm drain pipe here to the very end 776 776 */ 777 char ch ;777 char ch[1024]; 778 778 size_t cbRead; 779 779 uint64_t cbWakeupNotifs = ASMAtomicReadU64(&pThis->cbWakeupNotifs); 780 RTPipeRead(pThis->hPipeRead, &ch, cbWakeupNotifs, &cbRead); 781 ASMAtomicSubU64(&pThis->cbWakeupNotifs, cbRead); 780 781 if (cbWakeupNotifs > 1024) 782 { 783 RTPipeRead(pThis->hPipeRead, &ch, 1024, &cbRead); 784 ASMAtomicSubU64(&pThis->cbWakeupNotifs, 1024); 785 } 786 else 787 { 788 RTPipeRead(pThis->hPipeRead, &ch, cbWakeupNotifs, &cbRead); 789 ASMAtomicSubU64(&pThis->cbWakeupNotifs, cbRead); 790 } 782 791 } 783 792 … … 791 800 slirp_pollfds_fill(pThis->pNATState->pSlirp, &msTimeout, drvNAT_AddPollCb /* SlirpAddPollCb */, pThis /* opaque */); 792 801 drvNAT_UpdateTimeout(&msTimeout, pThis); 793 802 .h 794 803 int cChangedFDs = WSAPoll(pThis->pNATState->polls, pThis->pNATState->nsock, msTimeout /* timeout */); 795 804 int error = WSAGetLastError(); … … 808 817 * so to avoid false alarm drain pipe here to the very end 809 818 */ 810 char ch ;819 char ch[1024]; 811 820 size_t cbRead; 812 821 uint64_t cbWakeupNotifs = ASMAtomicReadU64(&pThis->cbWakeupNotifs); 813 cbRead = recv(pThis->pWakeupSockPair[1], &ch, cbWakeupNotifs, NULL); 814 ASMAtomicSubU64(&pThis->cbWakeupNotifs, cbRead); 822 823 if (cbWakeupNotifs > 1024) 824 { 825 cbRead = recv(pThis->pWakeupSockPair[1], &ch, 1024, NULL); 826 ASMAtomicSubU64(&pThis->cbWakeupNotifs, 1024); 827 } 828 else 829 { 830 cbRead = recv(pThis->pWakeupSockPair[1], &ch, cbWakeupNotifs, NULL); 831 ASMAtomicSubU64(&pThis->cbWakeupNotifs, cbRead); 832 } 815 833 } 816 834
Note:
See TracChangeset
for help on using the changeset viewer.