HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/rhn/__pycache__/connections.cpython-39.pyc
a

ꑐc�%�@s(ddlZddlZddlZddlmZddlmZddlmZddlm	Z	z(ddl
Z
ddl
mZmZm
Z
ddlZWn>ey�ddlmZ
ddlmZmZm
Z
ddlmZYn0Gdd�de
j�ZGd	d
�d
e
j�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�Zdd�Zdd�ZdS)�N)�python_version)�SSL)�nonblocking)�i18n)�_CS_REQ_SENT�_CS_IDLE�ResponseNotReadyc@seZdZdd�ZdS)�HTTPResponsecCs4t|jtj�st�|j�|_|j�|||||�dS�N)�
isinstance�fprZNonBlockingFile�set_callback��selfZrs�ws�exZ	user_data�callback�r�3/usr/lib/python3.9/site-packages/rhn/connections.pyr
 szHTTPResponse.set_callbackN)�__name__�
__module__�__qualname__r
rrrrr	sr	c@s@eZdZeZdejfdd�Zdd�Zdd�Z	dd	�Z
d
d�ZdS)�HTTPConnectionNcCs^t�dkr tjj||||d�ntj�|||�g|_g|_g|_d|_d|_d|_	||_
dS)Nz2.6.1��timeoutz#rhn.connections $Revision$ (python))r�httplibr�__init__�_cb_rs�_cb_ws�_cb_ex�
_cb_user_data�_cb_callback�_user_agentr)r�host�portrrrrr(s
zHTTPConnection.__init__cCs"||_||_||_||_||_dSr
)rrrr r!rrrrr
5s
zHTTPConnection.set_callbackcCs
||_dSr
)r")rZ
user_agentrrr�set_user_agent=szHTTPConnection.set_user_agentcCs�|jr|j��rd|_|jtks&|jr,t��|jdkrH|�|j|j�}n|�|j�}|jrv|�	|j
|j|j|j
|j�|��|jtjks�J�t|_|jr�|��n||_|S)z!Get the response from the server.Nr)Z_HTTPConnection__responseZisclosedZ_HTTPConnection__staterrZ
debuglevel�response_class�sockr!r
rrrr �begin�
will_closerZ_UNKNOWNr�close)r�responserrr�getresponseBs$
�
zHTTPConnection.getresponsecCstj�|�|j�|j�dSr
)rr�connectr'�
settimeoutr�rrrrr-sszHTTPConnection.connect)rrrr	r&r�DEFAULT_TIMEOUTrr
r%r,r-rrrrr%s
1rc@sBeZdZdddejfdd�Zdd�Zd
dd�Zd	d
�Zdd�Z	dS)�HTTPProxyConnectionNcCsPtj|||d�|j|j|_|_|�||�|j|j|_|_||_	||_
dS�Nr)rrr#r$�_HTTPProxyConnection__proxy� _HTTPProxyConnection__proxy_port�
_set_hostport�_host�_port�_HTTPProxyConnection__username�_HTTPProxyConnection__password)r�proxyr#r$�username�passwordrrrrryszHTTPProxyConnection.__init__cCs.|�|j|j�t�|�|�|j|j�dSr
)r5r3r4rr-r6r7r/rrrr-�s
zHTTPProxyConnection.connectrcCsN|j}|j|jkr$|dt|j�}d||f}tj||||d�|��dS)N�:zhttp://%s%s��	skip_host)r6r7�default_port�strr�
putrequest�_add_proxy_headers)r�method�urlr?�hostnameZnewurlrrrrB�szHTTPProxyConnection.putrequestcCsX|js
dSd|j|jf}t�t�|���t�d�t�d��}|�ddt�|��dS)N�%s:%s�
�zProxy-AuthorizationzBasic %s)	r8r9�base64Zencodestringr�bstr�replace�	putheaderZsstr)rZuserpassZenc_userpassrrrrC�s
$z&HTTPProxyConnection._add_proxy_headerscCs|�||�\|_|_dSr
)Z
_get_hostportr#r$)rr#r$rrrr5�sz!HTTPProxyConnection._set_hostport)r)
rrrrr0rr-rBrCr5rrrrr1xs�

r1c@s2eZdZeZejjZddej	fdd�Z
dd�ZdS)�HTTPSConnectionNcCs$tj||||d�|pg}||_dSr2)rr�
trusted_certs)rr#r$rOrrrrr�szHTTPSConnection.__init__c		Cs�t�|j|jtjtj�}|D]�}|\}}}}}zt�|||�}Wntjy\d}YqYn0z"|�|j|jf�|�|j	�Wn$tjy�|�
�d}YqYn0q�q|dur�t�d��t�||j
�|_|j��dS)z'Connect to a host on a given (SSL) portNz0Unable to connect to the host and port specified)�socketZgetaddrinfor#r$Z	AF_UNSPECZSOCK_STREAM�errorr-r.rr*r�	SSLSocketrOr'�init_ssl)	r�results�r�afZsocktype�protoZ	canonnameZsar'rrrr-�s,�


zHTTPSConnection.connect)rrrr	r&rrNr@rr0rr-rrrrrN�s�
rNc@seZdZdd�ZdS)�HTTPSProxyResponsecCst�|�d|_dS)Nr)r	r(r)r/rrrr(�s
zHTTPSProxyResponse.beginN)rrrr(rrrrrX�srXc@sBeZdZejZddddejfdd�Zdd�Zddd�Z	d	d
�Z
dS)�HTTPSProxyConnectionNc	Cs*tj|||||||d�|pg}||_dSr2)r1rrO)rr:r#r$r;r<rOrrrrr�s
�zHTTPSProxyConnection.__init__cCs�t�|�d|j|jf}t�|d|�|��t�|�|j}t	|_t�
|�}||_|��|jdkr�|��t
�||j|j|j��t�|j|j�|_|j��dS)NrGZCONNECT��)r1r-r6r7rrBrCZ
endheadersr&rXr,r*�status�	xmlrpclibZ
ProtocolError�reason�msgrrRr'rOrS)rr#r&r+rrrr-�s"



�zHTTPSProxyConnection.connectrcCstj||||d�S)Nr>)rrB)rrDrEr?rrrrB�szHTTPSProxyConnection.putrequestcCst�|�|�d|j�dS)Nz
User-Agent)r1rCrMr"r/rrrrC�s
z'HTTPSProxyConnection._add_proxy_headers)r)rrrrNr@rr0rr-rBrCrrrrrY�s�

rYcCs$|durdSt�|�}|�d�SdS)zJ Convert Internationalized domain name from Punycode (RFC3492) to Unicode N�idna)rrK�decode�rFrrr�idn_puny_to_unicode�s
rbcCs*|durdSt�|�}t�|�d��SdS)zZ Convert domain name to Punycode (RFC3492). Hostname can be instance of string or Unicode Nr_)rZustr�encoderarrr�idn_ascii_to_punys
rd)rJZencodings.idna�	encodingsrP�platformrZrhnrrrrrrrr\�ImportErrorZhttp.clientZclientZ
xmlrpc.clientr	rr1rNrXrYrbrdrrrr�<module>
s,S,&.