ó Bi fc@s#ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ej ddkrÕej ddkrÕddlmZn ddlZiad„Zd„Zd „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zej ddkr„d„Zd„Zd„Z nd„Zd„Zd„Z dd#d„ƒYZ!e"dkreƒeddƒeddƒy eƒWn!e#k r edd ƒ‚nXeddƒed!dƒy eƒZ$Wn!e#k rXed!d ƒ‚nXed!dƒed"dƒyBeƒZ%e%\Z&Z'eƒe!e'ej(e$j)ƒZ*ee&ƒWn!e#k rØed"d ƒ‚nXed"dƒeƒe*j+ƒyej,e&ƒWqe-k rqXndS($iÿÿÿÿNiiii(tutilcCs%tjj|dƒtjdƒdS(Ns i(tsyststderrtwritetexit(tmessage((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytabort#scCs_y)t|dƒ}|j|ƒWdQXWn/tk rZ}tjd|d|jƒnXdS(NtwsWarning: unable to write to s: (topenRtIOErrortloggingtwarntstrerror(tpathtcontentstfte((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyttry_write_file's cCs<tjdtjddƒttdƒr8tjtƒndS(Ntleveltformats2[ pid=%(process)d, time=%(asctime)s ]: %(message)stcaptureWarnings(R t basicConfigtWARNINGthasattrRtTrue(((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytinitialize_logging.s   cCsDtjdƒ}|d}t|dƒ}tj|ƒaWdQXdS(NtPASSENGER_SPAWN_WORK_DIRs /args.jsontr(tostgetenvRtjsontloadtoptions(twork_dirR R((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytread_startup_arguments5s cCsUtjdƒ}|d|jƒ}t|d|ƒt|dttjƒƒƒdS(NRs/response/steps/s/states /begin_time(RRtlowerRtstrttime(tsteptstateR!tstep_dir((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytrecord_journey_step_begin>scCs£tjdƒ}|d|jƒ}t|d|ƒtjj|dƒ r‚tjj|dƒ r‚t|dttjƒƒƒnt|dttjƒƒƒdS(NRs/response/steps/s/states /begin_times/begin_time_monotonics /end_time(RRR#RR texistsR$R%(R&R'R!R(((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytrecord_journey_step_endEs . cCsštjjdtjƒƒtjddƒ}tjddkr†tjddkr†tj d|ƒ}tj |ƒ}|j j |ƒ|St jd|ƒSdS(Nit startup_filespassenger_wsgi.pyiiitpassenger_wsgi(RR tinsertRtgetcwdR tgett version_infoRtspec_from_file_locationtmodule_from_spectloadert exec_moduletimpt load_source(R,tspect app_module((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytload_appNs&cCsÍttjddƒƒ}dtkr7td}d}ntjƒ}d}d}xw|dkrÈyt|||ƒSWqRtjk rÄ}|jtj kr»|d7}|dkrÁ|‚qÁqÅ|‚qRXqRWdS( Nt UNIX_PATH_MAXidt socket_dirtwsgit PsgWsgiAppii€i( tintR R0ttempfilet gettempdirt make_sockettsocketterrorterrnot EADDRINUSE(R;R<t socket_prefixtiR((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytcreate_server_socket]s        cCs‡tjtjtjƒ}ttjdtjdƒƒddƒ}|d|d|}|d|!}|j|ƒ|j dƒ||fS(NtQiitxt/t.iè( RCtAF_UNIXt SOCK_STREAMRtstructtunpackRturandomtbindtlisten(R<RGR;tst socket_suffixtfilename((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyRBts(   cs/d„‰‡fd†}tjtj|ƒdS(Nc SsïtgtjƒD]}|j|jf^qƒ}g}x£tjƒjƒD]\}}|jd|j |dƒ|fƒx]t j |ƒD]L\}}} } |jd||| fƒ| r‰|jd| j ƒƒq‰q‰WqJWdj |ƒGHdS(Ns # Thread: %s(%d)ts File: "%s", line %d, in %ss %ss (tdictt threadingt enumeratetidenttnameRt_current_framestitemstappendR0t tracebackt extract_stacktstriptjoin( tsigtframetthtid2nametcodet thread_idtstackRWtlinenoR]tline((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytdebug~s1#""csˆ||ƒtjdƒdS(Ni(RR(ReRf(Rn(sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytdebug_and_exit‰s (tsignaltSIGABRT(Ro((RnsT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytinstall_signal_handlers}s cCs|tjdƒ}|d}iidd6d|d6dd6d d 6td 6gd 6}t|d ƒ}tj||ƒWdQXdS(NRs/response/properties.jsontmainR]sunix:taddresstsessiontprotocolit concurrencytaccept_http_requeststsocketsR(RRRRRtdump(tsocket_filenameR!R tdocR((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytadvertise_sockets“s  cCsBtjdƒ}|d}t|dƒ}|jdƒWdQXdS(NRs/response/finishRt1(RRRR(R!R R((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytadvertise_readiness¥s cCs"|dj|d|dƒ‚dS(Niii(twith_traceback(texc_info((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytreraise_exception­scCs |jdƒS(Nslatin-1(tdecode(tb((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyt bytes_to_str°scCs$t|tƒr|S|jdƒSdS(Nslatin-1(t isinstancetbytestencode(RU((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyt str_to_bytes³scBs ddUdS(Ns+raise exc_info[0], exc_info[1], exc_info[2]((R((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR‚¹scCs|S(N((R„((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR…¼scCs|S(N((RU((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR‰¿stRequestHandlercBsbeZd„Zd„Zd„Zd„ZeedƒrEd„Zn d„Zd„Z d„Z RS( cCs||_||_||_dS(N(tservert owner_pipetapp(tselft server_socketRŒR((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyt__init__Ãs  cCsst}yUxN|sY|jƒ\}}|s4t}Pnt}zÙyW|j|ƒ\}}|r“|ddkr{|j|ƒq“|j|||ƒ}nWn{tk r­t}netk rô}t|dtƒ sá|j t j krt j dƒqnt k rt j dƒnXWd|sUy|jtjƒWnnXy|jƒWqUqUXnXq WWntk rnnXdS(NtREQUEST_METHODtpingt passengers)WSGI application raised an I/O exception!s%WSGI application raised an exception!(tFalsetaccept_connectionRt parse_requestt process_pingtprocess_requesttKeyboardInterruptR tgetattrREtEPIPER t exceptiont ExceptiontshutdownRCtSHUT_WRtclose(RŽtdonetclientRttsocket_hijackedtenvt input_streamR((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyt main_loopÈsB   %  cCsUtj|j|jjƒgggƒd}|jjƒ|krM|jjƒSdSdS(Ni(NN(tselectRŒR‹tfilenotaccepttNone(RŽtresult((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR•ïs+ cCs:d}xOt|ƒdkrW|jdt|ƒƒ}t|ƒdkrJdS||7}q Wtjd|ƒd}d}xOt|ƒ|krÅ|j|t|ƒƒ}t|ƒdkr¸d S||7}qwW|jdƒ}|jƒi}d}xB|t|ƒkr/t||dƒ|t||ƒ<|d7}qîW||fS( NRXiis>Isii(NN(NN(tlentrecvRªRPRQtsplittpopR…(RŽR¢tbufttmpt header_sizetheadersR¤RH((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR–ös* "t _fileobjectcCstj|ddƒS(Ntrbi(RCR´(RŽtsock((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytwrap_input_socketscCstjj|ddƒS(NRµi(RCtmakefile(RŽR¶((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR·scsc|j|ƒˆdˆdƒnWdt|dƒr^|j ƒnXtS(Ns wsgi.inputs wsgi.errorsiis wsgi.versionswsgi.multithreadswsgi.multiprocesss wsgi.run_oncetHTTPStofftonR~ttruetyesthttpsswsgi.url_schemethttpR‘tHEADcsÑy¡ˆstdƒ‚nlˆs„ˆ\}}ˆ(ˆjtd||fƒƒx%|D]}ˆjtd|ƒƒqSWˆjdƒnˆs ˆjt|ƒƒnWn)tk rÌ}t|dtƒ|‚nXdS(Nswrite() before start_response()s,HTTP/1.1 %s Status: %s Connection: close s%s: %s s R“(tAssertionErrortsendallR‰R tsetattrR(tdatatstatustresponse_headerstheaderR(t headers_sentt headers_settis_headt output_stream(sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR.s   csP|r*zˆrt|ƒnWdd}Xnˆr?tdƒ‚n||gˆ(ˆS(NsHeaders already set!(R‚RªRÁ(RÅRÆR(RÈRÉR(sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytstart_responseCs  cs|rˆˆd<ˆSdS(Nspassenger.hijacked_socket((tdo_it(R¤RË(sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pythijackUs spassenger.hijackspassenger.hijacked_socketRXR (ii(R»R~R¼R½( R·RRR”RR0RªRRR (RŽR¤R¥RËRÌRÎR«RÄ((R¤RÈRÉRÊRËRsT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR˜s8          cCs|jdƒdS(Ntpong(RÂ(RŽRË((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR—ms( t__name__t __module__RR¦R•R–RRCR·R˜R—(((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyRŠÂs  '     Vt__main__tSUBPROCESS_EXEC_WRAPPERtSTEP_PERFORMEDtSUBPROCESS_WRAPPER_PREPARATIONtSTEP_IN_PROGRESSt STEP_ERROREDtSUBPROCESS_APP_LOAD_OR_EXECtSUBPROCESS_LISTEN((.RRRZRpRaRCR§RPR RER@RR%R1t importlibRR6R RRRR"R)R+R:RIRBRrR}RR‚R…R‰RŠRÐRR9ttupleR{Rtstdint applicationthandlerR¦tremovetOSError(((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytsvx$&                ¯