VirtualBox

Ignore:
Timestamp:
Apr 14, 2016 10:33:11 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
106590
Message:

ValidationKit/usb: Fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/usb/UsbTestService.cpp

    r60417 r60488  
    462462
    463463    return utsReplyFailure(pClient, pPktHdr, "FAILED  ", rcOperation, "%s failed with rc=%Rrc (opcode '%.8s')",
    464                            rcOperation, szOperation, rcOperation, pPktHdr->achOpcode);
     464                           szOperation, rcOperation, pPktHdr->achOpcode);
    465465}
    466466
     
    600600
    601601    /* Extract string. */
    602     pClient->pszHostname = RTStrDup(pClient->pszHostname);
     602    pClient->pszHostname = RTStrDup(&pReq->achHostname[0]);
    603603    if (!pClient->pszHostname)
    604         return utsReplyRC(pClient, pPktHdr, VERR_NO_MEMORY, "Failed to alllocate memory for the hostname string");
     604        return utsReplyRC(pClient, pPktHdr, VERR_NO_MEMORY, "Failed to allocate memory for the hostname string");
    605605
    606606    if (pReq->fUsbConn & UTSPKT_HOWDY_CONN_F_PHYSICAL)
     
    897897
    898898                    uint8_t bRead;
    899                     rc = RTPipeRead(g_hPipeR, &bRead, 1, NULL);
     899                    size_t cbRead = 0;
     900                    rc = RTPipeRead(g_hPipeR, &bRead, 1, &cbRead);
    900901                    AssertRC(rc);
    901902
     
    950951                    /* Client sends a request, pick the right client and process it. */
    951952                    PUTSCLIENT pClient = papClients[uId - 1];
     953                    AssertPtr(pClient);
    952954                    if (fEvts & RTPOLL_EVT_READ)
    953955                        rc = utsClientReqProcess(pClient);
     
    957959                    {
    958960                        /* Close connection and remove client from array. */
     961                        rc = g_pTransport->pfnPollSetRemove(hPollSet, pClient->pTransportClient, uId);
     962                        AssertRC(rc);
     963
    959964                        g_pTransport->pfnNotifyBye(pClient->pTransportClient);
    960965                        papClients[uId - 1] = NULL;
     
    9951000         * the request handling thread.
    9961001         */
    997         PUTSCLIENT pClient = (PUTSCLIENT)RTMemAllocZ(sizeof(PUTSCLIENT));
     1002        PUTSCLIENT pClient = (PUTSCLIENT)RTMemAllocZ(sizeof(UTSCLIENT));
    9981003        if (RT_LIKELY(pClient))
    9991004        {
     
    10031008            pClient->hGadgetHost      = NIL_UTSGADGETHOST;
    10041009            pClient->hGadget          = NIL_UTSGADGET;
     1010
     1011            /* Add client to the new list and inform the worker thread. */
     1012            RTCritSectEnter(&g_CritSectClients);
     1013            RTListAppend(&g_LstClientsNew, &pClient->NdLst);
     1014            RTCritSectLeave(&g_CritSectClients);
     1015
     1016            size_t cbWritten = 0;
     1017            rc = RTPipeWrite(g_hPipeW, "", 1, &cbWritten);
     1018            if (RT_FAILURE(rc))
     1019                RTMsgError("Failed to inform worker thread of a new client");
    10051020        }
    10061021        else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette