VirtualBox

Changeset 45697 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Apr 24, 2013 1:30:50 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85242
Message:

GuestCtrl: Various bugfixes required for test driver to pass.

File:
1 edited

Legend:

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

    r45482 r45697  
    332332                                rc = VERR_INVALID_PARAMETER;
    333333
    334                             if (paDstParms[i].u.pointer.size < mpParms[i].u.pointer.size)
     334                            if (   RT_SUCCESS(rc)
     335                                && paDstParms[i].u.pointer.size < mpParms[i].u.pointer.size)
    335336                                rc = VERR_BUFFER_OVERFLOW;
    336337
     
    525526        mHostCmdRc    = VINF_SUCCESS;
    526527        mHostCmdTries = 0;
     528        mPeekCount    = 0;
    527529
    528530        return nextItem;
     
    630632        int rc = VINF_SUCCESS;
    631633
    632         LogFlowFunc(("[Client %RU32] pConnection=%p, mHostCmdRc=%Rrc, mHostCmdTries=%RU32\n",
    633                       mID, pConnection, mHostCmdRc, mHostCmdTries));
     634        LogFlowFunc(("[Client %RU32] pConnection=%p, mHostCmdRc=%Rrc, mHostCmdTries=%RU32, mPeekCount=%RU32\n",
     635                      mID, pConnection, mHostCmdRc, mHostCmdTries, mPeekCount));
    634636
    635637        mHostCmdRc = SendReply(pConnection, pHostCmd);
     
    644646            /*
    645647             * If the client understood the message but supplied too little buffer space
    646              * don't send this message again and drop it after 3 unsuccessful attempts.
    647              * The host then should take care of next actions (maybe retry it with a smaller buffer).
     648             * don't send this message again and drop it after 6 unsuccessful attempts.
     649             *
     650             * Note: Due to legacy reasons this the retry counter has to be even because on
     651             *       every peek there will be the actual command retrieval from the client side.
     652             *       To not get the actual command if the client actually only wants to peek for
     653             *       the next command, there needs to be two rounds per try, e.g. 3 rounds = 6 tries.
     654             *
     655             ** @todo Fix the mess stated above. GUEST_MSG_WAIT should be become GUEST_MSG_PEEK, *only*
     656             *        (and every time) returning the next upcoming host command (if any, blocking). Then
     657             *        it's up to the client what to do next, either peeking again or getting the actual
     658             *        host command via an own GUEST_ type message.
    648659             */
    649660            if (mHostCmdRc == VERR_TOO_MUCH_DATA)
    650661            {
    651                 if (mHostCmdTries >= 3)
     662                if (mHostCmdTries == 6)
    652663                    fRemove = true;
    653664            }
     
    777788        else
    778789        {
     790            /* If this is the very first peek, make sure to *always* give back the peeking answer
     791             * instead of the actual command, even if this command would fit into the current
     792             * connection buffer. */
    779793            if (!mPeekCount)
    780794            {
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