VirtualBox

Changeset 38986 in vbox


Ignore:
Timestamp:
Oct 13, 2011 2:10:30 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74384
Message:

VRDP-USB: Preserve order of completed URBs.

File:
1 edited

Legend:

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

    r38911 r38986  
    13011301            if (fURBCompleted)
    13021302            {
    1303                 /* Move the URB to head of URB list, so the iface_ReapURB could find it faster. */
     1303                /* Move the URB near the head of URB list, so that iface_ReapURB can
     1304                 * find it faster. Note that the order of completion must be preserved!
     1305                 */
    13041306                if (qurb->prev)
    13051307                {
    1306                     /* The URB is not in the head. */
     1308                    /* The URB is not in the head. Unlink it from its current position. */
    13071309                    qurb->prev->next = qurb->next;
    13081310
     
    13161318                    }
    13171319
    1318                     qurb->next = pDevice->pHeadQURBs;
    1319                     qurb->prev = NULL;
    1320 
    1321                     pDevice->pHeadQURBs->prev = qurb;
    1322                     pDevice->pHeadQURBs = qurb;
     1320                    /* And insert it to its new place. */
     1321                    if (pDevice->pHeadQURBs->fCompleted)
     1322                    {
     1323                        /* At least one other completed URB; insert after the
     1324                         * last completed URB.
     1325                         */
     1326                        REMOTEUSBQURB *prev_qurb = pDevice->pHeadQURBs;
     1327                        while (prev_qurb->next && prev_qurb->next->fCompleted)
     1328                            prev_qurb = prev_qurb->next;
     1329
     1330                        qurb->next = prev_qurb->next;
     1331                        qurb->prev = prev_qurb;
     1332
     1333                        if (prev_qurb->next)
     1334                            prev_qurb->next->prev = qurb;
     1335                        else
     1336                            pDevice->pTailQURBs = qurb;
     1337                        prev_qurb->next = qurb;
     1338                    }
     1339                    else
     1340                    {
     1341                        /* No other completed URBs; insert at head. */
     1342                        qurb->next = pDevice->pHeadQURBs;
     1343                        qurb->prev = NULL;
     1344   
     1345                        pDevice->pHeadQURBs->prev = qurb;
     1346                        pDevice->pHeadQURBs = qurb;
     1347                    }
    13231348                }
    13241349
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