ó œt•Pc@süddlZddlZddlZddlZddlZddlmZddlmZddlmZddl m Z de fd„ƒYZ d„Z d ejfd „ƒYZd ejfd „ƒYZead Zdejejfd„ƒYZdS(iÿÿÿÿN(t httpclient(tsslutil(tutil(t_t httpsendfilecBs eZdZd„Zd„ZRS(sðThis is a wrapper around the objects returned by python's "open". Its purpose is to send file-like objects via HTTP. It do however not define a __len__ attribute because the length might be more than Py_ssize_t can handle. cOs‡||_t||Ž|_|jj|_|jj|_|jj|_tj|jjƒƒj |_ d|_ |j dd|_ dS(Niii( tuitopent_datatseektclosetwritetostfstattfilenotst_sizetlengtht_post_total(tselfRtargstkwargs((s</sys/lib/python2.7/site-packages/mercurial/httpconnection.pyt__init__s  cOs”y|jj||Ž}Wn*tk rE|jjtdƒdƒnX|jt|ƒ7_|jjtdƒ|jddtdƒd|j ƒ|S(Ntsendingitunittkbttotal( RtreadtEOFErrorRtprogressRtNoneRtlenR(RRRtret((s</sys/lib/python2.7/site-packages/mercurial/httpconnection.pyR+s (t__name__t __module__t__doc__RR(((s</sys/lib/python2.7/site-packages/mercurial/httpconnection.pyRs c CsItƒ}x›|jdƒD]Š\}}d|krN|jtdƒ|ƒqn|jddƒ\}}|j|tƒƒ}|dkr™tj|ƒ}n|||ÑsN(&RYRtget_hostt has_proxyt get_selectorR3R0RPtURLErrorRSR5tbusyRtdebugRjtsockett_GLOBAL_DEFAULT_TIMEOUTR1tappendR-RHtupdatetunredirected_hdrstitemsRJt get_methodtdatat getresponseterrorRtrecvturllibt addinfourlt get_full_urltstatustcodetreasontmsg(Rt http_classtreqtuse_sslttunhostthostt proxyhostt proxyporttproxytconnkeytallconnstctconnsthRjRHtpathtrterrtresp((s</sys/lib/python2.7/site-packages/mercurial/httpconnection.pytdo_open–sb    / %      )    cCs>|jƒjdƒr"|j|ƒSd„}|j||tƒS(NR+c_s#t|ƒ}t|d s     % 1