VirtualBox

Changeset 55525 in vbox


Ignore:
Timestamp:
Apr 29, 2015 3:21:19 PM (9 years ago)
Author:
vboxsync
Message:

DnD: Handle receiving 0-byte files, only do workaround accounting on root URI objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp

    r55524 r55525  
    511511        {
    512512            /*
    513              * BUG: Protocol v1 does *not* send directory names in URI format,
    514              *      however, if this in a root URI directory (which came with the initial
     513             * BUG: Protocol v1 does *not* send root directory names in URI format,
     514             *      however, if this is a root URI directory (which came with the initial
    515515             *      GUEST_DND_GH_SND_DATA message(s)) the total data announced was for
    516516             *      root directory names which came in URI format, as an URI list.
     
    523523            if (pszPathURI)
    524524            {
    525                 cbPath  = strlen(pszPathURI);
    526                 cbPath += 3;                  /* Include "\r" + "\n" + termination -- see above. */
    527 
    528                 LogFlowFunc(("URI pszPathURI=%s, cbPathURI=%RU32\n", pszPathURI, cbPath));
     525                bool fHasPath = RTPathHasPath(pszPath); /* Use original data received. */
     526                if (!fHasPath) /* Root path? */
     527                {
     528                    cbPath  = strlen(pszPathURI);
     529                    cbPath += 3;                  /* Include "\r" + "\n" + termination -- see above. */
     530
     531                    rc = i_updateProcess(pCtx, cbPath);
     532                }
     533
     534                LogFlowFunc(("URI pszPathURI=%s, fHasPath=%RTbool, cbPath=%RU32\n", pszPathURI, fHasPath, cbPath));
    529535                RTStrFree(pszPathURI);
    530536            }
     
    532538                rc = VERR_NO_MEMORY;
    533539        }
    534 
    535         if (RT_SUCCESS(rc))
    536             rc = i_updateProcess(pCtx, cbPath);
    537540    }
    538541
     
    599602            if (mDataBase.mProtocolVersion >= 2)
    600603                rc = pCtx->mURI.objURI.SetSize(cbSize);
     604
     605            if (!cbSize) /* 0-byte file? Close again. */
     606                pCtx->mURI.objURI.Close();
    601607        }
    602608        else
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