관리-도구
편집 파일: user_plugin_utils.cpython-311.pyc
� b��fb# � � � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dl m Z mZmZm Z d dlmZ d dlmZmZ d dlmZ ddlmZmZ dd lmZ dd lmZ ddlmZ ej d� � Z d Z!de ddfd�Z"de#de fd�Z$de#de#fd�Z%ddde#fd�Z&dddee e e f fd�Z'd'de(de)fd�Z*dee+ fd�Z,ddde#fd�Z-de+ddfd�Z.dee) fd�Z/d(d �Z0d!e de fd"�Z1d!e de fd#�Z2d!e de fd$�Z3d!e de fd%�Z4d!e de fd&�Z5dS ))� N��wraps)�Callable�Optional�Tuple�Any)�get_main_username_by_uid)�is_cl_solo_edition�is_cl_shared_pro_edition)�gettext� )�user_tasks_count�fpm_reload_timeout)� XRayError)�FPMReloadController)�NginxUserCache�user_plugin_utilsz>I�_input�returnzjson strc �* � t j | � � S )z Pack input for sending ��json�dumps)r s �V/opt/cloudlinux/venv/lib64/python3.11/site-packages/xray/internal/user_plugin_utils.py�pack_requestr $ s � � �:�f���� �byte_commandc � � | � � � }t � d|� � t j |� � S )z! Unpack incoming command zCommand requested => %s)�decode�logger�infor �loads)r �_commands r �unpack_requestr$ + s: � � �"�"�$�$�H� �K�K�)�8�4�4�4��:�h���r �msgc � � t � dt | � � � � t j t t | � � � � | z S )z- Prefix message with a 4-byte length zPacking message of %i length)r �debug�len�struct�pack�_format�r% s r � pack_responser- 4 s<