• File: httplib.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyc
  • Date Modified: 03/28/2024 3:28 PM
  • File size: 42.04 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

fc@sIdZddlZddlZddlZddlmZyddlmZWn!ek
rqddlmZnXddddd	d
ddd
dddddddddgZ	dZ
dZdZdZ
dZdZdZdZdZd Zd!Zd"Zd#Zd$Zd%Zd&Zd'Zd(Zd)Zd*Zd+Zd,Zd-Z d.Z!d/Z"d0Z#d1Z$d2Z%d3Z&d4Z'd5Z(d6Z)d7Z*d8Z+d9Z,d:Z-d;Z.d<Z/d=Z0d>Z1d?Z2d@Z3dAZ4dBZ5dCZ6dDZ7dEZ8dFZ9dGZ:dHZ;dIZ<dJZ=dKZ>dLZ?dMZ@i)dNd6dOd6dPd 6dQd!6dRd"6dSd#6dTd$6dUd%6dVd&6dWd)6dXd*6dYd+6dZd,6d[d-6d\d.6d]d^6d_d/6d`d06dad16dbd26dcd36ddd46ded56dfd66dgd76dhd86did96djd:6dkd;6dld<6dmd=6dnd>6dod?6dpd@6dqdA6drdF6dsdG6dtdH6dudI6dvdJ6dwdK6ZAdxZBdyejCfdzYZDdfd{YZEdfd|YZFd}fd~YZGdfdYZHdeHfdYZIdeHfdYZJdeFfdYZKdfdYZLeMedrdeLfdYZNnd	eOfdYZPd
ePfdYZQdePfdYZRdePfdYZSdePfdYZTd
ePfdYZUdePfdYZVdePfdYZWdeWfdYZXdeWfdYZYdeWfdYZZdePfdYZ[ePZ\dfdYZ]dZ^e_dkrEe^ndS(s	HTTP/1.1 client library

<intro stuff goes here>
<other stuff, too>

HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:

    (null)
      |
      | HTTPConnection()
      v
    Idle
      |
      | putrequest()
      v
    Request-started
      |
      | ( putheader() )*  endheaders()
      v
    Request-sent
      |
      | response = getresponse()
      v
    Unread-response   [Response-headers-read]
      |\____________________
      |                     |
      | response.read()     | putrequest()
      v                     v
    Idle                  Req-started-unread-response
                     ______/|
                   /        |
   response.read() |        | ( putheader() )*  endheaders()
                   v        v
       Request-started    Req-sent-unread-response
                            |
                            | response.read()
                            v
                          Request-sent

This diagram presents the following rules:
  -- a second request may not be started until {response-headers-read}
  -- a response [object] cannot be retrieved until {request-sent}
  -- there is no differentiation between an unread response body and a
     partially read response body

Note: this enforcement is applied by the HTTPConnection class. The
      HTTPResponse class does not enforce this state machine, which
      implies sophisticated clients may accelerate the request/response
      pipeline. Caution should be taken, though: accelerating the states
      beyond the above pattern may imply knowledge of the server's
      connection-close behavior for certain requests. For example, it
      is impossible to tell whether the server will close the connection
      UNTIL the response headers have been read; this means that further
      requests cannot be placed into the pipeline until it is known that
      the server will NOT be closing the connection.

Logical State                  __state            __response
-------------                  -------            ----------
Idle                           _CS_IDLE           None
Request-started                _CS_REQ_STARTED    None
Request-sent                   _CS_REQ_SENT       None
Unread-response                _CS_IDLE           <response_class>
Req-started-unread-response    _CS_REQ_STARTED    <response_class>
Req-sent-unread-response       _CS_REQ_SENT       <response_class>
iN(turlsplit(tStringIOtHTTPtHTTPResponsetHTTPConnectiontHTTPSConnectiont
HTTPExceptiontNotConnectedtUnknownProtocoltUnknownTransferEncodingtUnimplementedFileModetIncompleteReadt
InvalidURLtImproperConnectionStatetCannotSendRequesttCannotSendHeadertResponseNotReadyt
BadStatusLineterrort	responsesiPitUNKNOWNtIdlesRequest-startedsRequest-sentidieifiiiiiiiiii,i-i.i/i0i1i3iiiiiiiiiiiiiiiiiiiiiiiiiiiiiitContinuesSwitching ProtocolstOKtCreatedtAcceptedsNon-Authoritative Informations
No Contents
Reset ContentsPartial ContentsMultiple ChoicessMoved PermanentlytFounds	See OthersNot Modifieds	Use Proxys(Unused)i2sTemporary RedirectsBad RequesttUnauthorizedsPayment Requiredt	Forbiddens	Not FoundsMethod Not AllowedsNot AcceptablesProxy Authentication RequiredsRequest TimeouttConflicttGonesLength RequiredsPrecondition FailedsRequest Entity Too LargesRequest-URI Too LongsUnsupported Media TypesRequested Range Not SatisfiablesExpectation FailedsInternal Server ErrorsNot ImplementedsBad GatewaysService UnavailablesGateway TimeoutsHTTP Version Not SupporteditHTTPMessagecBs#eZdZdZdZRS(cCsT|jj|}|dkr.||j|<n"dj||f}||j|<dS(s*Add header for field key handling repeats.s, N(tdicttgettNonetjoin(tselftkeytvaluetprevtcombined((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt	addheaders
cCs&|j|}|d||j|<dS(s-Add more field data from a continuation line.s
 N(R (R$R%tmoreR'((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytaddcontinues
cCs*i|_d|_g|_}d|_d}d}d}}}t|jdrc|jj}n|jr{|jj	}nxt
r%|ry
|}Wqtk
rd}}d|_qXn|jj}|sd|_Pn|r|j
dr|j||_q~nd}|rS|ddkrS|j||j||jq~n(|j|rhq~n|j|r{Pn|j|}|r|j||j||t|djq~q~|jsd|_n	d	|_|r||n)|r|jj|n|jd
|_Pq~WdS(s:Read header lines.

        Read header lines up to the entirely blank line that terminates them.
        The (normally blank) line that ends the headers is skipped, but not
        included in the returned list.  If a non-header line ends the headers,
        (which is an error), an attempt is made to backspace over it; it is
        never included in the returned list.

        The variable self.status is set to the empty string if all went well,
        otherwise it is an error message.  The variable self.headers is a
        completely uninterpreted list of lines contained in the header (so
        printing them will reproduce the header exactly as it appears in the
        file).

        If multiple header fields with the same name occur, they are combined
        according to the rules in RFC 2616 sec 4.2:

        Appending each subsequent field-value to the first, each separated
        by a comma. The order in which header fields with the same field-name
        are received is significant to the interpretation of the combined
        field value.
        titunreadisEOF in headerssFrom s 	s
No headerss%Non-header line where header expecteds
; bad seekN(R tunixfromtheaderststatusR"thasattrtfpR-tseekablettelltTruetIOErrortreadlinet
startswithtappendR+tstript	iscommenttislasttisheaderR)tlentseek(R$thlistt
headerseent	firstlinetstartoflineR-R4tline((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytreadheaderss`		
			


	

$		
(t__name__t
__module__R)R+RE(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs			cBszeZddddZdZdZdZdZdZddZ	dZ
d	Zdd
ZdZ
RS(
icCs||jdd|_||_||_||_d|_t|_t|_	t|_
t|_t|_t|_
t|_dS(Ntrbi(tmakefileR2t
debugleveltstrictt_methodR"tmsgt_UNKNOWNtversionR0treasontchunkedt
chunk_lefttlengtht
will_close(R$tsockRJRKtmethod((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt__init__Cs										cCse|jj}|jdkr0dGt|GHn|sEt|ny|jdd\}}}WnMtk
ry"|jdd\}}d}Wqtk
rd}qXnX|jds|j	r|j
t|qt||j|_dSny7t|}|d	ks(|d
kr7t|nWntk
rWt|nX|||fS(Nisreply:iiR,sHTTP/sHTTP/0.9iidi(sHTTP/0.9iR,(
R2R7RJtreprRtsplitR"t
ValueErrorR8RKtclosetLineAndFileWrappertint(R$RDROR0RP((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt_read_statusUs4


	

c
Cs|jdk	rdSxvtr|j\}}}|tkrAPnxDtr|jjj}|siPn|jdkrDdG|GHqDqDWqW||_	|j|_
|dkrd|_n?|jdrd|_n$|dkrd|_nt
||jdkr;d|_d|_d	|_tt|_dSt|jd|_|jdkrx|jjD]}dG|GqlWnd|j_|jjd
}|r|jdkrd	|_d|_n	d|_|j|_|jjd}|r9|jr9yt||_WqBtk
r5d|_qBXn	d|_|tks|tksd
|koqdkns|jdkrd|_n|jr|jr|jdkrd	|_ndS(Nisheader:sHTTP/1.0i
sHTTP/1.isHTTP/0.9i	istransfer-encodingRQscontent-lengthiditHEAD(RMR"R5R^tCONTINUER2R7R:RJR0RPROR8RRSRQRTRRR/t	getheadertlowerRRt_check_closeR]RZt
NO_CONTENTtNOT_MODIFIEDRL(R$ROR0RPtskipthdrttr_encRS((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytbeginzsj								
	

cCs|jjd}|jdkrS|jjd}|rOd|jkrOtStS|jjdritS|rd|jkrtS|jjd}|rd|jkrtStS(Nt
connectioniR[s
keep-alivesproxy-connection(RMRaRORbR5tFalse(R$tconntpconn((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRcscCs&|jr"|jjd|_ndS(N(R2R[R"(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR[s	
cCs
|jdkS(N(R2R"(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytisclosedscCs|jdkrdS|jr)|j|S|dkr|jdkrV|jj}n|j|j}d|_|j|S|jdk	r||jkr|j}qn|jj|}|jdk	r|jt|8_n|S(NR,i(	R2R"RQt
_read_chunkedRStreadt
_safe_readR[R>(R$tamtts((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRps$	
	
cCs|jtkst|j}d}x*trP|dkr|jj}|jd}|dkrp|| }nt	|d}|dkrPqn|dkr||j
|7}n||kr||j
|7}|||_|S||kr||j
|7}|j
dd|_|S||j
|7}||8}|j
dd}q'Wx3tr|jj}|ssPn|dkrTPqTqTW|j|S(NR,t;iiis
(RQRNtAssertionErrorRRR5R"R2R7tfindR]RqR[(R$RrRRR&RDti((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRosF		


	


	
cCssg}x]|dkre|jjt|t}|sEt|n|j||t|8}q	Wdj|S(sVRead the number of bytes requested, compensating for partial reads.

        Normally, we have a blocking socket, but a read() can be interrupted
        by a signal (resulting in a partial read).

        Note that we cannot distinguish between EOF and an interrupt when zero
        bytes have been read. IncompleteRead() will be raised in this
        situation.

        This function should be used when <amt> bytes "should" be present for
        reading. If the bytes are truly not available (due to EOF), then the
        IncompleteRead exception can be used to detect the problem.
        iR,(R2Rptmint	MAXAMOUNTRR9R>R#(R$RrRstchunk((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRqJs
cCs.|jdkrtn|jj||S(N(RMR"RRa(R$tnametdefault((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRaascCs(|jdkrtn|jjS(s&Return list of (header, value) tuples.N(RMR"Rtitems(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt
getheadersfsN(RFRGR"RWR^RiRcR[RnRpRoRqRaR~(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR9s
	%	P				3	cBseZdZdZeZeZdZdZ	dZ
dddZdddZ
dZdZdZd	Zd
ZdZdZd
ZdddZdZdZdidZdZdZRS(isHTTP/1.1iicCstd|_g|_d|_t|_d|_d|_d|_d|_	|j
|||dk	rp||_ndS(N(R"RUt_buffert_HTTPConnection__responset_CS_IDLEt_HTTPConnection__stateRLt_tunnel_hostt_tunnel_portt_tunnel_hdrst
_set_hostportRK(R$thosttportRK((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWxs								cCs||_||_||_dS(N(RRR(R$RRR/((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt
set_tunnels		cCs|dkr|jd}|jd}||kryt||d}Wn)tk
rytd||dnX|| }n	|j}|r|ddkr|ddkr|dd!}qn||_||_dS(Nt:t]isnonnumeric port: '%s'it[i(R"trfindR]RZRtdefault_portRR(R$RRRwtj((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs

	&	cCs
||_dS(N(RJ(R$tlevel((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytset_debuglevelscCs|j|j|j|jd|j|jfx4|jjD]#\}}|jd||fqCW|jd|j|j	d|j
d|j}|j\}}}|dkr|j
tjd||jfnx)tr|jj}|dkrPqqWdS(NsCONNECT %s:%d HTTP/1.0
s%s: %s
s
RKRVisTunnel connection failed: %d %s(RRRtsendRRRt	iteritemstresponse_classRURKRLR^R[tsocketRR:R5R2R7(R$theaderR&tresponseROtcodetmessageRD((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt_tunnels
$
	cCs2d}xtj|j|jdtjD]}|\}}}}}yStj||||_|jdkrd|j|jfGHn|jj|Wnbtjk
r}|jdkrdG|j|jfGHn|jr|jj	nd|_q(nXPq(W|jstj|n|jr.|jndS(s3Connect to the host and port specified in __init__.s!getaddrinfo returns an empty listisconnect: (%s, %s)s
connect fail:N(
RtgetaddrinfoRRtSOCK_STREAMRURJtconnectRR[R"RR(R$RMtrestaftsocktypetprotot	canonnametsa((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs*				cCsQ|jr"|jjd|_n|jrD|jjd|_nt|_dS(s(Close the connection to the HTTP server.N(RUR[R"RRR(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR[s	
	
cCs|jdkr1|jr%|jq1tn|jdkrRdGt|GHny|jj|Wn6tj	k
r}|ddkr|j
nnXdS(sSend `str' to the server.issend:i N(RUR"t	auto_openRRRJRXtsendallRRR[(R$tstrtv((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs	

cCs|jj|dS(suAdd a line of output to the current request buffer.

        Assumes that the line does *not* end with \r\n.
        N(RR9(R$Rs((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt_outputscCs:|jjddj|j}|j2|j|dS(spSend the currently buffered request and clear the buffer.

        Appends an extra \r\n to the buffer.
        R,s
N(R,R,(RtextendR#R(R$RM((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt_send_outputsc
Cs|jr$|jjr$d|_n|jtkr?t|_n	t||_|s`d}nd|||jf}|j	||j
dkr|sd}|jdrt|\}}}}}n|ry|j
d}Wn tk
r|j
d}nX|jd|qy|jj
d}	Wn#tk
rU|jj
d}	nX|jtkrx|jd|	q|jdd	|	|jfn|s|jd
dqndS(
s`Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
        `skip_host' if True does not add automatically a 'Host:' header
        `skip_accept_encoding' if True does not add automatically an
           'Accept-Encoding:' header
        t/s%s %s %siR,thttptasciitidnatHosts%s:%ssAccept-EncodingtidentityN(RRnR"RRt_CS_REQ_STARTEDRRLt
_http_vsn_strRt	_http_vsnR8RtencodetUnicodeEncodeErrort	putheaderRRt	HTTP_PORT(
R$RVturlt	skip_hosttskip_accept_encodingRtnetloctnilt
netloc_encthost_enc((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt
putrequests>			


 
cCs<|jtkrtnd||f}|j|dS(skSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        s%s: %sN(RRRR(R$RR&R((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRdscCs2|jtkrt|_n	t|jdS(s?Indicate that the last header line has been sent to the server.N(RRt_CS_REQ_SENTRR(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt
endheadersos	cCsmy|j||||WnLtjk
rh}|ddksI|jrOn|j||||nXdS(s&Send a complete request to the server.ii N(t
_send_requestRRR(R$RVRtbodyR/R((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytrequestysc
Cstjg|D]}|j^q
}i}d|krGd|d<nd|kr`d|d<n|j||||rd|kr|jdtt|nx*|jD]\}}	|j||	qW|j|r|j	|ndS(NRiRsaccept-encodingRscontent-lengthsContent-Length(
R tfromkeysRbRRRR>RRR(
R$RVRRR/tktheader_namestskipsRgR&((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs(


c	Cs|jr$|jjr$d|_n|jtks<|jrHtn|jdkr|j|j|jd|j	d|j
}n$|j|jd|j	d|j
}|j|jt
kstt|_|jr|jn	||_|S(s!Get the response from the server.iRKRVN(RRnR"RRRRJRRURKRLRiRTRNRuRR[(R$R((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytgetresponses"	
		
	N(RFRGRRRRRRRRJRKR"RWRRRRRR[RRRRRRRRR(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRms.					
			
k		
	tSharedSocketcBs,eZdZdZdZdZRS(cCs||_d|_dS(Ni(RUt_refcnt(R$RU((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWs	cCs|jd7_dS(Ni(R(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytincrefscCsG|jd8_|jdks$t|jdkrC|jjndS(Nii(RRuRUR[(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytdecrefscCs|jjdS(N(RUR[(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt__del__s(RFRGRWRRR(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs			tSharedSocketClientcBseZdZdZRS(cCs/d|_||_|jj|j|_dS(Ni(t_closedt_sharedRRUt_sock(R$tshared((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWs		
cCs/|js+|jjd|_d|_ndS(Ni(RRRR"(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR[s	
	(RFRGRWR[(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs	tSSLFilecBseeZdZdZddZdZddZdZddZ	dZ
d	Zd
ZRS(s(File-like object wrapping an SSL socket.i cCs;tj||||_d|_|p1|jj|_dS(NR,(RRWt_sslt_buft	__class__tBUFSIZEt_bufsize(R$RUtssltbufsize((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWs		cCsd}xtry|jj|j}Wntjk
r}|dtjks	|dtjkriq	n|dtjks|dtj	krPnq	tj
k
r}|dtjkrq	n|dtj
krPnq	XPq	W|S(NR,i(R5RRpRRtsslerrortSSL_ERROR_WANT_READtSSL_ERROR_WANT_WRITEtSSL_ERROR_ZERO_RETURNt
SSL_ERROR_EOFRterrnotEINTRtEBADF(R$tbufterr((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt_reads(	cCs|jg}t|j}xU|dks6||krr|j}|dkrRPn|j||t|7}qWdj|}|dkrd|_|S|||_|| SdS(NR,(RR>R"RR9R#(R$tsizetLtavailRstall((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRps
	
cCs|jg}d|_xO|djd}|dkr;Pn|j}|dkrWPn|j|q|dkrdj|Sdj|}|jdd}|| }|||_|SdS(NR,is
ii(RRvRR9R#(R$RRwRsRRD((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR7+s"	


icCsfd}g}xStra|j}|s+Pn|j||t|7}|r||krPqqW|S(Ni(R5R7R9R>(R$tsizehintttotaltlistRD((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt	readlinesAs	
cCs
|jjS(N(Rtfileno(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRNscCs|S(N((R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt__iter__QscCs|j}|stn|S(N(R7t
StopIteration(R$RD((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytnextTs	N(
RFRGt__doc__RR"RWRRpR7RRRR(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs		
		t
FakeSocketcBsceZdd
dYZdZdZddZddZeZdddZ	d	Z
RS(t
_closedsocketcBseZdZRS(cCstdddS(Ni	sBad file descriptor(R(R$R{((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt__getattr__]s(RFRGR(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR\scCs)t|}tj||||_dS(N(RRRWR(R$RUR((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRW`scCs#tj||jj|_dS(N(RR[RRR(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR[es
cCs:|dkr$|dkr$tnt|j|j|S(NtrRH(R
RRR(R$tmodeR((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRIisicCs|jj|S(N(Rtwrite(R$tstufftflags((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRnsicCs|jj|S(N(RRp(R$R>R((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytrecvsscCst|j|S(N(tgetattrR(R$tattr((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRvs(N(RFRGRRWR[R"RIRRRR(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRZs		cBs2eZdZeZdddddZdZRS(s(This class allows communication via SSL.cCs,tj||||||_||_dS(N(RRWtkey_filet	cert_file(R$RRRRRK((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWs	cCstjtjtj}|j|j|jf|jrP||_|jntj	||j
|j}t|||_dS(s(Connect to a host on a given (SSL) port.N(
RtAF_INETRRRRRRURRRRR(R$RUR((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs		
N(RFRGRt
HTTPS_PORTRR"RWR(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRzs
	cBsteZdZdZdZdZeZddddZ	dZ
dddZdZd	Z
d
ZdZRS(
s-Compatibility class with httplib.py from 1.5.i
sHTTP/1.0iR,cCs5|dkrd}n|j|j|||dS(s:Provide a default host, since the superclass requires one.iN(R"t_setupt_connection_class(R$RRRK((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWs	cCs^||_|j|_|j|_|j|_|j|_|j|_|j|_d|_dS(N(	t_connRRRRRRR"tfile(R$Rl((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs	cCs3|dk	r"|jj||n|jjdS(sDAccept arguments to set the host/port, since the superclass doesn't.N(R"RRR(R$RR((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRscCs|jS(sCProvide a getfile, since the superclass' does not use this concept.(R(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytgetfilescGs |jj|dj|dS(s.The superclass allows only one value argument.s
	N(RRR#(R$Rtvalues((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRscCsy|jj}WnNtk
rc}|jjjdd|_|jd|_d|j	dfSX|j
|_|j|_|j|j
|j
fS(sCompat definition since superclass does not define it.

        Returns a tuple consisting of:
        - server status code (e.g. '200' if all goes well)
        - server "reason" corresponding to status code
        - any RFC822 headers in the response from the server
        RHiiN(RRRRURIRR[R"R/RDRMR2R0RP(R$Rte((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pytgetreplys
	cCs|jjd|_dS(N(RR[R"R(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR[s
N(RFRGRRRRJRRR"RWRRRRR
R[(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRs				RtHTTPScBs,eZdZeZddddddZRS(sCompatibility with 1.5 httplib interface

        Python 1.5.2 did not have an HTTPS class, but it defined an
        interface for sending http requests that is also useful for
        https.
        R,cCsM|dkrd}n|j|j|||||||_||_dS(Ni(R"RRRR(R$RRRRRK((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWs	
	N(RFRGRRRR"RW(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRscBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRscBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRscBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRscBseZdZRS(cCs|f|_||_dS(N(targsRO(R$RO((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWs(RFRGRW(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRscBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR	scBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR
scBseZdZRS(cCs|f|_||_dS(N(Rtpartial(R$R
((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRWs(RFRGRW(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRscBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR
!scBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR$scBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR'scBseZRS((RFRG(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR*scBseZdZRS(cCs|f|_||_dS(N(RRD(R$RD((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRW.s(RFRGRW(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR-sR\cBsJeZdZdZdZdZddZdZddZ	RS(s2A limited file-like object for HTTP/0.9 responses.cCs7||_||_d|_d|_t||_dS(Ni(t_linet_filet_line_consumedt_line_offsetR>t
_line_left(R$RDR((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRW=s
				cCst|j|S(N(RR(R$R((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRDscCs:d|_|jj|_|jj|_|jj|_dS(Ni(RRRpR7R(R$((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt_doneGs	cCs|jr|jj|S|js(t|dksC||jkr|j|j}|j|dkrz||jjS||jj|t	|Snp||jkst|j}||}|j||!}||_|j|8_|jdkr|jn|SdS(Ni(
RRRpRRuR"RRRR>(R$RrRsRwR((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRpPs$	
!	
	
cCsC|jr|jjS|js%t|j|j}|j|S(N(RRR7RRuRRR(R$Rs((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR7fs	

cCsz|jr|jj|S|js(t|j|jg}|j|dkrb||jjS||jj|SdS(N(	RRRRRuRRRR"(R$RR((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRns	
N(
RFRGRRWRRR"RpR7R(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyR\5s					cCsddl}ddl}|j|jdd\}}d}x-|D]%\}}|dkrD|d}qDqDWd}d}|dr|d}n|dr|d}nt}	|	j||	j||	jd	||	j|	j\}
}}d
G|
GHdG|GHdGt	|	j
jGHH|rOx|jD]}
|
j
GHq7WnHd
tfdY}|d}	|	jd	d|	j|	j|	jttdrxdD]\}}d||fGHt}|j||j||jd	||j|j\}
}}d
G|
GHdG|GHdGt	|j
jGHH|ryx|jD]}
|
j
GHqaWnHqWndS(sTest this module.

    A hodge podge of tests collected here, because they have too many
    external dependencies for the regular test suite.
    iNitdis-dswww.python.orgRtGETsstatus =sreason =RptHTTP11cBseZdZdZRS(isHTTP/1.1(RFRGRR(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyRsshttp://www.python.org/~jeremy/Rssourceforge.nets/projects/pythonshttps://%s%s(ssourceforge.nets/projects/python((ssourceforge.nets/projects/python(tsystgetopttargvRRRRRR
R>RRpR/R:R[R1RR(RRtoptsRtdltotaRtselectorthR0RPR/RRths((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyttestysd



	


		


	


		t__main__(`RRt	mimetoolsRturlparseRt	cStringIORtImportErrort__all__RRRNRRRR`tSWITCHING_PROTOCOLSt
PROCESSINGRtCREATEDtACCEPTEDtNON_AUTHORITATIVE_INFORMATIONRdt
RESET_CONTENTtPARTIAL_CONTENTtMULTI_STATUStIM_USEDtMULTIPLE_CHOICEStMOVED_PERMANENTLYtFOUNDt	SEE_OTHERRet	USE_PROXYtTEMPORARY_REDIRECTtBAD_REQUESTtUNAUTHORIZEDtPAYMENT_REQUIREDt	FORBIDDENt	NOT_FOUNDtMETHOD_NOT_ALLOWEDtNOT_ACCEPTABLEtPROXY_AUTHENTICATION_REQUIREDtREQUEST_TIMEOUTtCONFLICTtGONEtLENGTH_REQUIREDtPRECONDITION_FAILEDtREQUEST_ENTITY_TOO_LARGEtREQUEST_URI_TOO_LONGtUNSUPPORTED_MEDIA_TYPEtREQUESTED_RANGE_NOT_SATISFIABLEtEXPECTATION_FAILEDtUNPROCESSABLE_ENTITYtLOCKEDtFAILED_DEPENDENCYtUPGRADE_REQUIREDtINTERNAL_SERVER_ERRORtNOT_IMPLEMENTEDtBAD_GATEWAYtSERVICE_UNAVAILABLEtGATEWAY_TIMEOUTtHTTP_VERSION_NOT_SUPPORTEDtINSUFFICIENT_STORAGEtNOT_EXTENDEDRRytMessageRRRRRRRRRR1Rt	ExceptionRRRRR	R
RR
RRRRRR\R!RF(((sE/usr/lib/python2.7/site-packages/redhat_support_lib/system/httplib.pyt<module>Cs
			
i5jd YD	=