VirtualBox

Changeset 75981 in vbox for trunk/src


Ignore:
Timestamp:
Dec 5, 2018 4:10:15 PM (6 years ago)
Author:
vboxsync
Message:

GuestProperties: Complete pending calls when a client disconnects. Important to clean up cancelled ones!

File:
1 edited

Legend:

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

    r75974 r75981  
    353353    }
    354354
    355     /**
    356      * @interface_method_impl{VBOXHGCMSVCFNTABLE,pfnConnect}
    357      * Stub implementation of pfnConnect and pfnDisconnect.
    358      */
    359     static DECLCALLBACK(int) svcDisconnect(void * /* pvService */,
    360                                            uint32_t /* u32ClientID */,
    361                                            void * /* pvClient */)
    362     {
    363         /** @todo r=bird: Here be dragons! You must complete all calls for the client as
    364          * it disconnects or we'll end wasting space...  We're also confused after
    365          * restoring state, but that's a bug somewhere in VMMDev, I think. */
    366         return VINF_SUCCESS;
    367     }
     355    static DECLCALLBACK(int) svcDisconnect(void *pvService, uint32_t idClient, void *pvClient);
    368356
    369357    /**
     
    16061594
    16071595/**
     1596 * @interface_method_impl{VBOXHGCMSVCFNTABLE,pfnDisconnect}
     1597 */
     1598/*static*/ DECLCALLBACK(int) Service::svcDisconnect(void *pvService, uint32_t idClient, void *pvClient)
     1599{
     1600    RT_NOREF(pvClient);
     1601    LogFlowFunc(("idClient=%u\n", idClient));
     1602    SELF *pThis = reinterpret_cast<SELF *>(pvService);
     1603    AssertLogRelReturn(pThis, VERR_INVALID_POINTER);
     1604
     1605    /*
     1606     * Complete all pending requests for this client.
     1607     */
     1608    for (CallList::iterator It = pThis->mGuestWaiters.begin(); It != pThis->mGuestWaiters.end();)
     1609    {
     1610        GuestCall &rCurCall = *It;
     1611        if (rCurCall.u32ClientId != idClient)
     1612            ++It;
     1613        else
     1614        {
     1615            LogFlowFunc(("Completing call %u (%p)...\n", rCurCall.mFunction, rCurCall.mHandle));
     1616            pThis->mpHelpers->pfnCallComplete(rCurCall.mHandle, VERR_INTERRUPTED);
     1617            It = pThis->mGuestWaiters.erase(It);
     1618        }
     1619    }
     1620
     1621    return VINF_SUCCESS;
     1622}
     1623
     1624/**
    16081625 * Increments a counter property.
    16091626 *
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