a êöøcÙã @s UddlmZmZmZmZmZmZmZddlm Z m Z m Z m Z m Z mZddlmZddlmZmZmZmZmZddlmZmZdgZeegefZeedd œd d „Ze edd œd d„Zee efeddœdd„ZGdd„dƒZ Gdd„de ƒZ!Gdd„de ƒZ"Gdd„de ƒZ#eeeeeeefeefeee$ee feee efegdfee egdfffZ%eefeeefeeefeee"e!e#dœiZ&e%e'd<dS)é)ÚAnyÚCallableÚDictÚListÚTupleÚTypeÚUnioné)ÚDataÚ EndOfMessageÚEventÚInformationalResponseÚRequestÚResponse)ÚHeaders)ÚCLIENTÚIDLEÚ SEND_BODYÚ SEND_RESPONSEÚSERVER)ÚLocalProtocolErrorÚSentinelÚWRITERSN©ÚheadersÚwriteÚreturncCsb|j}|D]"\}}}|dkr |d||fƒq |D]"\}}}|dkr2|d||fƒq2|dƒdS)Nshosts%s: %s ó )Z _full_items)rrÚ raw_itemsZraw_nameÚnameÚvalue©r!úY/workspaces/shunt/resources/test-fastapi/venv/lib/python3.9/site-packages/h11/_writers.pyÚ write_headerssr#)ÚrequestrrcCs6|jdkrtdƒ‚|d|j|jfƒt|j|ƒdS)Nó1.1úI only send HTTP/1.1s%s %s HTTP/1.1 )Ú http_versionrÚmethodÚtargetr#r)r$rr!r!r"Ú write_request$s r*)ÚresponserrcCsD|jdkrtdƒ‚t|jƒ d¡}|d||jfƒt|j|ƒdS)Nr%r&ÚasciisHTTP/1.1 %s %s )r'rÚstrÚ status_codeÚencodeÚreasonr#r)r+rZ status_bytesr!r!r"Úwrite_any_response,s   r1c@sBeZdZeeddœdd„Zeeddœdd„Zeeddœd d „Z dS) Ú BodyWriterN)ÚeventrrcCsDt|ƒtur| |j|¡n$t|ƒtur8| |j|¡nds@J‚dS)NF)Útyper Ú send_dataÚdatar Úsend_eomr)Úselfr3rr!r!r"Ú__call__?s   zBodyWriter.__call__©r6rrcCsdS©Nr!©r8r6rr!r!r"r5GszBodyWriter.send_datarcCsdSr;r!©r8rrr!r!r"r7JszBodyWriter.send_eom) Ú__name__Ú __module__Ú __qualname__r ÚWriterr9Úbytesr5rr7r!r!r!r"r2>sr2c@s@eZdZeddœdd„Zeeddœdd„Zeeddœd d „Z dS) ÚContentLengthWriterN)ÚlengthrcCs ||_dSr;)Ú_length)r8rDr!r!r"Ú__init__UszContentLengthWriter.__init__r:cCs0|jt|ƒ8_|jdkr$tdƒ‚||ƒdS)Nrz)Too much data for declared Content-Length)rEÚlenrr<r!r!r"r5Xs zContentLengthWriter.send_datarcCs"|jdkrtdƒ‚|rtdƒ‚dS)Nrz+Too little data for declared Content-Lengthz%Content-Length and trailers don't mix)rErr=r!r!r"r7^s zContentLengthWriter.send_eom) r>r?r@ÚintrFrBrAr5rr7r!r!r!r"rCTsrCc@s0eZdZeeddœdd„Zeeddœdd„ZdS)Ú ChunkedWriterNr:cCs,|sdS|dt|ƒƒ||ƒ|dƒdS)Ns%x r)rGr<r!r!r"r5fs zChunkedWriter.send_datarcCs|dƒt||ƒdS)Ns0 )r#r=r!r!r"r7oszChunkedWriter.send_eom©r>r?r@rBrAr5rr7r!r!r!r"rIes rIc@s0eZdZeeddœdd„Zeeddœdd„ZdS)Ú Http10WriterNr:cCs ||ƒdSr;r!r<r!r!r"r5uszHttp10Writer.send_datarcCs|r tdƒ‚dS)Nz&can't send trailers to HTTP/1.0 client)rr=r!r!r"r7xszHttp10Writer.send_eomrJr!r!r!r"rKtsrK)Úchunkedzcontent-lengthzhttp/1.0)(ÚtypingrrrrrrrZ_eventsr r r r rrÚ_headersrÚ_staterrrrrZ_utilrrÚ__all__rBrAr#r*r1r2rCrIrKr-Z WritersTyperÚ__annotations__r!r!r!r"Ú sD&   þ  þÿÿÿ ýü