VirtualBox

Changeset 106678 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Oct 25, 2024 7:36:01 AM (4 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165547
Message:

Devices/Network: fix stray typo, fix nat notify pipe draining. bugref:10268

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvNATlibslirp.cpp

    r106675 r106678  
    778778            size_t cbRead;
    779779            uint64_t cbWakeupNotifs = ASMAtomicReadU64(&pThis->cbWakeupNotifs);
    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             }
     780            RTPipeRead(pThis->hPipeRead, &ch[0], RT_MIN(cbWakeupNotifs, 1024), &cbRead);
     781            ASMAtomicSubU64(&pThis->cbWakeupNotifs, cbRead);
    791782        }
    792783
     
    800791        slirp_pollfds_fill(pThis->pNATState->pSlirp, &msTimeout, drvNAT_AddPollCb /* SlirpAddPollCb */, pThis /* opaque */);
    801792        drvNAT_UpdateTimeout(&msTimeout, pThis);
    802 .h
     793
    803794        int cChangedFDs = WSAPoll(pThis->pNATState->polls, pThis->pNATState->nsock, msTimeout /* timeout */);
    804795        int error = WSAGetLastError();
     
    820811            size_t cbRead;
    821812            uint64_t cbWakeupNotifs = ASMAtomicReadU64(&pThis->cbWakeupNotifs);
    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             }
     813            cbRead = recv(pThis->pWakeupSockPair[1], &ch[0], RT_MIN(cbWakeupNotifs, 1024), NULL);
     814            ASMAtomicSubU64(&pThis->cbWakeupNotifs, cbRead);
    833815        }
    834816
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette