403Webshell
Server IP : 74.208.236.16  /  Your IP : 216.73.217.15
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : u102440577 ( 7172810)
PHP Version : 8.4.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/mercurial/__pycache__/keepalive.cpython-313.pyc
�

6�hbX��P�SrSSKJr SSKrSSKrSSKrSSKrSSKJr SSK	J
r
 SSKJrJ
r
Jr SSKJr \R"r\R$r\R&rSq"S	S
5r"SS5r"S
S\\R.5r"SS\R25rSrSr"SS\R85rSrSrSSjrSr SSjr!\"S:Xa3SSK#r#\$"\RJS5r&\RJSr'\!"\'\&5 gg!\(\)4a \*"S\RJS-5 gf=f)aKAn HTTP handler for urllib2 that supports HTTP 1.1 and keepalive.

>>> import urllib2
>>> from keepalive import HTTPHandler
>>> keepalive_handler = HTTPHandler()
>>> opener = urlreq.buildopener(keepalive_handler)
>>> urlreq.installopener(opener)
>>>
>>> fo = urlreq.urlopen('http://www.python.org')

If a connection to a given host is requested, and all of the existing
connections are still in use, another connection will be opened.  If
the handler tries to use an existing connection but it fails in some
way, it will be closed and removed from the pool.

To remove the handler, simply re-run build_opener with no arguments, and
install that opener.

You can explicitly close connections by using the close_connection()
method of the returned file-like object (described below) or you can
use the handler methods:

  close_connection(host)
  close_all()
  open_connections()

NOTE: using the close_connection and close_all methods of the handler
should be done with care when using multiple threads.
  * there is nothing that prevents another thread from creating new
    connections immediately after connections are closed
  * no checks are done to prevent in-use connections from being closed

>>> keepalive_handler.close_all()

EXTRA ATTRIBUTES AND METHODS

  Upon a status of 200, the object returned has a few additional
  attributes and methods, which should not be used if you want to
  remain consistent with the normal urllib2-returned objects:

    close_connection()  -  close the connection to the host
    readlines()         -  you know, readlines()
    status              -  the return status (i.e. 404)
    reason              -  english translation of status (i.e. 'File not found')

  If you want the best of both worlds, use this inside an
  AttributeError-catching try:

  >>> try: status = fo.status
  >>> except AttributeError: status = None

  Unfortunately, these are ONLY there if status == 200, so it's not
  easy to distinguish between non-200 responses.  The reason is that
  urllib2 tries to do clever things with error codes 301, 302, 401,
  and 407, and it wraps the object upon return.
�)�annotationsN�)�_)�hex)�pycompat�urllibcompat�util)�procutilc�@�\rSrSrSrSrSrSrSrSr	SS	jr
S
rg)�ConnectionManager�lzH
The connection manager must be able to:
  * keep track of all existing
c��[R"5Ul[R"[
5Ul0Ul0Ulg�N)	�	threading�Lock�_lock�collections�defaultdict�list�_hostmap�_connmap�	_readymap��selfs �5/usr/lib/python3/dist-packages/mercurial/keepalive.py�__init__�ConnectionManager.__init__rs0���^�^�%��
�#�/�/��5��
���
����c� �URR5 URURU5 XRU'X0R
U'URR
5 g!URR
5 f=fr)r�acquirer�appendrr�release)r�host�
connection�readys    r�add�ConnectionManager.addxsg���
�
����	!��M�M�$��&�&�z�2�(,�M�M�*�%�).�N�N�:�&��J�J��� ��D�J�J��� �s�:A1�1B
c��URR5 URUnURU	URU	URURU5 URU(d
URU	URR5 g![a N'f=f!URR5 f=fr)rr rrr�remove�KeyErrorr")rr$r#s   rr)�ConnectionManager.remove�s����
�
����	!�	
,��}�}�Z�0���M�M�*�-��N�N�:�.��
�
�d�#�*�*�:�6��}�}�T�*��
�
�d�+��J�J��� ���
��
��
�J�J��� �s)�B �AB0� 
B-�*B0�,B-�-B0�0Cc�B�X RU'g![a gf=fr)rr*)rr$r%s   r�	set_ready�ConnectionManager.set_ready�s%��	�).�N�N�:�&���	��	�s��
�c�,�SnURR5 URUH*nURU(dMSURU'Un O URR	5 U$!URR	5 f=f)NF)rr rrr")rr#�conn�cs    r�get_ready_conn� ConnectionManager.get_ready_conn�s�����
�
����	!��]�]�4�(���>�>�!�$�$�(-�D�N�N�1�%��D��	)�
�J�J��� ����
�J�J��� �s�$A7�A7�7BNc
���U(a[URU5$[URR5VVs0sHup#U[U5_M snn5$s snnfr)rr�dict�items)rr#�h�connss    r�get_all�ConnectionManager.get_all�sT�����
�
�d�+�,�,��26�-�-�2E�2E�2G�H�2G�J�Q��D��K��2G�H��
��Hs�A"
)rrrrr)�__name__�
__module__�__qualname__�__firstlineno__�__doc__rr&r)r-r2r9�__static_attributes__�rrrrls%���
�!�!� ��rrc�X�\rSrSrSSjrSrSrSrSrSSjr	S	r
S
rSrSr
S
rg)�KeepAliveHandler�Nc�J�[5UlXlSUlSUlg�Nr)r�_cm�_timeout�
requestscount�sentbytescount)r�timeouts  rr�KeepAliveHandler.__init__�s!��$�&����
������rc��URR5R5VVs/sHupU[U54PM snn$s snnf)zlreturn a list of connected hosts and the number of connections
to each.  [('foo.com:80', 2), ('bar.org', 1)])rGr9r6�len)rr#�lis   r�open_connections�!KeepAliveHandler.open_connections�s>��37�(�(�2B�2B�2D�2J�2J�2L�M�2L�J�T��s�2�w��2L�M�M��Ms�A	c��URRU5H.nURRU5 UR5 M0 g)z�close connection(s) to <host>
host is the host:port spec, as in 'www.cnn.com:8080' as passed in.
no error occurs if there is no connection to that host.N)rGr9r)�close)rr#r7s   r�close_connection�!KeepAliveHandler.close_connection�s6�����!�!�$�'�A��H�H�O�O�A��
�G�G�I�(rc���URR5R5H9upUH.nURRU5 UR	5 M0 M; g)zclose all open connectionsN)rGr9r6r)rS)rr#r8r7s    r�	close_all�KeepAliveHandler.close_all�sG���8�8�+�+�-�3�3�5�K�D���������"����	��6rc�<�URRUS5 g)z]tells us that this request is now closed and that the
connection is ready for another requestTN)rGr-)r�requestr#r$s    r�_request_closed� KeepAliveHandler._request_closed�s��	
�����:�t�,rc�h�U(aUR5 URRU5 gr)rSrGr))rr#r$rSs    r�_remove_connection�#KeepAliveHandler._remove_connection�s!������������
�#rc�.�UR[U5$r)�do_open�HTTPConnection)r�reqs  r�	http_open�KeepAliveHandler.http_open�s���|�|�N�C�0�0rc��[R"U5nU(d[RS5eURRU5nU(aiUR
XBU5nU(aO�UR5 URRU5 URRU5nU(aMiU"X0RS9n[(a [RSU[U55 URRX4S5 URXB5 UR5n[1USS5(aURRU5 [(a+[RSUR2UR45 XlX5lUR;5UlXElUR2Ul URBUl"UR4Ul!U$![ R"aDn[R[%S5[&R("UR*5-5eSnAf[,[ R.4an[RU5eSnAff=f)	Ns
no host given)rKs"creating new connection to %s (%d)Fsbad HTTP status line: %s�
will_closeTsSTATUS: %s, %s)#r�gethost�urlerr�urlerrorrGr2�_reuse_connectionrSr)rH�DEBUG�info�idr&�_start_transaction�getresponse�httplib�
BadStatusLinerr�sysbytes�line�OSError�
HTTPException�getattr�status�reason�_handler�_host�get_full_url�_url�_connection�code�msg�headers)r�
http_classrcr#r7�r�errs       rra�KeepAliveHandler.do_open�s����#�#�C�(����/�/�"2�3�3� 	'����'�'��-�A���*�*�1�4�8�������	�������"��H�H�+�+�D�1���!��t�]�]�;���5��J�J�=�t�R��U�������T�e�,��'�'��/��M�M�O���1�l�D�)�)��H�H�O�O�A���5��J�J�(�!�(�(�A�H�H�=��
����!�!�#����
�������E�E��	���������/�$�$�	��/�/��-�.��1B�1B�3�8�8�1L�L��
����.�.�/�	'��/�/�#�&�&��	'�s1�;G7�0A
G7�?A8G7�7J�?I
�
J�'I<�<Jc��URX5 UR5nUbURS:Xa/[
(a [
RSU[U55 SnU$[
(a [
RSU[U55 U$![[R4a SnN� [
(a [
R
SU[U55 URRU5 UR5 e=f)astart the transaction with a re-used connection
return a response object (r) upon success or None on failure.
This DOES not close or remove bad connections in cases where
it returns.  However, if an unexpected exception occurs, it
will close and remove the connection before re-raising.
Ns4unexpected exception - closing connection to %s (%d)�	s&failed to re-use connection to %s (%d)sre-using connection to %s (%d))
rorprurqrvrl�errorrnrGr)rS�versionrm)rr7rcr#r�s     rrk�"KeepAliveHandler._reuse_connections���	��#�#�A�+��
�
��A�2
�9��	�	�Q��
�u��
�
�=�t�R��U���A�
���u��
�
�<�d�B�q�E�J����I��.�.�/�	��A�	��u����K���q�E��

�H�H�O�O�A��
�G�G�I��s�!B�D�0ADc���[USS5n[R"URR5nUR[
URR555 UR[
URR555 [R"SUR555n0nSH"nXd;dM
SUSURSS5-'M$ [R"U5(a�[R"U5nUR"UR5[R "U540UD6 S	U;aUR#S
S5 SU;aUR#S
S[%U5-5 O7UR"UR5[R "U540UD6 UR5Hup�UR#X�5 M UR-5 [R"U5(aUR/W5 U=R0S-
slU=R2[USS5U-
-
slUR=R0S-
slUR=R2[USS5U-
-
slg![&an[(R+U5eSnAff=f![4a gf=f)NrJrc3�J# �UHupUR5U4v� M g7fr)�lower)�.0�n�vs   r�	<genexpr>�6KeepAliveHandler._start_transaction.<locals>.<genexpr>Ks���K�?�4�1�����A��?�s�!#)r#zaccept-encodingr�skip_�-rzcontent-typezContent-typez!application/x-www-form-urlencodedzcontent-lengthzContent-lengthz%d)rwr	�sortdict�parent�
addheaders�update�sortedr�r6�unredirected_hdrs�replacer�hasdata�getdata�
putrequest�
get_method�getselector�	putheaderrNrurirj�
endheaders�sendrIrJ�AttributeError)rr7rc�
oldbytescountr��skipheadersr��datar��kr�s           rro�#KeepAliveHandler._start_transactionBs_����#3�Q�7�
�
�-�-���� 6� 6�7�����v�c�k�k�/�/�1�2�3����v�c�3�3�9�9�;�<�=��-�-�K�7�=�=�?�K�K����,�A��|�=>��G�a�i�i��S�&9�9�:�-�	'��#�#�C�(�(�#�+�+�C�0������N�N�$� �,�,�S�1��"��
"��0��K�K�&�(K��$�7�2��K�K� 0�$��T��2B�C������N�N�$� �,�,�S�1��"���M�M�O�D�A�
�K�K���$�	��������$�$�
�F�F�4�L�	
���a������w�q�*:�A�>��N�N��	��K�K�%�%��*�%��K�K�&�&���+�Q�/�-�?�
�&���	'��/�/�#�&�&��	'��"�	��	�s2�2B#J9�6J9�,AK �9
K�K�K� 
K-�,K-)rGrHrIrJr�r)r;r<r=r>rrPrTrWr[r^rdrarkror@rArrrCrC�s7�� �N�
��-�
$�1�7�r0�d4rrCc��\rSrSrSrg)�HTTPHandleriyrAN)r;r<r=r>r@rArrr�r�ys��rr�c�n^�\rSrSrSSjrSrSrSrSrSU4Sjjr	S
SU4Sjjjr
U4S	jrS
rU=r
$)�HTTPResponsei}c���[RRXX$S9 URUlSUlSUlSUlSUlSUlSUl	SUl
SUlg)N)�
debuglevel�methodrri�)rqr�r�filenor�receivedbytescount�_rbuf�	_rbufsizerzr{r}r~)r�sockr��strictr�s     rr�HTTPResponse.__init__�sg�����%�%��:�	&�	
��k�k�����	�"#�����
������
���
���	���rc���UR(adURR5 SUlUR(a1URRXRUR
5 gggr)�fprSrzr[r{r~rs rrS�HTTPResponse.close�sO���7�7��G�G�M�M�O��D�G��}�}��
�
�-�-��*�*�d�&6�&6���rc�$�UR5 gr�rSrs r�_close_conn�HTTPResponse._close_conn�s���
�
�rc��URRURURSS9 UR	5 g)Nrr�)rzr^r{r~rSrs rrT�HTTPResponse.close_connection�s.���
�
�(�(����T�5E�5E�Q�(�O��
�
�rc��UR$r)r}rs r�geturl�HTTPResponse.geturl�s���y�y�rc�J>�[TU]U5nU=R[U5-
slURb(UR=R[U5-
slUR
b2UR
R=R[U5-
slU$r)�super�readr�rNr~rzr�)r�amtr��	__class__s   �rr��HTTPResponse.read�s{����w�|�C� �����3�t�9�,�����'����/�/�3�t�9�<�/��=�=�$��M�M� � �3�3�s�4�y�@�3��rc�F>�[TU]US9nU=R[U5-
slURb(UR=R[U5-
slUR
b2UR
R=R[U5-
slU$)N)�limit)r��readliner�rNr~rzr�)rr�r�r�s   �rr��HTTPResponse.readline�s����w��e��,�����3�t�9�,�����'����/�/�3�t�9�<�/��=�=�$��M�M� � �3�3�s�4�y�@�3��rc�>�[TU]U5nU=RU-
slURbUR=RU-
slURb)URR
=RU-
slU$r)r��readintor�r~rzr�)r�dest�gotr�s   �rr��HTTPResponse.readinto�sp����g��t�$�����3�&�����'����/�/�3�6�/��=�=�$��M�M� � �3�3�s�:�3��
r)
r~rzr{r�r�r}rr�r�r�)rrNr)���)r��int)r;r<r=r>rrSr�rTr�r�r�r�r@�
__classcell__�r�s@rr�r�}s5��� �&��������rr�c�<�[USS5bgURc2UR(aUR5 O[R
eURS:�a[S[U55 Sn[USS5nUbvURS:�a[S5 U"U5nU(aKURRU5 U=R[U5-
sl
U"U5nU(aMJggURRU5 U=R[U5-
sl
g![aZ UR[R:XaSUlUR!5UlSnOS	nUR#5 U(aegf=f)
zXSend `str' to the server.

Shamelessly ripped off from httplib to patch a bad behavior.
�_broken_pipe_respNrssend:i r�ssending a read()ableFT)rwr��	auto_open�connectrq�NotConnectedr��print�repr�sendallrJrN�BrokenPipeError�_HTTPConnection__state�_CS_REQ_SENTr�rprS)r�str�	blocksizer�r��reraises      r�safesendr��sR���t�(�$�/�;���y�y���>�>��L�L�N��&�&�&������
�h��S�	�"���	��s�F�D�)��������"��-�.��	�?�D���	�	�!�!�$�'��#�#�s�4�y�0�#��I����$�

�I�I���c�"����3�s�8�+����	��&�&�'�*>�*>�>�%)�D�"�%)�%5�%5�%7�D�"��G��G��
�
�����	�s�5BD7�=9D7�7A!F�Fc�J^�U4SjnTRRUlU$)z9Wraps getresponse in cls with a broken-pipe sane version.c�J>�[USS5nUbU$TRU5$)Nr�)rwrp)rr��clss  �r�safegetresponse�(wrapgetresponse.<locals>.safegetresponse�s-���

�D�-�t�4���=��H����t�$�$r)rpr?)r�r�s` r�wrapgetresponser��s"���%�"�o�o�5�5�O���rc�Z^�\rSrSr\r\r\"\	R5rSrU4Sjr
SrU=r$)rbic�h�[RR"U/UQ70UD6 SUlSUlgrF)rqrbrrJr�)r�args�kwargss   rr�HTTPConnection.__init__s0�����'�'��>�t�>�v�>����"#��rc��>�[TU]5nSnURnU(aSUR5-nSXUR
UR4-$![a N(f=f)Nz
(unconnected)z%s:%dz<%s: %s <--> %s:%d>)r��__repr__r��getsocknamerur#�port)r�base�local�sr�s    �rr��HTTPConnection.__repr__sf����w��!�����I�I���
��!�-�-�/�1��%��T�Y�Y��	�	�'J�J�J���
��
�s�A�
A"�!A")r�rJ)r;r<r=r>r��response_classr�r�r�rqrbrprr�r@r�r�s@rrbrbs0���"�N��D�!�'�"8�"8�9�K�$�
	K�	Krrbc�Z�[RnSn[R5n[R	U5 [RU5nUR
5nUR5 U"U5n[US[UR554-5 [R[55n[R	U5 [RU5nUR
5nUR5 U"U5n[US[UR554-5 [RU5nSnUR5nU(aXW-nOOMUR5 U"U5n[US[UR554-5 g)Ns%25s: %ss
normal urllibskeepalive readrskeepalive readline)
�hashlib�md5�urlreq�buildopener�
installopener�urlopenr�rSr�r�digestr�r�)�urlr��format�opener�fo�foo�m�fs        r�
continuityr
,sD��
�+�+�C�
�F��
�
�
!�F�
���� �	����	�B�
�'�'�)�C��H�H�J��C��A�	�&�$�c�!�(�(�*�o�6�
6�7��
�
��
�
.�F�
���� �	����	�B�
�'�'�)�C��H�H�J��C��A�	�&�%�s�1�8�8�:��7�
7�8�	����	�B�

�C�
��K�K�M����'�C����H�H�J��C��A�	�&�)�3�q�x�x�z�?�;�
;�<rc���[SX4-5 [RRS5 [R5n[R
U5 [X5n[SU-5 [RRS5 [R[55n[R
U5 [X5n[SU-5 [SX4--5 g)Ns   making %i connections to:
  %ss(  first using the normal urllib handlerss  TIME: %.3f ss(  now using the keepalive handler       s  improvement factor: %.2f)	r�r
�stdout�writer�r�r�fetchr�)�Nrr�t1�t2s     r�comprPs���	�
.�!��
9�:��O�O���E�F�
�
�
�
!�F�
���� �	�q��B�	�
�b�
 �!��O�O���E�F�
�
�
��
�
.�F�
���� �	�q��B�	�
�b�
 �!�	�
'�2�7�
3�4rc��SSKn/nUR"5n[U5HqnU(aUS:�aUR"U5 [R	U5nUR5nUR
5 UR[U55 Ms UR"5U-
n	Sn
USSH!nU
S-n
XdS:XaM[SX�4-5 M# U	$)Nrrs+WARNING: inconsistent length on read %i: %i)
�time�range�sleepr�rr�rSr!rNr�)rr�delayr�lens�	starttime�irr�diff�js           rrrcs����
�D��	�	��I�
�1�X���Q��U��J�J�u��
�^�^�C�
 ���g�g�i��
���
����C��H��
��9�9�;��"�D�	�A�
�!�"�X��
��E����G�|��@�A�6�I�J��
�Krc��[n"SS5nU"5q[S5 [RU5nUR	5nUR5 Sn[SU-5 US:�ac[RRSU-5 [RR5 [R"S5 US-nUS:�aMc[RRS	5 [S
5 [RU5nUR	5nUR5 XF:Xa[S5 Uqg[S5 Uqg)
Nc�&�\rSrSrSr\=r=rrSrg)� test_timeout.<locals>.FakeLoggeri~c��[X-5 gr)r�)rr�r�s   r�debug�&test_timeout.<locals>.FakeLogger.debugs���#�*�rrAN)	r;r<r=r>r!rm�warningr�r@rArr�
FakeLoggerr~s��	�"'�&��&�w�rr$s-  fetching the file to establish a connection�s;  waiting %i seconds for the server to close the connectionrs
  %2ir�
s!  fetching the file a second times  data are identicals  ERROR: DATA DIFFER)
rlr�r�rr�rSr
rr
�flushrr�stderr)r�dbbackupr$r�data1r�data2s       r�test_timeoutr,zs���H�'�'�
�L�E�	�
:�;�	����	�B��G�G�I�E��H�H�J�
�A�	�
H�1�
L�M�
�a�%������j�1�n�-��������
�
�1�
�	�Q���	�a�%�

�O�O���%� �	�
.�/�	����	�B��G�G�I�E��H�H�J��~�
�%�&�
�E�	�%�&��Erc��[S5 [U5 [S5 [S5 [X5 [S5 [S5 [U5 g)Ns>performing continuity test (making sure stuff isn't corrupted)rsperforming speed comparisons#performing dropped-connection check)r�r
rr,)rrs  r�testr.�sA��	�
K�L��s�O�	�#�J�	�
(�)���L�	�#�J�	�
0�1���r�__main__�z%s <integer> <url>r�)�
)+r?�
__future__rrr��sysr�i18nr�noder�rrr	�utilsr
rqrir�rlrrC�httphandlerr�r�r�r�rbr
rrr,r.r;rr��argvrr�
IndexError�
ValueErrorr�rArr�<module>r<s;��47�v#���
������
�
�,�,��	
����	
������>�>�BI�I�X	�"�F�$6�$6�	�E�7�'�'�E�P3�l�"K�W�+�+�K�@!=�H5�&�.#�L��z�������������h�h�q�k��	
�S�!����
�
�#�2�
�"�S�X�X�a�[�0�1�2�s�$D� D%�$D%

Youez - 2016 - github.com/yon3zu
LinuXploit