VirtualBox

Changeset 87072 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 9, 2020 4:51:00 PM (4 years ago)
Author:
vboxsync
Message:

Shared Clipboard/Transfers: Bugfixes, docs. bugref:9874

File:
1 edited

Legend:

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

    r87068 r87072  
    7070*   Prototypes                                                                                                                   *
    7171*********************************************************************************************************************************/
    72 int ShClTransferHttpServerDestroyInternal(PSHCLHTTPSERVER pThis);
     72int shClTransferHttpServerDestroyInternal(PSHCLHTTPSERVER pThis);
    7373
    7474
     
    105105static int shClTransferHttpPathValidate(PSHCLHTTPSERVER pThis, const char *pszUrl)
    106106{
     107    AssertPtrReturn(pszUrl, VERR_INVALID_POINTER);
     108
     109    int rc = VERR_PATH_NOT_FOUND;
     110
    107111    PSHCLHTTPSERVERTRANSFER pSrvTx;
    108112    RTListForEach(&pThis->lstTransfers, pSrvTx, SHCLHTTPSERVERTRANSFER, Node)
    109113    {
    110114        AssertPtr(pSrvTx->pTransfer);
     115
     116        const char *psz = pszUrl;
     117
    111118        /* Be picky here, do a case sensitive comparison. */
    112         if (RTStrStartsWith(pszUrl, pSrvTx->szPathVirtual))
    113             return VINF_SUCCESS;
    114     }
    115 
    116     return VERR_PATH_NOT_FOUND;
    117 }
    118 
     119        if (RTStrStartsWith(psz, pSrvTx->szPathVirtual))
     120        {
     121            /* Skip the virtual root path. */
     122            psz += RTStrNLen(pSrvTx->szPathVirtual, RTPATH_MAX);
     123
     124
     125
     126            LogFlowFunc(("psz=%s\n", psz));
     127
     128            rc = VINF_SUCCESS;
     129            break;
     130        }
     131    }
     132
     133    LogFlowFunc(("pszUrl=%s, rc=%Rrc\n", pszUrl, rc));
     134    return rc;
     135}
     136
     137/** @copydoc RTHTTPSERVERCALLBACKS::pfnOpen */
    119138static DECLCALLBACK(int) shClTransferHttpOpen(PRTHTTPCALLBACKDATA pData, PRTHTTPSERVERREQ pReq, void **ppvHandle)
    120139{
     
    132151}
    133152
     153/** @copydoc RTHTTPSERVERCALLBACKS::pfnRead */
    134154static DECLCALLBACK(int) shClTransferHttpRead(PRTHTTPCALLBACKDATA pData, void *pvHandle, void *pvBuf, size_t cbBuf, size_t *pcbRead)
    135155{
     
    145165}
    146166
     167/** @copydoc RTHTTPSERVERCALLBACKS::pfnClose */
    147168static DECLCALLBACK(int) shClTransferHttpClose(PRTHTTPCALLBACKDATA pData, void *pvHandle)
    148169{
     
    158179}
    159180
     181/** @copydoc RTHTTPSERVERCALLBACKS::pfnQueryInfo */
    160182static DECLCALLBACK(int) shClTransferHttpQueryInfo(PRTHTTPCALLBACKDATA pData,
    161183                                                   PRTHTTPSERVERREQ pReq, PRTFSOBJINFO pObjInfo, char **ppszMIMEHint)
     
    174196}
    175197
     198/** @copydoc RTHTTPSERVERCALLBACKS::pfnDestroy */
    176199static DECLCALLBACK(int) shClTransferHttpDestroy(PRTHTTPCALLBACKDATA pData)
    177200{
     
    179202    Assert(pData->cbUser == sizeof(SHCLHTTPSERVER));
    180203
    181     return ShClTransferHttpServerDestroyInternal(pThis);
     204    return shClTransferHttpServerDestroyInternal(pThis);
    182205}
    183206
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