Changeset 45482 in vbox for trunk/src/VBox/HostServices/GuestControl/service.cpp
- Timestamp:
- Apr 11, 2013 11:11:42 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/GuestControl/service.cpp
r45417 r45482 103 103 VBOXHGCMSVCPARM *mParms; 104 104 /** The standard constructor. */ 105 ClientConnection(void) : mHandle(0), mNumParms(0), mParms(NULL) {} 105 ClientConnection(void) 106 : mHandle(0), mNumParms(0), mParms(NULL) {} 106 107 } ClientConnection; 107 108 … … 419 420 } 420 421 else 421 LogFlowFunc((" Client has not (yet) submitted enough parameters (%RU32) to at least peak for the next message\n",422 LogFlowFunc(("Warning: Client has not (yet) submitted enough parameters (%RU32, must be at least 2) to at least peak for the next message\n", 422 423 pConnection->mNumParms)); 423 424 … … 479 480 mHostCmdRc(VINF_SUCCESS), mHostCmdTries(0), 480 481 mHostCmdTS(0), 481 mIsPending(false) { } 482 mIsPending(false), 483 mPeekCount(0) { } 482 484 483 485 ClientState(PVBOXHGCMSVCHELPERS pSvcHelpers, uint32_t uClientID) … … 487 489 mHostCmdRc(VINF_SUCCESS), mHostCmdTries(0), 488 490 mHostCmdTS(0), 489 mIsPending(false) { } 491 mIsPending(false), 492 mPeekCount(0){ } 490 493 491 494 void DequeueAll(void) … … 765 768 766 769 int rc; 770 /* If the client is in pending mode, always send back 771 * the peek result first. */ 767 772 if (mIsPending) 768 773 { 769 /* If the client is in pending mode, always send back770 * the peek result first. */771 774 rc = pHostCmd->Peek(pConnection); 775 mPeekCount++; 772 776 } 773 777 else 774 778 { 775 /* Try assigning the host command to the client and store the 776 * result code for later use. */ 777 rc = pHostCmd->Assign(pConnection); 778 if (RT_FAILURE(rc)) /* If something failed, let the client peek (again). */ 779 if (!mPeekCount) 780 { 779 781 rc = pHostCmd->Peek(pConnection); 782 mPeekCount++; 783 } 784 else 785 { 786 /* Try assigning the host command to the client and store the 787 * result code for later use. */ 788 rc = pHostCmd->Assign(pConnection); 789 if (RT_FAILURE(rc)) /* If something failed, let the client peek (again). */ 790 { 791 rc = pHostCmd->Peek(pConnection); 792 mPeekCount++; 793 } 794 else 795 mPeekCount = 0; 796 } 780 797 } 781 798 … … 788 805 mSvcHelpers->pfnCallComplete(pConnection->mHandle, rc); 789 806 790 LogFlowFunc(("[Client %RU32] pConnection=%p, pHostCmd=%p, replyRc=%Rrc\n",791 mID, pConnection, pHostCmd, rc));807 LogFlowFunc(("[Client %RU32] mPeekCount=%RU32, pConnection=%p, pHostCmd=%p, replyRc=%Rrc\n", 808 mID, mPeekCount, pConnection, pHostCmd, rc)); 792 809 return rc; 793 810 } … … 810 827 /** Timestamp (us) of last host command processed. */ 811 828 uint64_t mHostCmdTS; 812 /** Flag indicating whether the client currently is pending. */ 829 /** 830 * Flag indicating whether the client currently is pending. 831 * This means the client waits for a new host command to reply 832 * and won't return from the waiting call until a new host 833 * command is available. 834 */ 813 835 bool mIsPending; 836 /** 837 * This is necessary for being compatible with older 838 * Guest Additions. In case there are commands which only 839 * have two (2) parameters and therefore would fit into the 840 * GUEST_MSG_WAIT reply immediately, we now can make sure 841 * that the client first gets back the GUEST_MSG_WAIT results 842 * first. 843 */ 844 uint32_t mPeekCount; 814 845 /** The client's pending connection. */ 815 846 ClientConnection mPendingCon; … … 1346 1377 1347 1378 /* 1348 * The guest only wants skip the currently assigned messages. 1379 * The guest only wants skip the currently assigned messages. Neded 1380 * for dropping its assigned reference of the current assigned host 1381 * command in queue. 1349 1382 * Since VBox 4.3+. 1350 1383 */
Note:
See TracChangeset
for help on using the changeset viewer.