ó Bi fc@s5ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl 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"dkr1eƒeddƒeddƒy eƒWn!e#k r edd ƒ‚nXeddƒed!dƒy eƒZ$Wn!e#k rXed!d ƒ‚nXed!dƒed"dƒyTeƒZ%e%dk s‘t'‚e%\Z(Z)eƒe!e)ej*e$j+ƒZ,ee(ƒWn!e#k rêed"d ƒ‚nXed"dƒeƒe,j-ƒyej.e(ƒWq1e/k r-q1XndS($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   cCsVtjdƒ}|dk s!t‚|d}t|dƒ}tj|ƒaWdQXdS(NtPASSENGER_SPAWN_WORK_DIRs /args.jsontr(tostgetenvtNonetAssertionErrorRtjsontloadtoptions(twork_dirR R((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytread_startup_arguments5s  cCsgtjdƒ}|dk s!t‚|d|jƒ}t|d|ƒt|dttjƒƒƒdS(NRs/response/steps/s/states /begin_time(RRRRtlowerRtstrttime(tsteptstateR#tstep_dir((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytrecord_journey_step_begin>s cCsµtjdƒ}|dk s!t‚|d|jƒ}t|d|ƒtjj|dƒ r”tjj|dƒ r”t|dtt j ƒƒƒnt|dtt j ƒƒƒdS(NRs/response/steps/s/states /begin_times/begin_time_monotonics /end_time( RRRRR%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|ƒ}|dk sut ‚tj |ƒ}|j dk s™t ‚|j j|ƒ|Stjd|ƒSdS(Nit startup_filespassenger_wsgi.pyiiitpassenger_wsgi(RR tinsertRtgetcwdR"tgett version_infoRtspec_from_file_locationRRtmodule_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"R2ttempfilet 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è( REtAF_UNIXt SOCK_STREAMRtstructtunpackRturandomtbindtlisten(R>RIR=tst socket_suffixtfilename((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyRDts(   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_framestitemstappendR2t tracebackt extract_stacktstriptjoin( tsigtframetthtid2nametcodet thread_idtstackRYtlinenoR_tline((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytdebug~s1#""csˆ||ƒtjdƒdS(Ni(RR(RgRh(Rp(sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytdebug_and_exit‰s (tsignaltSIGABRT(Rq((RpsT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytinstall_signal_handlers}s cCsŽtjdƒ}|dk s!t‚|d}iidd6d|d6dd6d d 6td 6gd 6}t|d ƒ}tj||ƒWdQXdS(NRs/response/properties.jsontmainR_sunix:taddresstsessiontprotocolit concurrencytaccept_http_requeststsocketsR(RRRRRRR tdump(tsocket_filenameR#R tdocR((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytadvertise_sockets“s  cCsTtjdƒ}|dk s!t‚|d}t|dƒ}|jdƒWdQXdS(NRs/response/finishRt1(RRRRRR(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(RW((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((RW((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 tgetattrRGtEPIPER t exceptiont ExceptiontshutdownREtSHUT_WRtclose(RtdonetclientRvtsocket_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ŽRtfilenotacceptR(Rtresult((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( NRZiis>Isii(NN(NN(tlentrecvRRRRStsplittpopR‡(RR¤tbufttmpt header_sizetheadersR¦RJ((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR˜ös* "t _fileobjectcCstj|ddƒS(Ntrbi(RERµ(Rtsock((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytwrap_input_socketscCstjj|ddƒS(NR¶i(REtmakefile(RR·((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•(RtsendallR‹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„RR(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_socketRZR¢(ii(R¼R€R½R¾( R¸RRR–RR2RRRR¢(RR¦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Â(RRË((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pyR™ms( t__name__t __module__R’R¨R—R˜RRER¸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((0RRR\RrRcRER©RRR RGRBR R'R3t importlibRR8R"RRRR$R+R-R<RKRDRtRRR„R‡R‹RŒRÐRŸR;ttupleRRR}R‘tstdint applicationthandlerR¨tremovetOSError(((sT/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/src/helper-scripts/wsgi-loader.pytsxx$&                ¯