VirtualBox

Changeset 77324 in vbox


Ignore:
Timestamp:
Feb 14, 2019 9:23:14 PM (6 years ago)
Author:
vboxsync
Message:

Devices/Serial: Don't try to process data if the either the buffer is full or there is nothing to process

Location:
trunk/src/VBox/Devices/Serial
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DrvChar.cpp

    r76553 r77324  
    259259            if (fEvtsRecv & RTPOLL_EVT_WRITE)
    260260            {
    261                 if (pThis->fAvailWrInt)
     261                if (   pThis->fAvailWrInt
     262                    && pThis->cbTxUsed < RT_ELEMENTS(pThis->abTxBuf))
    262263                {
    263264                    /* Stuff as much data into the TX buffer as we can. */
     
    284285                    {
    285286                        pThis->cbTxUsed -= cbProcessed;
    286                         if (pThis->cbTxUsed)
     287                        if (   pThis->cbTxUsed
     288                            && cbProcessed)
    287289                        {
    288290                            /* Move the data in the TX buffer to the front to fill the end again. */
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r76553 r77324  
    418418            if (fEvtsRecv & RTSERIALPORT_EVT_F_DATA_TX)
    419419            {
    420                 if (pThis->fAvailWrInt)
     420                if (   pThis->fAvailWrInt
     421                    && pThis->cbTxUsed < RT_ELEMENTS(pThis->abTxBuf))
    421422                {
    422423                    /* Stuff as much data into the TX buffer as we can. */
     
    443444                    {
    444445                        pThis->cbTxUsed -= cbProcessed;
    445                         if (pThis->cbTxUsed)
     446                        if (   pThis->cbTxUsed
     447                            && cbProcessed)
    446448                        {
    447449                            /* Move the data in the TX buffer to the front to fill the end again. */
    448                             memmove(&pThis->abTxBuf[0], &pThis->abTxBuf[cbProcessed], pThis->cbTxUsed);
    449                         }
     450                            memmove(&pThis->abTxBuf[0], &pThis->abTxBuf[cbProcessed], pThis->cbTxUsed);                        }
    450451                        else
    451452                            pThis->pDrvSerialPort->pfnDataSentNotify(pThis->pDrvSerialPort);
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