INNER CODE UNIT · Python
vessel_client_call
Marven11/EtherGhost · ether_ghost/vessel_php/main.py:142
async def vessel_client_call(fn, *args, timeout):
start_uuid, stop_uuid = str(uuid.uuid4()), str(uuid.uuid4())
start_uuid_1, start_uuid_2 = start_uuid[:10], start_uuid[10:]
args_b64 = base64_encode(json.dumps(args))
_, result = await session.php_eval_beforebody(
(
load_vessel_client_code
+ f"""
$args = json_decode(base64_decode({args_b64!r}), true);
$result = $client -> call("call_over_session", {fn!r}, $args, {timeout!r});
echo "{start_uuid_1}" . "{start_uuid_2}";
echo $result;
echo "{stop_uuid}";
"""
)
)
try:
data = json.loads(result.rpartition(start_uuid)[2].partition(stop_uuid)[0])