Lines Matching refs:hSession
396 void HdcServer::NotifyInstanceSessionFree(HSession hSession, bool freeOrClear) in NotifyInstanceSessionFree() argument
399 AdminDaemonMap(OP_QUERY, hSession->connectKey, hdiOld); in NotifyInstanceSessionFree()
408 AdminDaemonMap(OP_UPDATE, hSession->connectKey, hdiNew); in NotifyInstanceSessionFree()
409 CleanForwardMap(hSession->sessionId); in NotifyInstanceSessionFree()
427 bool HdcServer::HandServerAuth(HSession hSession, SessionHandShake &handshake) in HandServerAuth() argument
435 …bool retChildForToken = HdcAuth::KeylistIncrement(hSession->listKey, hSession->authKeyIndex, &ptr); in HandServerAuth()
440 ret = HandServerAuth(hSession, handshake); in HandServerAuth()
452 Send(hSession->sessionId, 0, CMD_KERNEL_HANDSHAKE, in HandServerAuth()
467 Send(hSession->sessionId, 0, CMD_KERNEL_HANDSHAKE, in HandServerAuth()
478 bool HdcServer::ServerSessionHandshake(HSession hSession, uint8_t *payload, int payloadSize) in ServerSessionHandshake() argument
498 if (!HandServerAuth(hSession, handshake)) { in ServerSessionHandshake()
506 AdminDaemonMap(OP_QUERY, hSession->connectKey, hdiOld); in ServerSessionHandshake()
521 AdminDaemonMap(OP_UPDATE, hSession->connectKey, hdiNew); in ServerSessionHandshake()
522 hSession->handshakeOK = true; in ServerSessionHandshake()
527 bool HdcServer::FetchCommand(HSession hSession, const uint32_t channelId, const uint16_t command, u… in FetchCommand() argument
533 ret = ServerSessionHandshake(hSession, payload, payloadSize); in FetchCommand()
535 hSession->connType); in FetchCommand()
550 Send(hSession->sessionId, channelId, CMD_KERNEL_CHANNEL_CLOSE, &flag, 1); in FetchCommand()
572 ClearOwnTasks(hSession, channelId); in FetchCommand()
577 Send(hSession->sessionId, channelId, CMD_KERNEL_CHANNEL_CLOSE, payload, 1); in FetchCommand()
587 pdiNew->sessionId = hSession->sessionId; in FetchCommand()
715 HSession hSession = (HSession)handle->data; in UsbPreConnect() local
717 HdcServer *hdcServer = (HdcServer *)hSession->classInstance; in UsbPreConnect()
721 if (++hSession->hUSB->retryCount > usbConnectRetryMax) { // max 15s in UsbPreConnect()
722 hdcServer->FreeSession(hSession->sessionId); in UsbPreConnect()
727 if (hSession->connectKey == "any") { in UsbPreConnect()
728 hdcServer->AdminDaemonMap(OP_GET_ANY, hSession->connectKey, pDi); in UsbPreConnect()
730 hdcServer->AdminDaemonMap(OP_QUERY, hSession->connectKey, pDi); in UsbPreConnect()
735 HdcHostUSB *hdcHostUSB = (HdcHostUSB *)hSession->classModule; in UsbPreConnect()
736 hdcHostUSB->ConnectDetectDaemon(hSession, pDi); in UsbPreConnect()
748 HSession hSession = (HSession)handle->data; in UartPreConnect() local
750 HdcServer *hdcServer = (HdcServer *)hSession->classInstance; in UartPreConnect()
753 if (hSession->hUART->retryCount > uartConnectRetryMax) { in UartPreConnect()
755 hSession->hUART->retryCount); in UartPreConnect()
756 hdcServer->FreeSession(hSession->sessionId); in UartPreConnect()
760 hSession->hUART->retryCount++; in UartPreConnect()
763 WRITE_LOG(LOG_DEBUG, "%s query %s", __FUNCTION__, hSession->ToDebugString().c_str()); in UartPreConnect()
764 hdcServer->AdminDaemonMap(OP_QUERY, hSession->connectKey, pDi); in UartPreConnect()
769 HdcHostUART *hdcHostUART = (HdcHostUART *)hSession->classModule; in UartPreConnect()
770 hdcHostUART->ConnectDaemonByUart(hSession, pDi); in UartPreConnect()
781 void HdcServer::CreatConnectUart(HSession hSession) in CreatConnectUart() argument
789 waitTimeDoCmd->data = hSession; in CreatConnectUart()
828 HSession hSession = nullptr; in CreateConnect() local
830 hSession = clsTCPClt->ConnectDaemon(connectKey, isCheck); in CreateConnect()
834 hSession = clsUARTClt->ConnectDaemon(connectKey); in CreateConnect()
837 hSession = MallocSession(true, CONN_USB, clsUSBClt); in CreateConnect()
838 hSession->connectKey = connectKey; in CreateConnect()
845 waitTimeDoCmd->data = hSession; in CreateConnect()
848 if (!hSession) { in CreateConnect()
855 diNew.hSession = hSession; in CreateConnect()
862 void HdcServer::AttachChannel(HSession hSession, const uint32_t channelId) in AttachChannel() argument
870 uv_tcp_init(&hSession->childLoop, &hChannel->hChildWorkTCP); in AttachChannel()
872 hChannel->targetSessionId = hSession->sessionId; in AttachChannel()
888 void HdcServer::DeatchChannel(HSession hSession, const uint32_t channelId) in DeatchChannel() argument
901 ClearOwnTasks(hSession, channelId); in DeatchChannel()
903 Send(hSession->sessionId, hChannel->channelId, CMD_KERNEL_CHANNEL_CLOSE, &count, 1); in DeatchChannel()
905 …Base::DoNextLoop(&hSession->childLoop, hChannel, [](const uint8_t flag, string &msg, const void *d… in DeatchChannel()
924 HSession hSession = AdminSession(OP_QUERY, sessionId, nullptr); in ServerCommand() local
925 if (!hChannel || !hSession) { in ServerCommand()
928 return FetchCommand(hSession, channelId, command, bufPtr, size); in ServerCommand()
932 bool HdcServer::RedirectToTask(HTaskInfo hTaskInfo, HSession hSession, const uint32_t channelId, in RedirectToTask() argument