Lines Matching defs:client

389         APPSPAWN_LOGE("Invalid uid %{public}d from client", cred.uid);
432 return, "Failed to get client form socket");
516 char *buffer = GetMapMem(property->client.id, GetProcessName(property), memSize, false, isNweb);
532 APPSPAWN_LOGV("Write msg to child: %{public}u success", property->client.id);
627 || (property->client.flags & APP_COLD_START);
698 uint8_t *buffer = (uint8_t *)GetMapMem(property->client.id, "prefork", MAX_MEM_SIZE, true, false);
778 AppSpawnClient client = {0, 0};
779 int infoSize = read(content->parentToChildFd[0], &client, sizeof(AppSpawnClient));
785 property->client.id = client.id;
786 property->client.flags = client.flags;
793 ClearMMAP(property->client.id);
794 content->notifyResToParent(content, &property->client, APPSPAWN_MSG_INVALID);
798 ClearMMAP(property->client.id);
799 ProcessExit(AppSpawnChild(content, &property->client));
805 static int AppSpawnProcessMsgForPrefork(AppSpawnContent *content, AppSpawnClient *client, pid_t *childPid)
808 AppSpawningCtx *property = (AppSpawningCtx *)client;
811 APPSPAWN_CHECK(client != NULL, return ret, "client is null");
812 ret = InitForkContext((AppSpawningCtx *)client);
814 ret = AppSpawnProcessMsg(content, client, childPid);
816 APPSPAWN_CHECK_ONLY_EXPER(content->propertyBuffer == NULL, ClearMMAP(client->id));
817 content->propertyBuffer = GetMapMem(property->client.id, "prefork", MAX_MEM_SIZE, false, false);
832 ssize_t writesize = write(content->parentToChildFd[1], client, sizeof(AppSpawnClient)) ;
842 static bool IsSupportPrefork(AppSpawnContent *content, AppSpawnClient *client)
845 if (client == NULL || content == NULL) {
851 AppSpawningCtx *property = (AppSpawningCtx *)client;
869 static int RunAppSpawnProcessMsg(AppSpawnContent *content, AppSpawnClient *client, pid_t *childPid)
873 if (IsBootFinished() && IsSupportPrefork(content, client)) {
874 ret = AppSpawnProcessMsgForPrefork(content, client, childPid);
876 APPSPAWN_CHECK(client != NULL, return ret, "client is null");
877 ret = InitForkContext((AppSpawningCtx *)client);
879 ret = AppSpawnProcessMsg(content, client, childPid);
913 AppSpawnHookExecute(STAGE_PARENT_PRE_FORK, 0, GetAppSpawnContent(), &property->client);
917 ret = RunAppSpawnProcessMsg(GetAppSpawnContent(), &property->client, &property->pid);
918 AppSpawnHookExecute(STAGE_PARENT_POST_FORK, 0, GetAppSpawnContent(), &property->client);
940 GetProcessName(property), property->pid, property->client.id);
941 if (property->client.id == g_lastDiedAppId + 1) {
946 g_lastDiedAppId = property->client.id;
962 GetProcessName(property), property->pid, property->client.id);
978 GetProcessName(property), property->pid, property->client.id, result);
979 APPSPAWN_CHECK(property->message != NULL, return -1, "Invalid message in ctx %{public}d", property->client.id);
1034 AppSpawnHookExecute(STAGE_PARENT_PRE_RELY, 0, GetAppSpawnContent(), &property->client);
1036 AppSpawnHookExecute(STAGE_PARENT_POST_RELY, 0, GetAppSpawnContent(), &property->client);
1045 static void NotifyResToParent(AppSpawnContent *content, AppSpawnClient *client, int result)
1047 AppSpawningCtx *property = (AppSpawningCtx *)client;
1054 APPSPAWN_LOGV("NotifyResToParent client id: %{public}u result: 0x%{public}x", client->id, result);
1109 APPSPAWN_STATIC int AppSpawnColdStartApp(struct AppSpawnContent *content, AppSpawnClient *client)
1111 AppSpawningCtx *property = (AppSpawningCtx *)client;
1129 len = sprintf_s(buffer[1], sizeof(buffer[1]), " %u ", property->client.flags);
1133 len = sprintf_s(buffer[3], sizeof(buffer[3]), " %u ", property->client.id); // 3 3 index for client id
1158 property->client.flags = (uint32_t)atoi(argv[FLAGS_VALUE_INDEX]);
1159 property->client.flags &= ~APP_COLD_START;
1163 property->client.id = (uint32_t)atoi(argv[CLIENT_ID_INDEX]);
1164 uint8_t *buffer = (uint8_t *)GetMapMem(property->client.id,
1167 APPSPAWN_LOGE("Failed to map errno %{public}d %{public}s", property->client.id, argv[PARAM_VALUE_INDEX]);
1168 NotifyResToParent(&content->content, &property->client, APPSPAWN_SYSTEM_ERROR);
1182 isNweb ? "nwebspawn" : "appspawn", argv[PARAM_VALUE_INDEX], property->client.id);
1192 NotifyResToParent(&content->content, &property->client, APPSPAWN_MSG_INVALID);
1211 int ret = AppSpawnExecuteSpawningHook(content, &property->client);
1213 ret = AppSpawnExecutePreReplyHook(content, &property->client);
1215 NotifyResToParent(content, &property->client, ret);
1217 (void)AppSpawnExecutePostReplyHook(content, &property->client);
1221 ret = content->runChildProcessor(content, &property->client);
1224 NotifyResToParent(content, &property->client, ret);
1228 AppSpawnEnvClear(content, &property->client);