mfddlZddlZddlZddlmZ ddlmZn#e$r ddlmZYnwxYwgdZGdde Z ej dkrd Z nd Z dd Z dd ZdZdZdaddZddZdS)N)partial) monotonic)time)NoWayToWaitForSocketError wait_for_readwait_for_writeceZdZdS)rN)__name__ __module__ __qualname__H/opt/imunify360/venv/lib64/python3.11/site-packages/urllib3/util/wait.pyrrsDrr)c||SNr )fntimeouts r_retry_on_intrr*sr'{{rc<|td}nt|z} ||S#ttjf$rT}|jdt jkr|tz }|dkrd}|tdkrd}Yd}~rd}~wwxYw)NinfTr)floatrOSErrorselecterrorargserrnoEINTR)rrdeadlinees rrr0s ?U||HH {{W,H  r'{{"V\*   6!9 ++&4G{{"#%,,.."&HHHH s 1BA BBFc|s|stdg}g}|r|||r||ttj|||}t ||\}}} t |p|p| S)N2must specify at least one of read=True, write=True) RuntimeErrorappendrrrbool) sockreadwriterrcheckwcheckrrreadywreadyxreadys rselect_wait_for_socketr/Gs QQOPPP F F  d  d  7 7B+B88FFF *&*F + ++rc|s|stdd}|r|tjz}|r|tjz}tj||fd}t t||S)Nr#rc<||dz}|S)Ni)poll)tpoll_objs rdo_pollz%poll_wait_for_socket..do_pollfs# = IA}}Qr)r$rPOLLINPOLLOUTr2registerr&r)r'r(r)rmaskr5r4s @rpoll_wait_for_socketr:Zs QQOPPP D     {}}H dD!!!     w00 1 11rc td)Nzno select-equivalent available)rrkwargss rnull_wait_for_socketr>ns #$D E EErc tj}t|jddS#ttf$rYdSwxYw)NrTF)rr2rAttributeErrorr)r4s r_have_working_pollrArsT;==x}a(((t G $uus(,AActrtan$ttdrt ant at|i|S)Nr)rAr:wait_for_sockethasattrrr/r>r<s rrCrCsJ /.  " "/0. D +F + ++rc&t|d|S)zWaits for reading to be available on a given socket. Returns True if the socket is readable, or False if the timeout expired. T)r(rrCr'rs rrrs 4dG < < <rArCrrr rrrOst ''''&&&&&&&&' K J J        4v .,,,,&2222(FFF    , , ,====>>>>>>s  ))