Lines Matching defs:message
66 static void ProcessRecvMsg(AppSpawnConnection *connection, AppSpawnMsgNode *message);
214 if (ctx == NULL || ctx->message == NULL || ctx->message->connection != data) {
407 APPSPAWN_STATIC bool MsgDevicedebugCheck(TaskHandle stream, AppSpawnMsgNode *message)
419 AppSpawnMsg *msg = &message->msgHeader;
438 AppSpawnMsgNode *message = connection->receiverCtx.incompleteMsg; // incomplete msg
446 &message, &connection->receiverCtx.msgRecvLen, &reminder);
449 if (connection->receiverCtx.msgRecvLen != message->msgHeader.msgLen) { // recv complete msg
450 connection->receiverCtx.incompleteMsg = message;
451 message = NULL;
460 APPSPAWN_CHECK_ONLY_EXPER(MsgDevicedebugCheck(connection->stream, message),
464 ret = DecodeAppSpawnMsg(message);
466 (void)ProcessRecvMsg(connection, message);
467 message = NULL;
471 if (message) {
472 DeleteAppSpawnMsg(message);
513 APPSPAWN_CHECK(property != NULL && property->message != NULL, return APPSPAWN_MSG_INVALID,
515 const uint32_t memSize = (property->message->msgHeader.msgLen / 4096 + 1) * 4096; // 4096 4K
520 int ret = memcpy_s(buffer, memSize, &property->message->msgHeader, sizeof(AppSpawnMsg));
523 property->message->buffer, property->message->msgHeader.msgLen - sizeof(AppSpawnMsg));
683 int ret = memcpy_s(content->propertyBuffer, MAX_MEM_SIZE, &property->message->msgHeader, sizeof(AppSpawnMsg));
686 property->message->buffer, property->message->msgHeader.msgLen - sizeof(AppSpawnMsg));
707 AppSpawnMsgNode *message = NULL;
708 int ret = GetAppSpawnMsgFromBuffer(buffer, ((AppSpawnMsg *)buffer)->msgLen, &message, &msgRecvLen, &remainLen);
711 if (ret == 0 && DecodeAppSpawnMsg(message) == 0 && CheckAppSpawnMsg(message) == 0) {
712 property->message = message;
713 message = NULL;
884 static void ProcessSpawnReqMsg(AppSpawnConnection *connection, AppSpawnMsgNode *message)
886 int ret = CheckAppSpawnMsg(message);
888 SendResponse(connection, &message->msgHeader, ret, 0);
889 DeleteAppSpawnMsg(message);
895 SetAppSpawnMsgFlag(message, TLV_MSG_FLAGS, APP_FLAGS_DEVELOPER_MODE);
903 SendResponse(connection, &message->msgHeader, APPSPAWN_SYSTEM_ERROR, 0);
904 DeleteAppSpawnMsg(message);
909 property->message = message;
910 message->connection = connection;
914 DumpAppSpawnMsg(property->message);
920 SendResponse(connection, &message->msgHeader, ret, 0);
926 SendResponse(connection, &message->msgHeader, ret, 0);
948 SendResponse(property->message->connection, &property->message->msgHeader, APPSPAWN_CHILD_CRASH, 0);
969 SendResponse(property->message->connection, &property->message->msgHeader, APPSPAWN_SPAWN_TIMEOUT, 0);
979 APPSPAWN_CHECK(property->message != NULL, return -1, "Invalid message in ctx %{public}d", property->client.id);
982 SendResponse(property->message->connection, &property->message->msgHeader, result, property->pid);
1025 appInfo->message = property->message;
1035 SendResponse(property->message->connection, &property->message->msgHeader, result, property->pid);
1039 property->message = NULL;
1121 // for cold run, use shared memory to exchange message
1175 AppSpawnMsgNode *message = NULL;
1176 int ret = GetAppSpawnMsgFromBuffer(buffer, ((AppSpawnMsg *)buffer)->msgLen, &message, &msgRecvLen, &remainLen);
1187 if (ret == 0 && DecodeAppSpawnMsg(message) == 0 && CheckAppSpawnMsg(message) == 0) {
1188 property->message = message;
1189 message = NULL;
1193 DeleteAppSpawnMsg(message);
1209 DumpAppSpawnMsg(property->message);
1348 static AppSpawnMsgNode *ProcessSpawnBegetctlMsg(AppSpawnConnection *connection, AppSpawnMsgNode *message)
1351 const char *cmdMsg = (const char *)GetAppSpawnMsgExtInfo(message, MSG_EXT_NAME_BEGET_PID, &len);
1355 AppSpawnMsgNode *msgNode = RebuildAppSpawnMsgNode(message, appInfo);
1356 APPSPAWN_CHECK(msgNode != NULL, return NULL, "Failed to rebuild app message node");
1365 static void ProcessBegetCmdMsg(AppSpawnConnection *connection, AppSpawnMsgNode *message)
1367 AppSpawnMsg *msg = &message->msgHeader;
1370 DeleteAppSpawnMsg(message);
1373 AppSpawnMsgNode *msgNode = ProcessSpawnBegetctlMsg(connection, message);
1376 DeleteAppSpawnMsg(message);
1380 DeleteAppSpawnMsg(message);
1409 static int ProcessSpawnRemountMsg(AppSpawnConnection *connection, AppSpawnMsgNode *message)
1453 static int ProcessSpawnRemountMsg(AppSpawnConnection *connection, AppSpawnMsgNode *message)
1509 static void ProcessSpawnRestartMsg(AppSpawnConnection *connection, AppSpawnMsgNode *message)
1513 SendResponse(connection, &message->msgHeader, APPSPAWN_MSG_INVALID, 0);
1514 DeleteAppSpawnMsg(message);
1520 SendResponse(connection, &message->msgHeader, 0, 0);
1521 DeleteAppSpawnMsg(message);
1582 APPSPAWN_STATIC int ProcessAppSpawnDeviceDebugMsg(AppSpawnMsgNode *message)
1584 APPSPAWN_CHECK_ONLY_EXPER(message != NULL, return -1);
1587 const char* jsonString = (char *)GetAppSpawnMsgExtInfo(message, "devicedebug", &len);
1620 static void ProcessRecvMsg(AppSpawnConnection *connection, AppSpawnMsgNode *message)
1622 AppSpawnMsg *msg = &message->msgHeader;
1623 APPSPAWN_LOGI("Recv message header magic 0x%{public}x type %{public}u id %{public}u len %{public}u %{public}s",
1633 ret = ProcessTerminationStatusMsg(message, &result);
1635 DeleteAppSpawnMsg(message);
1640 ProcessSpawnReqMsg(connection, message);
1644 ProcessAppSpawnDumpMsg(message);
1646 DeleteAppSpawnMsg(message);
1649 ProcessBegetCmdMsg(connection, message);
1655 DeleteAppSpawnMsg(message);
1658 ret = ProcessSpawnRemountMsg(connection, message);
1662 ProcessSpawnRestartMsg(connection, message);
1665 ret = ProcessAppSpawnDeviceDebugMsg(message);
1667 DeleteAppSpawnMsg(message);
1671 DeleteAppSpawnMsg(message);