PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  4h^c@sddlZddlZddlZddlZddlZddlZddlZddlZyddlZWne k rddl ZnXyddl m Z Wn!e k rddl mZ nXddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZd d,d YZd d-dYZdd.dYZdd/dYZdd0dYZdejfdYZdej fdYZ!dejfdYZ"de"fdYZ#de"fdYZ$dd1d YZ%d!d2d"YZ&d#d3d$YZ'd%Z(d&d4d'YZ)d(d5d)YZ*d*efd+YZ+dS(6iN(tsha1(tnew(t asyncore_25(t http_date(t http_server(t producers(tfilesys(tdefault_handler(t auth_handlert NOT_DONE_YETcBseZRS((t__name__t __module__(((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR stdeferring_chunked_producercBs#eZdZddZdZRS(s'A producer that implements the 'chunked' transfer coding for HTTP/1.1. Here is a sample usage: request['Transfer-Encoding'] = 'chunked' request.push ( producers.chunked_producer (your_producer) ) request.done() cCs||_||_d|_dS(Ng?(tproducertfooterstdelay(tselfR R((s3/usr/lib/python2.7/site-packages/supervisor/http.pyt__init__*s  cCs~|jrv|jj}|tkr(tS|rBdt||fSd|_|jrodjdg|jdSdSndSdS(Ns%x %s s t0s s0 t(R tmoreR tlentNoneRtjoin(Rtdata((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR/s    N(R R t__doc__RRR(((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR s tdeferring_composite_producercBs eZdZdZdZRS(s$combine a fifo of producers into onecCs||_d|_dS(Ng?(RR(RR((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRAs cCsaxZt|jrX|jd}|j}|tkr;tS|rE|S|jjdqWdSdS(NiR(RRRR tpop(Rtptd((s3/usr/lib/python2.7/site-packages/supervisor/http.pyREs   (R R RRR(((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR?s tdeferring_globbing_producercBs#eZdZddZdZRS(s 'glob' the output from a producer into a particular buffer size. helps reduce the number of calls to send(). [this appears to gain about 30% performance on requests to a single channel] iicCs(||_d|_||_d|_dS(NRg?(R tbuffert buffer_sizeR(RR R ((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRZs   cCsnxUt|j|jkrW|jj}|tkr:tS|rS|j||_qPqW|j}d|_|S(NR(RRR R RR (RRtr((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR`s   i(R R RRR(((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRSs tdeferring_hooked_producercBs eZdZdZdZRS(s A producer that will call when it empties,. with an argument of the number of bytes produced. Useful for logging/instrumentation purposes. cCs(||_||_d|_d|_dS(Nig?(R tfunctiontbytesR(RR R#((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRus   cCsl|jrd|jj}|tkr(tS|sJd|_|j|jn|jt||_|SdSdS(NR(R RR RR#R$R(Rtresult((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR{s   (R R RRR(((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR"ns tdeferring_http_requestcBs2eZdZdZdZdZdZRS(s The medusa http_request class uses the default set of producers in medusa.producers. We can't use these because they don't know anything about deferred responses, so we override various methods here. This was added to support tail -f like behavior on the logtail handler c Ostjtj|j}|j}d}d}d}|jdkr||dkrsd|krfd}qyd|d(!RRKR_tgetpidtunlinktOSErrorRtAF_UNIXRRtchmodtlinkt checkusedRterrnot EADDRINUSERtstderrtwriteR(RGtsleeptchowntargstEPERMRRtpwdtgetpwuidtgeteuidRRfR( Rt socketnamet sockchmodt sockchownRttempnameRtusedtmsgtwhy((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR%sZ            cCsmtjtjtj}y5|j||jd|jd|jWntjk rdtSXt SdS(NsGET / HTTP/1.0 i( RRRtconnecttsendtrecvR(RRR(RRts((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRls   (R R RRR(((s3/usr/lib/python2.7/site-packages/supervisor/http.pyR"s Gttail_f_producercBsGeZdZdZdZdZdZdZdZRS(cCsQ||_||_d|_|j|j}||krM|||_ndS(Ng?(RHtfilenameRt_opent_fsizetsz(RRHRtheadR((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRys      cCs|jdS(N(t_close(R((s3/usr/lib/python2.7/site-packages/supervisor/http.pyt__del__scCs|jy|j}Wnttfk r4dSX||j}|dkr[d|_dS|dkr|jj| d|jj|}||_|StS(NRis==> File truncated <== i( t_followRRRRRtseektreadR (Rtnewszt bytes_addedR$((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRs      cCsDt|jd|_tj|jjtj|_d|_ dS(Ntrbi( topenRRR_tfstattfilenotstattST_INOtinoR(R((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRs"cCs|jjdS(N(RR((R((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRscCsbytj|jtj}Wnttfk r7dSX|j|kr^|j|jndS(N( R_R RR RRRRR(RR((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRs cCstj|jjtjS(N(R_R RR R tST_SIZE(R((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRs( R R RRRRRRR(((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRxs     tlogtail_handlercBs/eZdZdZdZdZdZRS(sLogtail HTTP Request Handlers/logtailcCs ||_dS(N(t supervisord(RR((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRscCs|jj|jS(N(Rt startswithRi(RRH((s3/usr/lib/python2.7/site-packages/supervisor/http.pyRscCs|jdkr |jddS|j\}}}}d|krVtj|}nx$|r||ddkr||d}qYW|jdd\}}y|jdd\}}Wntk r|}d}nXdd lm} | |\} }|j j j | } | dkr%|jd dS| j j |} | dkrT|jd dSt| jd |d} | dkstjj|  r|jd dStj| tj}tj||d sN          5V6A I