VirtualBox

Changeset 99953 in vbox for trunk


Ignore:
Timestamp:
May 24, 2023 10:42:42 AM (16 months ago)
Author:
vboxsync
Message:

Shared Clipboard: Only need to start the HTTP server on the host when we actually doing a guest -> host transfer; make sure to destroy the HTTP server in ShClX11Destroy(). bugref:9437

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-x11.cpp

    r99564 r99953  
    12671267
    12681268    LogFlowFunc(("pCtx=%p\n", pCtx));
     1269
     1270#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP
     1271    ShClTransferHttpServerDestroy(&pCtx->HttpCtx.HttpServer);
     1272#endif
    12691273
    12701274#ifdef TESTCASE
  • trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11.cpp

    r99937 r99953  
    505505    RT_NOREF(pBackend);
    506506#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP
    507     return ShClHttpTransferRegisterAndMaybeStart(&pClient->State.pCtx->X11.HttpCtx, pTransfer);
     507    /* We only need to start the HTTP server (and register the transfer to it) when we actually receive data from the guest. */
     508    if (ShClTransferGetDir(pTransfer) == SHCLTRANSFERDIR_FROM_REMOTE)
     509        return ShClHttpTransferRegisterAndMaybeStart(&pClient->State.pCtx->X11.HttpCtx, pTransfer);
    508510#else
    509511    RT_NOREF(pClient, pTransfer);
    510512#endif
    511     return VERR_NOT_IMPLEMENTED;
     513    return VINF_SUCCESS;
    512514}
    513515
     
    516518    RT_NOREF(pBackend);
    517519#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS_HTTP
    518     return ShClHttpTransferUnregisterAndMaybeStop(&pClient->State.pCtx->X11.HttpCtx, pTransfer);
     520    /* See comment in ShClBackendTransferCreate(). */
     521    if (ShClTransferGetDir(pTransfer) == SHCLTRANSFERDIR_FROM_REMOTE)
     522        return ShClHttpTransferUnregisterAndMaybeStop(&pClient->State.pCtx->X11.HttpCtx, pTransfer);
    519523#else
    520524    RT_NOREF(pClient, pTransfer);
    521525#endif
    522 
    523526    return VINF_SUCCESS;
    524527}
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