update src/host/host_usb.cpp.

Signed-off-by: liupeng298 <liupeng298@huawei.com>
This commit is contained in:
liupeng298 2024-11-11 08:27:15 +00:00 committed by Gitee
parent 4fdb064df7
commit db0c71abf7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -660,6 +660,12 @@ int HdcHostUSB::SendUSBRaw(HSession hSession, uint8_t *data, const int length)
WRITE_LOG(LOG_FATAL, "Send usb failed, sid:%u ret:%d", hSession->sessionId, ret);
CancelUsbIo(hSession);
hSession->hUSB->hostBulkOut.isShutdown = true;
HdcServer * serverClass = (HdcServer *)server;
if (serverClass != nullptr && serverClass->clsServerForClient != nullptr) {
HdcServerForClient *sfc = (HdcServerForClient *)serverClass->clsServerForClient;
const string msg("[Fail]USB Device is disconnected.");
sfc->EchoToAllChannelsViaSessionId(hSession->sessionId, msg);
}
server->FreeSession(hSession->sessionId);
}
--hSession->ref;