Changeset 65883 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Feb 25, 2017 7:32:34 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 113666
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/generic/USBProxyBackendUsbIp.cpp
r65875 r65883 5 5 6 6 /* 7 * Copyright (C) 2015-201 6Oracle Corporation7 * Copyright (C) 2015-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 39 39 #include <iprt/asm.h> 40 40 #include <iprt/cdefs.h> 41 #include <iprt/time.h> 41 42 42 43 /** The USB/IP default port to connect to. */ … … 244 245 /** Current amount of devices in the list. */ 245 246 uint32_t cDevicesCur; 247 /** Timestamp of the last time we successfully connected. */ 248 uint64_t tsConnectSuccessLast; 246 249 }; 247 250 … … 290 293 291 294 m = new Data; 295 296 m->tsConnectSuccessLast = 0; 292 297 293 298 /* Split address into hostname and port. */ … … 489 494 /* Limit the waiting time to 3sec so we can either reconnect or get a new device list. */ 490 495 if (m->hSocket == NIL_RTSOCKET || m->enmRecvState == kUsbIpRecvState_None) 491 msWait = RT_MIN( 1000, aMillies);496 msWait = RT_MIN(3000, aMillies); 492 497 493 498 rc = RTPoll(m->hPollSet, msWait, &fEventsRecv, &uIdReady); … … 563 568 || rc == VERR_NET_CONNECTION_REFUSED) 564 569 { 565 /* Make sure the device list is clear. */ 566 #if 0 567 RTSemFastMutexRequest(m->hMtxDevices); 568 if (m->pUsbDevicesCur) 569 { 570 freeDeviceList(m->pUsbDevicesCur); 570 if (hasDevListChanged(m->pHead)) 571 571 fDeviceListChangedOrWokenUp = true; 572 m->cUsbDevicesCur = 0;573 m->pUsbDevicesCur = NULL;574 }575 RTSemFastMutexRelease(m->hMtxDevices);576 #endif577 572 rc = VINF_SUCCESS; 578 573 } … … 739 734 } 740 735 else 736 { 741 737 LogFlowFunc(("Connected to host \"%s\"\n", m->pszHost)); 738 m->tsConnectSuccessLast = RTTimeMilliTS(); 739 } 740 } 741 else if (m->tsConnectSuccessLast + 10 * RT_MS_1SEC < RTTimeMilliTS()) 742 { 743 /* Make sure the device list is clear if we failed to reconnect for some time. */ 744 RTSemFastMutexRequest(m->hMtxDevices); 745 if (m->pUsbDevicesCur) 746 { 747 freeDeviceList(m->pUsbDevicesCur); 748 m->cUsbDevicesCur = 0; 749 m->pUsbDevicesCur = NULL; 750 } 751 RTSemFastMutexRelease(m->hMtxDevices); 742 752 } 743 753
Note:
See TracChangeset
for help on using the changeset viewer.