HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/transport/__pycache__/frame.cpython-310.pyc
o

�N�g�@s<dZddlZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)zE
Helper functions for transport components to handle message framing
�NFcCs.i}|duri}||d<||d<tjj�|�S)z8
    Frame the given message with our wire protocol
    N�head�body��salt�utilsZmsgpack�dumps�r�headerZraw_bodyZ
framed_msg�r
�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/transport/frame.py�	frame_msgsrcCs2i}|duri}||d<||d<tjjj|dd�S)z�
    Frame the given message with our wire protocol for IPC

    For IPC, we don't need to be backwards compatible, so
    use the more efficient "use_bin_type=True" on Python 3.
    NrrT)Zuse_bin_typerrr
r
r�
frame_msg_ipcsr
c	Csng}|D]0}t|t�rt|�}nt|t�rt|�}nt|t�r/z|��}Wn	ty.Ynw|�|�q|S)zI
    Convert enbedded bytes to strings if possible.
    List helper.
    )	�
isinstance�dict�_decode_embedded_dict�list�_decode_embedded_list�bytes�decode�UnicodeError�append)�src�output�elemr
r
rr%s




�rc	Cs�i}|��D]F\}}t|t�rt|�}nt|t�rt|�}nt|t�r3z|��}Wn	ty2Ynwt|t�rHz|��}Wn	tyGYnw|||<q|S)zI
    Convert enbedded bytes to strings if possible.
    Dict helper.
    )	�itemsrrrrrrrr)rr�key�valr
r
rr9s(




�
�
rcCsTt|t�r	t|�St|t�rt|�St|t�r(z|��WSty'|YSw|S)a�
    Convert enbedded bytes to strings if possible.
    This is necessary because Python 3 makes a distinction
    between these types.

    This wouldn't be needed if we used "use_bin_type=True" when encoding
    and "encoding='utf-8'" when decoding. Unfortunately, this would break
    backwards compatibility due to a change in wire protocol, so this less
    than ideal solution is used instead.
    )rrrrrrrr)rr
r
r�decode_embedded_strsRs



�r)NF)�__doc__Zsalt.utils.msgpackrrr
rrrr
r
r
r�<module>s