VirtualBox

Changeset 40657 in vbox


Ignore:
Timestamp:
Mar 27, 2012 8:24:39 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77089
Message:

GuestControl/service: Fixed increasing the retry count of current host command.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestControl/service.cpp

    r39441 r40657  
    692692         * Get the next unassigned host command in the list.
    693693         */
    694          HostCmd curCmd = mHostCmds.front();
     694         HostCmd &curCmd = mHostCmds.front();
    695695         rc = assignHostCmdToGuest(&curCmd, callHandle, cParms, paParms);
    696696         if (RT_SUCCESS(rc))
     
    706706             mHostCmds.pop_front();
    707707         }
    708          else if (rc == VERR_BUFFER_OVERFLOW)
     708         else
    709709         {
     710             bool fRemoveCmd = false;
     711             uint32_t uTries = curCmd.mTries++;
     712
    710713             /* If the client understood the message but supplied too little buffer space
    711714              * don't send this message again and drop it after 3 unsuccessful attempts.
    712715              * The host then should take care of next actions (maybe retry it with a smaller buffer). */
    713              if (++curCmd.mTries >= 3)
     716             if (   rc     == VERR_BUFFER_OVERFLOW
     717                 && uTries >= 3)
    714718             {
    715                  paramBufferFree(&curCmd.mParmBuf);
    716                  mHostCmds.pop_front();
     719                 fRemoveCmd = true;
    717720             }
    718          }
    719          else
    720          {
    721721             /* Client did not understand the message or something else weird happened. Try again one
    722722              * more time and drop it if it didn't get handled then. */
    723              if (++curCmd.mTries > 1)
     723             else if (uTries > 1)
     724                 fRemoveCmd = true;
     725
     726             if (fRemoveCmd)
    724727             {
    725728                 paramBufferFree(&curCmd.mParmBuf);
Note: See TracChangeset for help on using the changeset viewer.

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