Ë ¨& e7¸ !ãó–—ddlZddlZddlmZddlmZddlmZddlm Z m Z mZm Z m Z ddl mZmZdZd ZdZd Zd Zeeed œZdZd Zd ZdZdZdZdZdZeeeeeeeedœZdZd Z d Z!dZ"ee e!e"dœZ#dZ$d Z%e$e%dœZ&dZ'd Z(e'e(dœZ)dZ*d Z+e*e+dœZ,dZ-d Z.e-e.dœZ/ee#ee&ee)eieieiee,ee/iZ0ejbd«Z2d„Z3ejhd¬«Gd„d««Z5ejhdd¬«Gd„d««Z6d„Z7d „Z8d!„Z9d"„Z:dedfd#„Z;d$„ZdLd'„Z?d(„Z@efd)„ZAGd*„d+«ZBGd,„d-«ZCGd.„d/«ZDGd0„d1«ZEGd2„d3«ZFGd4„d5«ZGGd6„d7eG«ZHGd8„d9«ZIGd:„d;eI«ZJiZKgZLd<„ZMGd=„d>«ZNGd?„d@eN«ZOGdA„dBeN«ZPdC„ZQdDdEgiZRGdF„dG«ZSGdH„dI«ZTGdJ„dK«ZUy)MéNé)Ú_)Úgetattr)Úattr)ÚencodingÚerrorÚpycompatÚutilÚwireprototypes)ÚcborutilÚ stringutiléi€éé)s stream-begins stream-endsencodedééééé )scommand-requests command-datascommand-responseserror-responses text-outputsprogressssender-protocol-settingssstream-settings)snewó continuationsmores have-data)róeoszó|)ÚitemsÚappendÚgetÚjoin)ÚmappingÚvalueÚkÚvÚnamemapÚflagsÚvals ú>usr/lib/python3.12/site-packages/mercurial/wireprotoframing.pyÚ humanflagsr'{s�€à '§ ¡ ¤Ô0¡™˜˜1ˆq�!‰t €GÑ0Ø €EØ €CØ �3Š,Ø �3Š;Ø �L‰L˜Ÿ™ SÐ*=ÀÑ*CÓDÔ EØ �‰ ˆð �3‹,ð �9‰9�UÓ Ðùó1s” A2T)ÚslotscóÜ—eZdZdZej «Zej «Zej «Zej «Z ej «Z ej «Z y)Ú frameheaderz&Represents the data in a frame header.N) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚibÚlengthÚ requestidÚstreamidÚ streamflagsÚtypeidr$©ór&r*r*ˆsS„á0à ˆT�W‰W‹Y€FØ�—‘“ €I؈t�w‰w‹y€HØ�$—'‘'“)€KØ ˆT�W‰W‹Y€FØ ˆD�G‰G‹I�Er6r*F)r(Úreprcó—eZdZdZej «Zej «Zej «Zej «Z ej «Z ej «Z e jd„«Zy)ÚframezRepresents a parsed frame.c óv—d|jz}tj«D]\}}||jk(sŒ|}ndt|j«|j |j tt|j«|ttj|ji«|j«fzS)NrsHframe(size=%d; request=%d; stream=%d; streamflags=%s; type=%s; flags=%s)) r4Ú FRAME_TYPESrÚlenÚpayloadr1r2r'Ú STREAM_FLAGSr3ÚFRAME_TYPE_FLAGSrr$)ÚselfÚtypenameÚnamer s r&Ú__repr__zframe.__repr__Ÿsž€à&¨¯©Ñ4ˆÜ&×,Ñ,Ö.‰KˆD�%ؘŸ ™ Ó#Ø�Ùð/ð  "ô�D—L‘LÓ!Ø—‘Ø— ‘ Üœ<¨×)9Ñ)9Ó:ØÜÔ+×/Ñ/°· ± ¸RÓ@À$Ç*Á*ÓMð ñ ð r6N)r+r,r-r.rr/r1r2r3r4r$r=rÚ strmethodrCr5r6r&r9r9”sk„á$à�—‘“ €I؈t�w‰w‹y€HØ�$—'‘'“)€KØ ˆT�W‰W‹Y€FØ ˆD�G‰G‹I€E؈d�g‰g‹i€Gà ×Ññ óñ r6r9cóÞ—ttt|«z«}tjdt|««}|dd|ddtj d|d|||«|dz|z|d<||dd|S) z#Assemble a frame into a byte array.z This can be used by user-facing applications and tests for creating frames easily without having to type out a bunch of constants. Request ID and stream IDs are integers. Stream flags, frame type, and flags can be specified by integer or named constant. Flags can be delimited by `|` to bitwise OR them together. If the payload begins with ``cbor:``, the following string will be evaluated as Python literal and the resulting object will be fed into a CBOR encoder. Otherwise, the payload is interpreted as a Python byte string literal. ó rrrscbor:r6N)r1r2r3r4r$r=) ÚsplitÚintr>r;r?Ú startswithrr Ú streamencoder ÚevalpythonliteralÚ unescapestrrM) ÚsÚfieldsr1r2r3Ú frametypeÚ frameflagsr=ÚfinalstreamflagsÚflagÚ finalflagsÚ validflagss r&Úmakeframefromhumanstringr^ÊsN€ð,�W‰W�T˜1Ó €FØGMÑD€Iˆx˜ i°¸Wä�I“€IÜ�8‹}€HàÐØ×!Ñ! $Ö'ˆØ ”<Ñ Ø ¤ ¨TÑ 2Ñ 2Ñ à ¤ D£ Ñ )Ñ ð (ð ”KÑÜ  Ñ*‰ ä˜ “Nˆ à€JÜ! )Ñ,€JØ× Ñ  Ö&ˆØ �:Ñ Ø ˜* TÑ*Ñ *‰Jà œ#˜d›)Ñ #‰Jð 'ð ×ј(Ô#Ø—(‘(Ü × !Ñ !¤*×">Ñ">¸wÀqÀr¸{Ó"KÓ Ló ‰ô ×(Ñ(¨Ó1ˆä ØØØ$ØØØô  ðr6cóª—|dd|dzzd|dzz}tjd|d«\}}}|d}|d zd z }|d z}t||||||«S) zÆParse a unified framing protocol frame header from a buffer. The header is expected to be in the buffer at offset 0 and the buffer is expected to be large enough to hold a full header. réri@rrFrréðré)rIÚ unpack_fromr*)ÚdataÚ framelengthr1r2r3Ú typeflagsrXrYs r&Ú parseheaderrg s~€ð�q‘'˜C $ q¡'™MÑ)¨E°D¸±G©OÑ;€KÜ'-×'9Ñ'9¸&À$ÈÓ'JÑ$€Iˆx˜Ø�Q‘€Ià˜TÑ! aÑ'€IؘTÑ!€Jä Ø�Y ¨+°yÀ*ó ðr6có—tt«}|j|«}|dk(ry|tk7r#tjt d«||fz«‚t |«}|j|j«}t|«|jk7r6tjt d«|jt|«fz«‚t|j|j|j|j|j|«S)z×Read a unified framing protocol frame from a file object. Returns a 3-tuple of (type, flags, payload) for the decoded frame or None if no frame is available. May raise if a malformed frame is seen. rNs+received incomplete frame: got %d bytes: %ss'frame length error: expected %d; got %d)rGrHÚreadintorÚAbortrrgÚreadr0r<r9r1r2r3r4r$)ÚfhÚheaderÚ readcountÚhr=s r&Ú readframerp%sä€ôÔ(Ó )€Fà— ‘ ˜FÓ#€Ià�A‚~ØàÔ%Ò%Ü�k‰kÜ Ð<Ó =ؘ&Ð!ñ "ó ð ô �FÓ€Aà�g‰g�a—h‘hÓ€GÜ ˆ7ƒ|�q—x‘xÒÜ�k‰kÜ Ð8Ó 9Ø�x‰xœ˜W›Ð&ñ 'ó ð ô Ø � ‰ �Q—Z‘Z §¡°·±¸!¿'¹'À7ó ðr6c#ódK—d|i}|r||d<|r||d<djtj|««}d} d} |s | tz} n | tz} |r | t z} ||||z} |t | «z }t | «|k(r|t |«kr | tz} |j|t| | ¬«–—| tzsnŒƒ|rn |jt«}d} t |«tk(rt} nt} |jd «dk(sJ‚d} |j|t| |¬«–—| ry Œmy ­w) z·Create frames necessary to transmit a request to run a command. This is a generator of bytearrays. Each item represents a frame ready to be sent over the wire to a peer. ónameóargsóredirectr6rT©r1r4r$r=FrN)rr rSÚFLAG_COMMAND_REQUEST_NEWÚ!FLAG_COMMAND_REQUEST_CONTINUATIONÚ FLAG_COMMAND_REQUEST_EXPECT_DATAr<Ú FLAG_COMMAND_REQUEST_MORE_FRAMESrMÚFRAME_TYPE_COMMAND_REQUESTrkÚDEFAULT_MAX_FRAME_SIZEÚFLAG_COMMAND_DATA_CONTINUATIONÚFLAG_COMMAND_DATA_EOSÚFRAME_TYPE_COMMAND_DATA) Ústreamr1ÚcmdÚargsÚdatafhÚ maxframesizeÚredirectrdÚoffsetr$r=Údones r&Úcreatecommandframesr‡Gswèø€ð �Sˆ>€D٠؈ˆW‰ áØ$ˆˆ[Ñà �8‰8”H×)Ñ)¨$Ó/Ó 0€Dà €Fà ØˆñØ Ô-Ñ -‰Eà Ô6Ñ 6ˆEñ Ø Ô5Ñ 5ˆEà�v ¨Ñ 5Ð6ˆØ”#�g“,Ñˆä ˆw‹<˜<Ò '¨F´S¸³YÒ,>Ø Ô5Ñ 5ˆEà×ÑØÜ-ØØð ó ò ðÔ8Ò8Ø ð7 ñ:ØØ—;‘;Ô5Ó6ˆDàˆDÜ�4‹yÔ2Ò2Ü6‘ä-�Ø—{‘{ 1“~¨Ò,Ð,Ð,Ø�à×"Ñ"Ø#Ü.ØØð #óò ñØð'ðùs‚D.D0cóÒ—djtjddi««}|jr|j |«}d}|syd}|j |t t||¬«S)Nr6óstatussokTF©r1r4r$r=Úencoded)rr rSÚstreamsettingssentÚencoderMÚFRAME_TYPE_COMMAND_RESPONSEÚ"FLAG_COMMAND_RESPONSE_CONTINUATION)rr1Úoverallr‹s r&Úcreatecommandresponseokframer‘”sn€Ø�h‰h”x×,Ñ,¨i¸Ð-?Ó@ÓA€Gà × Ò Ø—-‘- Ó(ˆØˆáØàˆà × Ñ ØÜ*Ü0ØØð ó ðr6c#óÜK—|j«}d} ||||z}|t|«z }|t|«k(}|rt}nt}|j |t |||dk7¬«–—|ryŒV­w)zACreate an empty payload frame representing command end-of-stream.rr6rŠN)Úflushr<ÚFLAG_COMMAND_RESPONSE_EOSr�rMrŽ)rr1rƒr=r…Úchunkr†r$s r&Úcreatecommandresponseeosframesr–©s�èø€ð�l‰l‹n€Gà €FØ Ø˜ ¨,Ñ!6Ð7ˆØ”#�e“*Ñˆàœ˜W›Ñ%ˆá Ü-‰Eä6ˆEà×ÑØÜ.ØØØ˜s‘Nð ó ò ñ Ø ð) ùs‚A*A,cód—d|j|jdœdœ}dD],}t||«}|€Œ||dtj|«<Œ.dj t j|««}|jr|j|«}d}nd}|j|tt||¬ «S) Nrt)surls mediatype)r‰ólocation)ÚsizeÚ fullhashesÚ fullhashseedÚserverdercertsÚservercadercertsr˜r6TFrŠ) ÚurlÚ mediatyperr Úbytestrrr rSrŒr�rMrŽr�)rr1ÚlocationrdÚar r=r‹s r&Ú$createalternatelocationresponseframer£Çs¾€àà—L‘LØ"×,Ñ,ñ ñ €Dóˆô˜ !Ó$ˆØ Ñ Ø5:ˆD�Ñ œh×.Ñ.¨qÓ1Ò 2ðð�h‰h”x×,Ñ,¨TÓ2Ó3€Gà × Ò Ø—-‘- Ó(ˆØ‰àˆà × Ñ ØÜ*Ü0ØØð ó ðr6c#ó´K—dd|idœ}|r||dd<djtj|««}|j|tt |¬«–—y­w)Nóerrorómessage)r‰r¥rsr6ru)rr rSrMrŽr”)rr1Úmessager�Úmr�s r&Úcreatecommanderrorresponser©ìslèø€ðà ˜ð ñ €Añ Ø#ˆˆ(‰ �GÑà�h‰h”x×,Ñ,¨QÓ/Ó0€Gà × Ñ ØÜ*Ü'Øð ó óùs‚AAc#ó¾K—t|«tksJ‚djtj|d|igdœ««}|j |t d|¬«–—y­w)Nr6ómsg)ótyper¦rru)r<r{rr rSrMÚFRAME_TYPE_ERROR_RESPONSE)rr1ÚmsgÚerrtyper=s r&Úcreateerrorframer°slèø€ä ˆs‹8Ô-Ò -Ð-Ð -à�h‰hÜ×Ñà Ø$ c˜]˜Oñ ó ó€Gð × Ñ ØÜ(ØØð ó óùs‚AAc#óìK—g}|D�]\}}}t|t«s td«‚|D]}t|t«rŒtd«‚|D]} t| t«rŒtd«‚|jdd«j d«}|D� cgc]#} | jdd«j d«‘Œ%}} |D� cgc]#} | jdd«j d«‘Œ%}} d|i} |r|| d <|r|| d <|j | «�Œ d j tj|««} t| «|kDr td «‚|j|td | ¬«–—ycc} wcc} w­w)aŠCreate a text output frame to render text to people. ``atoms`` is a 3-tuple of (formatting string, args, labels). The formatting string contains ``%s`` tokens to be replaced by the corresponding indexed entry in ``args``. ``labels`` is an iterable of formatters to be applied at rendering time. In terms of the ``ui`` class, each atom corresponds to a ``ui.write()``. s!must use bytes formatting stringssmust use bytes for argumentssmust use bytes for labelsÚasciiÚreplacezutf-8Ústrictr«rsslabelsr6s$cannot encode data in a single framerruN) Ú isinstanceÚbytesÚ ValueErrorÚdecoder�rrr rSr<rMÚFRAME_TYPE_TEXT_OUTPUT)rr1ÚatomsrƒÚ atomdictsÚ formattingr�ÚlabelsÚargÚlabelr¢rLÚatomr=s r&ÚcreatetextoutputframerÁs†èø€ð€Iä&+Ñ"ˆ�T˜6ô˜*¤eÔ,ÜÐAÓBÐ BÛˆCܘc¤5Õ)Ü Ð!@ÓAÐAðóˆEܘe¤UÕ+Ü Ð!=Ó>Ð>ðð  ×&Ñ& w° Ó:×AÑAÀ'ÓJˆ ñGKÓKÁdÀ�—‘˜ )Ó,×3Ñ3°GÕ<ÀdˆÐKñHNÓNÁvÀ!�!—(‘(˜7 HÓ-×4Ñ4°WÕ=ÀvˆÐNà˜ Ð#ˆÙ Ø ˆD�‰MÙ Ø$ˆD�‰Oà×јÖð7',ð:�h‰h”x×,Ñ,¨YÓ7Ó8€Gä ˆ7ƒ|�lÒ"ÜÐ@ÓAÐAà × Ñ ØÜ%ØØð ó óùò%LùòOùs*‚=E4Á!E4Á"1E4Â(E*Â;E4Ã(E/Ã)B E4có&—eZdZdZefd„Zd„Zd„Zy)Úbufferingcommandresponseemittera®Helper object to emit command response frames intelligently. Raw command response data is likely emitted in chunks much smaller than what can fit in a single frame. This class exists to buffer chunks until enough data is available to fit in a single frame. TODO we'll need something like this when compression is supported. So it might make sense to implement this functionality at the stream level. cóJ—||_||_||_g|_d|_y©Nr)Ú_streamÚ _requestidÚ_maxsizeÚ_chunksÚ _chunkssize)r@rr1rƒs r&Ú__init__z(bufferingcommandresponseemitter.__init__\s&€ØˆŒ Ø#ˆŒØ$ˆŒ ؈Œ ؈Õr6c#óöK—|€|j«D]}|–—Œy|jj|«}|syt|«|jkDr€|j«D]}|–—Œd} ||||jz}|t|«z }|jj |j tt|d¬«–—|t|«k(ryŒdt|«|jz|jkr:|jj|«|xjt|«z c_ y|j«D]}|–—Œ|jj|«t|«|_ y­w)zÑSend new data for emission. Is a generator of new frames that were derived from the new input. If the special input ``None`` is received, flushes all buffered data to frames. NrT©r4r$r=r‹) Ú_flushrÆr�r<rÈrMrÇrŽr�rÊrÉr)r@rdr9r…r•s r&Úsendz$bufferingcommandresponseemitter.sendcsVèø€ð ˆ<ØŸ™ž�Ø“ ð'à à�|‰|×"Ñ" 4Ó(ˆñØ ä ˆt‹9�t—}‘}Ò $ØŸ™ž�Ø“ ð'ðˆFØØ˜V f¨t¯}©}Ñ&<Ð=�Øœ#˜e›*Ñ$�à—l‘l×,Ñ,Ø—O‘OÜ6Ü<Ø!Ø ð -óòðœS ›YÒ&Øðô" ˆt‹9�t×'Ñ'Ñ '¨$¯-©-Ò 7Ø �L‰L× Ñ  Ô %Ø × Ò ¤ D£ Ñ )Õ Ø ð —[‘[–]ˆEØ‹Kð#ð � ‰ ×јDÔ!ܘt›9ˆÕùs‚E7E9c#óK—dj|j«}t|«|jksJ‚g|jddd|_|sy|j j |jtt|d¬«–—y­w)Nr6rTrÍ) rrÉr<rÈrÊrÆrMrÇrŽr�)r@r=s r&rÎz&bufferingcommandresponseemitter._flush§sxèø€Ø—(‘(˜4Ÿ<™<Ó(ˆÜ�7‹|˜tŸ}™}Ò,Ð,Ð,àˆ� ‰ ‘QˆØˆÔáØ à�l‰l×$Ñ$Ø �O‰OÜ.Ü4ØØð %ó ó ùs‚BBN)r+r,r-r.r{rËrÏrÎr5r6r&rÃrÃPs„ñ ð8NóòB%óH r6rÃcó(—eZdZdZd„Zd„Zd„Zd„Zy)Úidentityencoderz3Encoder for the "identity" stream encoding profile.có—y©Nr5)r@Úuis r&rËzidentityencoder.__init__Ás€Ø r6có—|SrÔr5©r@rds r&r�zidentityencoder.encodeÄó€Øˆ r6có—y©Nr6r5©r@s r&r“zidentityencoder.flushÇó€Ør6có—yrÚr5rÛs r&Úfinishzidentityencoder.finishÊrÜr6N)r+r,r-r.rËr�r“rÞr5r6r&rÒrÒ¾s„Ù=ò òòór6rÒcó—eZdZdZd„Zd„Zy)Úidentitydecoderz3Decoder for the "identity" stream encoding profile.cóD—|rtjtd««‚y)Ns6identity decoder received unexpected additional values)rrjr)r@rÕÚ extraobjss r&rËzidentitydecoder.__init__Ñs$€Ù Ü—+‘+ÜÐKÓLóð ð r6có—|SrÔr5r×s r&r¸zidentitydecoder.decode×rØr6N)r+r,r-r.rËr¸r5r6r&ràràÎs„Ù=òó r6ràcó$—eZdZd„Zd„Zd„Zd„Zy)Ú zlibencodercóD—ddl}||_|j«|_yrÅ)ÚzlibÚ_zlibÚ compressobjÚ _compressor)r@rÕrçs r&rËzzlibencoder.__init__Üs€ÛàˆŒ Ø×+Ñ+Ó-ˆÕr6có8—|jj|«SrÔ©rêÚcompressr×s r&r�zzlibencoder.encodeâó€Ø×Ñ×(Ñ(¨Ó.Ð.r6có`—|jj|jj«SrÔ)rêr“rèÚ Z_SYNC_FLUSHrÛs r&r“zzlibencoder.flushås%€ð×Ñ×%Ñ% d§j¡j×&=Ñ&=Ó>Ð>r6cór—|jj|jj«}d|_|SrÔ)rêr“rèÚZ_FINISH©r@Úress r&rÞzzlibencoder.finishês/€Ø×Ñ×$Ñ$ T§Z¡Z×%8Ñ%8Ó9ˆØˆÔ؈ r6N©r+r,r-rËr�r“rÞr5r6r&råråÛs„ò.ò /ò?ó r6råcó—eZdZd„Zd„Zy)Ú zlibdecodercóv—ddl}|rtjtd««‚|j «|_y)Nrs2zlib decoder received unexpected additional values)rçrrjrÚ decompressobjÚ _decompressor)r@rÕrârçs r&rËzzlibdecoder.__init__ñs5€Ûá Ü—+‘+ÜÐGÓHóð ð"×/Ñ/Ó1ˆÕr6có8—|jj|«SrÔ©rúÚ decompressr×s r&r¸zzlibdecoder.decodeûó€Ø×!Ñ!×,Ñ,¨TÓ2Ð2r6N©r+r,r-rËr¸r5r6r&r÷r÷ðs „ò2ó3r6r÷có$—eZdZd„Zd„Zd„Zd„Zy)Úzstdbaseencodercól—ddlm}||_|j|¬«}|j «|_y)Nr©Úzstd)Úlevel)ÚrÚ_zstdÚZstdCompressorrérê)r@rrÚcctxs r&rËzzstdbaseencoder.__init__s0€ÝàˆŒ Ø×"Ñ"¨Ð"Ó/ˆØ×+Ñ+Ó-ˆÕr6có8—|jj|«SrÔrìr×s r&r�zzstdbaseencoder.encoderîr6có`—|jj|jj«SrÔ)rêr“rÚCOMPRESSOBJ_FLUSH_BLOCKrÛs r&r“zzstdbaseencoder.flush s%€ð×Ñ×%Ñ% d§j¡j×&HÑ&HÓIÐIr6cór—|jj|jj«}d|_|SrÔ)rêr“rÚCOMPRESSOBJ_FLUSH_FINISHrós r&rÞzzstdbaseencoder.finishs/€Ø×Ñ×$Ñ$ T§Z¡Z×%HÑ%HÓIˆØˆÔ؈ r6Nrõr5r6r&rrÿs„ò.ò/òJó r6rcó‡—eZdZˆfd„ZˆxZS)Úzstd8mbencodercó,•—tt|� d«y)Nr)ÚsuperrrË)r@rÕÚ __class__s €r&rËzzstd8mbencoder.__init__sø€Ü Œn˜dÑ,¨QÕ/r6©r+r,r-rËÚ __classcell__©rs@r&rrs ø„÷0ð0r6rcó—eZdZd„Zd„Zy)Úzstdbasedecodercó^—ddlm}|j|¬«}|j«|_y)Nrr)Úmax_window_size)rrÚZstdDecompressorrùrú)r@Ú maxwindowsizerÚdctxs r&rËzzstdbasedecoder.__init__s)€Ýà×$Ñ$°]Ð$ÓCˆØ!×/Ñ/Ó1ˆÕr6có8—|jj|«SrÔrür×s r&r¸zzstdbasedecoder.decode"rþr6Nrÿr5r6r&rrs „ò2ó 3r6rcó‡—eZdZˆfd„ZˆxZS)Úzstd8mbdecodercón•—|rtjtd««‚tt|�d¬«y)Ns5zstd8mb decoder received unexpected additional valuesi€)r)rrjrrr rË)r@rÕrârs €r&rËzzstd8mbdecoder.__init__'s4ø€Ù Ü—+‘+ÜÐJÓKóð ô Œn˜dÑ,¸;Ð,ÕGr6rrs@r&r r &sø„÷HðHr6r cóN—try ddlm}|j|r(t t ftd<tjd«ttftd<tjd«ttftd<tjd«y#t$rd}YŒˆwxYw)Nrrszstd-8mbszlibóidentity) ÚSTREAM_ENCODERSrrÚ __version__Ú ImportErrorrr ÚSTREAM_ENCODERS_ORDERrrår÷rÒràrs r&Úpopulatestreamencodersr(6s‹€ÝØðÝà ×Òñ  Ü(6¼Ð'GŒ˜ Ñ$Ü×$Ñ$ [Ô1ä +¬[Ð9„O�GÑÜ× Ñ  Ô)ä$3´_Ð#E„O�KÑ Ü× Ñ  Õ-øô òØŠðús‰B B$Â#B$có—eZdZdZdd„Zd„Zy)rz5Represents a logical unidirectional series of frames.có —||_||_yrÔ)r2Ú_active)r@r2Úactives r&rËzstream.__init__Ps€Ø ˆŒ ؈� r6cór—d}|js|tz}d|_t||j||||«S)ú}Create a frame to be sent out over this stream. Only returns the frame instance. Does not actually send it. rT)r+ÚSTREAM_FLAG_BEGIN_STREAMrMr2)r@r1r4r$r=r3s r&rMzstream.makeframeTs@€ð ˆ Ø�|Š|Ø Ô3Ñ 3ˆK؈DŒLäØ �t—}‘} k°6¸5À'ó ð r6N©F)r+r,r-r.rËrMr5r6r&rrMs„Ù?óó  r6rcó6‡—eZdZdZdˆfd„ Zd„Zd„Zd„ZˆxZS)Ú inputstreamz,Represents a stream used for receiving data.có>•—tt|� ||¬«d|_y)N©r,)rr2rËÚ_decoder©r@r2r,rs €r&rËzinputstream.__init__fsø€Ü Œk˜4Ñ)¨(¸6Ð)ÔB؈� r6có„—|tvr!tjtd«|z«‚t|d||«|_y)zµSet the decoder for this stream. Receives the stream profile name and any additional CBOR objects decoded from the stream encoding settings frame payloads. sunknown stream decoder: %srN)r$rrjrr5)r@rÕrBrâs r&Ú setdecoderzinputstream.setdecoderjs>€ð ”Ñ &Ü—+‘+œaÐ =Ó>ÀÑEÓFÐ Fä'¨Ñ-¨aÑ0°°YÓ?ˆ� r6cóT—|js|S|jj|«SrÔ)r5r¸r×s r&r¸zinputstream.decodeus%€ð�}Š}؈Kà�}‰}×#Ñ# DÓ)Ð)r6cóP—|jsy|jj«SrÚ)r5r“rÛs r&r“zinputstream.flush}ó€Ø�}Š}Øà�}‰}×"Ñ"Ó$Ð$r6r0) r+r,r-r.rËr8r¸r“rrs@r&r2r2csø„Ù6õò @ò*ö%r6r2cóJ‡—eZdZdZd ˆfd„ Zd„Zd„Zd„Zd„Zd d„Z d„Z ˆxZ S) Ú outputstreamz*Represents a stream used for sending data.cóZ•—tt|� ||¬«d|_d|_d|_y)Nr4F)rr=rËrŒÚ_encoderÚ _encodernamer6s €r&rËzoutputstream.__init__‡s.ø€Ü Œl˜DÑ*¨8¸FÐ*ÔCØ"'ˆÔ؈Œ Ø ˆÕr6có�—|tvr!tjtd«|z«‚t|d|«|_||_y)zTSet the encoder for this stream. Receives the stream profile name. sunknown stream encoder: %srN)r$rrjrr?r@)r@rÕrBs r&Ú setencoderzoutputstream.setencoder�sD€ð ”Ñ &Ü—+‘+œaÐ =Ó>ÀÑEÓFÐ Fä'¨Ñ-¨aÑ0°Ó4ˆŒ Ø ˆÕr6cóT—|js|S|jj|«SrÔ)r?r�r×s r&r�zoutputstream.encode˜s#€Ø�}Š}؈Kà�}‰}×#Ñ# DÓ)Ð)r6cóP—|jsy|jj«SrÚ)r?r“rÛs r&r“zoutputstream.flushžr;r6cóR—|jsy|jj«yrÚ)r?rÞrÛs r&rÞzoutputstream.finish¤s€Ø�}Š}Øà � ‰ ×ÑÕr6cóü—d}|js|tz}d|_|r*|jstjd«‚|t z}|t k(r|tzrd|_t||j||||«S)r.rTs@attempting to send encoded frame without sending stream settings) r+r/rŒrÚProgrammingErrorÚSTREAM_FLAG_ENCODING_APPLIEDÚFRAME_TYPE_STREAM_SETTINGSÚ!FLAG_STREAM_ENCODING_SETTINGS_EOSrMr2)r@r1r4r$r=r‹r3s r&rMzoutputstream.makeframeªs�€ð ˆ Ø�|Š|Ø Ô3Ñ 3ˆK؈DŒLá Ø×*Ò*Ü×,Ñ,ð óðð Ô7Ñ 7ˆKð Ô0Ò 0ØÔ9Ò9à&*ˆDÔ #äØ �t—}‘} k°6¸5À'ó ð r6cóÈ—|jr |jrydjtj|j ««}|j |tt|«S)z¤Create a stream settings frame for this stream. Returns frame data or None if no stream settings frame is needed or has already been sent. Nr6) r?rŒrr rSr@rMrIrJ)r@r1r=s r&Úmakestreamsettingsframez$outputstream.makestreamsettingsframeÇsR€ð �}Š} × 7Ò 7Øà—(‘(œ8×0Ñ0°×1BÑ1BÓCÓDˆØ�~‰~Ø Ü &Ü -Ø ó  ð r6r0) r+r,r-r.rËrBr�r“rÞrMrLrrs@r&r=r=„s)ø„Ù4õ!ò !ò*ò %ò ó  ö: r6r=cóf—|jdzr"tjd|jz«‚y)NrsAserver should only write to even numbered streams; %d is not even)r2rrG)rs r&ÚensureserverstreamrNÙs8€Ø ‡�˜ÒÜ×$Ñ$ð 0Ø28·/±/ñ Bó ð ðr6ócontentencodingsr#có€—eZdZdZdd„Zd„Zd„Zd„Zd„Zd„Z dd „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zy)Ú serverreactora> Holds state of a server handling frame-based protocol requests. This class is the "brain" of the unified frame-based protocol server component. While the protocol is stateless from the perspective of requests/commands, something needs to track which frames have been received, what frames to expect, etc. This class is that thing. Instances are modeled as a state machine of sorts. Instances are also reactionary to external events. The point of this class is to encapsulate the state of the connection and the exchange of frames, not to perform work. Instead, callers tell this class when something occurs, like a frame arriving. If that activity is worthy of a follow-up action (say *run a command*), the return value of that handler will say so. I/O and CPU intensive operations are purposefully delegated outside of this class. Consumers are expected to tell instances when events occur. They do so by calling the various ``on*`` methods. These methods return a 2-tuple describing any follow-up action(s) to take. The first element is the name of an action to perform. The second is a data structure (usually a dict) specific to that action that contains more information. e.g. if the server wants to send frames back to the client, the data structure will contain a reference to those frames. Valid actions that consumers can be instructed to take are: sendframes Indicates that frames should be sent to the client. The ``framegen`` key contains a generator of frames that should be sent. The server assumes that all frames are sent to the client. error Indicates that an error occurred. Consumer should probably abort. runcommand Indicates that the consumer should run a wire protocol command. Details of the command to run are given in the data structure. wantframe Indicates that nothing of interest happened and the server is waiting on more frames from the client before anything interesting can be done. noop Indicates no additional action is required. Known Issues ------------ There are no limits to the number of partially received commands or their size. A malicious client could stream command request data and exhaust the server's memory. Partially received commands are not acted upon when end of input is reached. Should the server error if it receives a partial request? Should the client send a message to abort a partially transmitted request to facilitate graceful shutdown? Active requests that haven't been responded to aren't tracked. This means that if we receive a command and instruct its dispatch, another command with its request ID can come in over the wire and there will be a race between who responds to what. cóÜ—||_||_d|_d|_g|_i|_i|_i|_t«|_ d|_ tt«|_ t«y)añConstruct a new server reactor. ``deferoutput`` can be used to indicate that no output frames should be instructed to be sent until input has been exhausted. In this mode, events that would normally generate output frames (such as a command response being ready) will instead defer instructing the consumer to send those frames. This is useful for half-duplex transports where the sender cannot receive until all data has been transmitted. óinitialrN)Ú_uiÚ _deferoutputÚ_stateÚ_nextoutgoingstreamidÚ_bufferedframegensÚ_incomingstreamsÚ_outgoingstreamsÚ_receivingcommandsÚsetÚ_activecommandsÚ_protocolsettingsdecoderÚdictÚDEFAULT_PROTOCOL_SETTINGSÚ_sendersettingsr()r@rÕÚ deferoutputs r&rËzserverreactor.__init__'sl€ðˆŒØ'ˆÔØ ˆŒ Ø%&ˆÔ"Ø"$ˆÔà "ˆÔØ "ˆÔà"$ˆÔô #›uˆÔà(,ˆÔ%ô $Ô$=Ó>ˆÔäÕ r6có —|jdzs.d|_|jtd«|jz«S|j|jvr`|j t zs!d|_|jtd««St|j«|j|j<|j tzrd|_tjd«‚|j tzr|j|j=|j|j|j|j|j dœ}|j#|j«}|s"tjd|jz«‚||«S)zµProcess a frame that has been received off the wire. Returns a dict with an ``action`` key that details what action, if any, the consumer should take next. róerroreds/received frame with even numbered stream ID: %dsNreceived frame on unknown inactive stream without beginning of stream flag sets8support for decoding stream payloads not yet implemented)rSóprotocol-settings-receivingóidleócommand-receivingrdsunhandled state: %s)r2rVÚ_makeerrorresultrrYr3r/r2rHrrGÚSTREAM_FLAG_END_STREAMÚ_onframeinitialÚ_onframeprotocolsettingsÚ _onframeidleÚ_onframecommandreceivingÚ_onframeerroredr)r@r9ÚhandlersÚmeths r&Ú onframerecvzserverreactor.onframerecvGsj€ð �~‰~ Ò!Ø$ˆDŒKØ×(Ñ(ÜÐDÓEØ—.‘.ñ!óð ð �>‰> ×!6Ñ!6Ñ 6Ø×$Ñ$Ô'?Ò?Ø(�” Ø×,Ñ,Üð8óóðô5@ÀÇÁÓ4OˆD× !Ñ ! %§.¡.Ñ 1à × Ñ Ô;Ò ;à$ˆDŒKÜ×(Ñ(ØKóð ð × Ñ Ô5Ò 5Ø×%Ñ% e§n¡nÐ5ð×,Ñ,Ø,0×,IÑ,IØ×&Ñ&Ø"&×"?Ñ"?Ø×,Ñ,ñ  ˆð�|‰|˜DŸK™KÓ(ˆÙÜ×(Ñ(Ð)?À$Ç+Á+Ñ)MÓNÐ Ná�E‹{Ðr6c󒇇‡‡—t‰«t‰t«r t‰«Šˆˆˆˆfd„}‰j |««S)zéSignal that objects are ready to be sent to the client. ``objs`` is an iterable of objects (typically a generator) that will be encoded via CBOR and added to frames, which will be sent to the client. c 3óH•K—d}d}t‰ ‰«} t‰«} t|tj «rB|rt j"d«‚‰ j%‰«}|r|–—t'‰ ‰|«–—d}d}Œj|rt j"d«‚|s+‰ j%‰«}|r|–—t)‰ ‰«}|r|–—d}t|tj*«r%|j|j,«D]}|–—Œn�t|tj.«r?t1j2|j4«D]}|j|«D]}|–—ŒŒn4t1j6|«D]}|j|«D]}|–—ŒŒ�Œ{#t$r4|jd«D]}|–—Œ|rt ‰ ‰«D]}|–—ŒYnºt j $r5}t‰ ‰|j|j«D]}|–—ŒYd}~nxd}~wt$r8}t‰ ‰dtj|«zd¬«D]}|–—ŒYd}~n9d}~wwxYw#t$r%}t‰ ‰d|zd¬«D]}|–—ŒYd}~nd}~wwxYw‰ j8j;‰«y­w)NFTs%sóserver©r¯s:alternatelocationresponse seen after initial output objects(object follows alternatelocationresponse)rÃÚnextÚ StopIterationrÏr–rÚWireprotoCommandErrorr©r§Ú messageargsÚ Exceptionr°r Ú forcebytestrrµr ÚalternatelocationresponserGrLr£r‘ÚencodedresponserdÚindefinitebytestringresponser ÚstreamencodebytestringfromiterÚchunksrSr]Úremove) ÚemittedÚalternatelocationsentÚemitterÚor9Úer•Úobjsr1r@rs €€€€r&Ú sendframesz?serverreactor.oncommandresponsereadyobjects..sendframes’sºøèø€ØˆGØ$)Ð !Ü5°f¸iÓHˆGØðܘT› �Að>Hô" !¤^×%MÑ%MÔNÙ"Ü"'×"8Ñ"8ð!1ó#ðð !'× >Ñ >¸yÓ I˜Ù Ø"'šKäBØ" I¨qóòð15Ð-Ø"&˜Ø á,Ü#×4Ñ4ØGóðñ#à &× >Ñ >¸yÓ I˜Ù Ø"'šKô!=¸VÀYÓ O˜Ù Ø"'šKà"&˜ô" !¤^×%CÑ%CÔDØ%,§\¡\°!·&±&Ö%9˜EØ"'›Kñ&:ô$Øœ>×FÑFôô&.×%LÑ%LØŸH™Hö&˜Eð*1¯©°eÖ)< Ø&+£ ñ*=ñ &ô&.×%:Ñ%:¸1Ö%=˜EØ)0¯©°eÖ)< Ø&+£ ñ*=ð&>ñøô%ò Ø!(§¡¨dÖ!3˜Ø#› ð"4ñÜ%CØ" Iö&˜Eð#(›Kð&ñä×2Ñ2òÜ!;Ø  ¨1¯9©9°a·m±mö"˜ð$› ð"ôûä ò Ü!1ØØ!ؤ × 7Ñ 7¸Ó :Ñ:Ø )÷ "˜ð$› ð"ôûð ûô\!òÜ!1Ø  ¨5°1©9¸i÷"˜ð$› ð"ô ûð úð × Ñ × 'Ñ '¨ Õ 2ùs}ƒJ"– F¢AIÁ=J"Á>DIÆJ"Æ:IÇ J"Ç IÇ+HÈ J"È IÈ.I ÉJ"É IÉJ"É JÉI>É9J"É>JÊJ")rNrµÚlistÚiterÚ_handlesendframes)r@rr1r‡rˆs```` r&Úoncommandresponsereadyobjectsz+serverreactor.oncommandresponsereadyobjectsxs>û€ô ˜6Ô"ô �dœDÔ !ܘ“:ˆD÷o 3ðb×%Ñ%¡j£lÓ3Ð3r6có\‡—‰jr ‰jsdifSˆfd„}dd|«ifS)z‘Signals that end of input has been received. No more frames will be received. All pending activity should be completed. ónoopc3óF•K—‰jD] }|D]}|–—ŒŒy­wrÔ)rX)Úgenr9r@s €r&Úmakegenz)serverreactor.oninputeof..makegens&øèø€Ø×.Ô.�Û �EØ“Kñ!ñ/ùsƒ!ó sendframesóframegen)rUrX)r@r‘s` r&Ú oninputeofzserverreactor.oninputeofs@ø€ð× Ò ¨×(?Ò(?ؘB�;Ð ô ð Ø ™›ð ð ð r6cód—|jr|jj|«difSdd|ifS)NrŽr’r“)rUrXr)r@Úframegens r&r‹zserverreactor._handlesendframess@€Ø × Ò Ø × #Ñ #× *Ñ *¨8Ô 4ؘB�;Ð à Ø˜Xð#ðð r6có\‡‡‡‡—t‰«ˆˆˆˆfd„}‰j|««S)Nc3ót•K—t‰‰‰d¬«D]}|–—Œ‰jj‰«y­w)Nrtru)r°r]r�)r9r®r1r@rs €€€€r&rˆz/serverreactor.onservererror..sendframes&s<øèø€Ü)ؘ  3° ÷�ð“ ðð × Ñ × 'Ñ '¨ Õ 2ùsƒ58©rNr‹)r@rr1r®rˆs```` r&Ú onservererrorzserverreactor.onservererror#s%û€Ü˜6Ô"÷ 3ð×%Ñ%¡j£lÓ3Ð3r6Ncó`‡‡‡‡‡—t‰«ˆˆˆˆˆfd„}‰j|««S)zACalled when a command encountered an error before sending output.c3ór•K—t‰‰‰‰«D]}|–—Œ‰jj‰«y­wrÔ)r©r]r�)r9r�r§r1r@rs €€€€€r&rˆz0serverreactor.oncommanderror..sendframes4s<øèø€Ü3ؘ  7¨Dö�ð“ ðð × Ñ × 'Ñ '¨ Õ 2ùsƒ47r™)r@rr1r§r�rˆs````` r&Úoncommanderrorzserverreactor.oncommanderror0s*ü€ä˜6Ô"÷ 3ð 3ð×%Ñ%¡j£lÓ3Ð3r6cóò—|j}|xjdz c_t|«}||j|<tD]2}||jdvsŒ|j |j |«|S|S)zýCreate a stream to be used for sending data to the client. If this is called before protocol settings frames are received, we don't know what stream encodings are supported by the client and we will default to identity. rrO)rWr=rZr'rarBrT)r@r2rVrBs r&Úmakeoutputstreamzserverreactor.makeoutputstream>s{€ð×-Ñ-ˆØ ×"Ò" aÑ'Õ"ä ˜Ó "ˆØ*+ˆ×јhÑ'÷*ˆDØ�t×+Ñ+Ð,?Ñ@Ò@Ø— ‘ ˜TŸX™X tÔ,Øàˆð *ð ˆr6có—dd|ifS)Nr¥r¦r5)r@r®s r&rhzserverreactor._makeerrorresultTs€ØØ ˜ð ð ð r6cóR—|j|}|dsd|_tjd«‚|j|=|jrd|_nd|_|dj d«t j |dj««d}d|vr!d|_|jtd ««Sd |vri|d <||jvsJ‚|jj|«d ||d|d |jd «|d r|d j«dœfSddœfS)Nó requestdonerds,should not be called without requestdone setrgrfópayloadrrrs$command request missing "name" fieldrss runcommandrtódata)s requestidscommandrsrtr¤) r[rVrrGÚseekr Ú decodeallÚgetvaluerhrr]Úaddr)r@r1ÚentryÚrequests r&Ú_makeruncommandresultz#serverreactor._makeruncommandresultYs\€Ø×'Ñ'¨ Ñ2ˆà�^Ò$Ø$ˆDŒKÜ×(Ñ(Ø?óð ð × #Ñ # IÐ .à × "Ò "Ø.ˆD�Kà!ˆDŒKð ˆjÑ×јqÔ!Ü×$Ñ$ U¨:Ñ%6×%?Ñ%?Ó%AÓBÀ1ÑEˆà ˜'Ñ !Ø$ˆDŒKØ×(Ñ(ÜÐ9Ó:óð ð ˜'Ñ !Ø!ˆG�GÑ à × 4Ñ 4Ñ4Ð4Ð4Ø ×Ñ× Ñ  Ô+ð à'Ø# GÑ,Ø  Ñ)Ø$Ÿ[™[¨Ó5Ø6;¸G²n˜˜w™×0Ñ0Ó2ñ  ð  ð ðKOñ  ð  ð r6có"—dd|jifS)Ns wantframesstate)rVrÛs r&Ú_makewantframeresultz"serverreactor._makewantframeresult„s€ØØ �d—k‘kð ð ð r6cóæ—|jtz}|jtz}|r#|r!d|_|j t d««S|s$|s!d|_|j t d««Syy)NrdsGreceived command request frame with both new and continuation flags setsJreceived command request frame with neither new nor continuation flags set)r$rvrwrVrhr)r@r9ÚnewÚ continuations r&Ú_validatecommandrequestframez*serverreactor._validatecommandrequestframe‰s�€Ø�k‰kÔ4Ñ4ˆØ—{‘{Ô%FÑFˆ á ‘<Ø$ˆDŒKØ×(Ñ(Üð.óóð ñ™<Ø$ˆDŒKØ×(Ñ(Üð.óóð ð(ˆsr6có<—|jtk(r1d|_tj«|_|j |«S|jtk(rd|_|j|«Sd|_|jtd«|jz«S)NrerfrdsBexpected sender protocol settings or command request frame; got %d) r4Ú#FRAME_TYPE_SENDER_PROTOCOL_SETTINGSrVr Úbufferingdecoderr^rkrzrlrhr©r@r9s r&rjzserverreactor._onframeinitialŸs”€à �<‰<Ô>Ò >Ø8ˆDŒKÜ,4×,EÑ,EÓ,GˆDÔ )Ø×0Ñ0°Ó7Ð 7à �\‰\Ô7Ò 7Ø!ˆDŒKØ×$Ñ$ UÓ+Ð +ð%ˆDŒKØ×(Ñ(Üð%óð—,‘,ñ óð r6cóþ—|jdk(sJ‚|j€J‚|jtk7r.d|_|j t d«|jz«S|j tz}|j tz}|r#|r!d|_|j t d««S|s#|s!d|_|j t d««S |jj|j«|r|j«S|sJ‚|jj«}d|_|s!d|_|j t d««St!|«dkDr!d|_|j t d ««S|d }d |vr|d |j"d <d |_|j«S#t$rA}d|_|j t d«tj|«z«cYd}~Sd}~wwxYw) Nrerds/expected sender protocol settings frame; got %dsXsender protocol settings frame cannot have both continuation and end of stream flags setsOsender protocol settings frame must have continuation or end of stream flag sets;error decoding CBOR from sender protocol settings frame: %ss8sender protocol settings frame did not contain CBOR datars=sender protocol settings frame contained multiple CBOR valuesrrOrf)rVr^r4r³rhrr$Ú*FLAG_SENDER_PROTOCOL_SETTINGS_CONTINUATIONÚ!FLAG_SENDER_PROTOCOL_SETTINGS_EOSr¸r=rzr r{r­Ú getavailabler<ra)r@r9ÚmoreÚeosr†ÚdecodedÚds r&rkz&serverreactor._onframeprotocolsettings´s€Ø�{‰{Ð<Ò<Ð<Ð<Ø×,Ñ,Ð8Ð8Ð8à �<‰<Ô>Ò >Ø$ˆDŒKØ×(Ñ(ÜÐDÓEØ—,‘,ñóð ð �{‰{ÔGÑGˆØ�k‰kÔ=Ñ=ˆá ‘CØ$ˆDŒKØ×(Ñ(Üð@óóð ñ™CØ$ˆDŒKØ×(Ñ(Üð.óóð ð Ø × )Ñ )× 0Ñ 0°·±Ô ?ñ Ø×,Ñ,Ó.Ð .ሠˆsà×/Ñ/×<Ñ<Ó>ˆØ(,ˆÔ%áØ$ˆDŒKØ×(Ñ(ÜÐMÓNóð ô�‹\˜AÒ Ø$ˆDŒKØ×(Ñ(Üðóóð ð �A‰Jˆà  !Ñ #Ø89Ð:MÑ8NˆD× Ñ Ð!4Ñ 5àˆŒ à×(Ñ(Ó*Ð*øôMò Ø$ˆDŒKØ×(Ñ(ÜØRóô×)Ñ)¨!Ó,ñ-óõ ûð úsÃ%F2Æ2 G<Æ;6G7Ç1G<Ç7G<có¤—|jtk7r.d|_|jt d«|jz«S|j |«}|r|S|j |jvr.d|_|jt d«|j z«S|j |jvr.d|_|jt d«|j z«S|jtz}|jtz}|jtz}|s!d|_|jt d««Stj«}|j|j «|d| t#|«dœ|j|j <|s|s|j%|j «S|s|sJ‚d|_|j'«S)Nrds&expected command request frame; got %ds#request with ID %d already receiveds$request with ID %d is already actives3received command request frame without new flag set)r£r¤r¢ó expectingdatarg)r4rzrVrhrr±r1r[r]r$rvryrxr ÚbytesioÚwriter=Úboolr«r­)r@r9rôr¯Ú moreframesÚ expectingdatar=s r&rlzserverreactor._onframeidles¯€ð �<‰<Ô5Ò 5Ø$ˆDŒKØ×(Ñ(ÜÐ;Ó<¸u¿|¹|ÑKóð ð×/Ñ/°Ó6ˆÙ ؈Jà �?‰?˜d×5Ñ5Ñ 5Ø$ˆDŒKØ×(Ñ(ÜÐ8Ó9¸E¿O¹OÑKóð ð �?‰?˜d×2Ñ2Ñ 2Ø$ˆDŒKØ×(Ñ(ÜÐ9Ó:¸U¿_¹_ÑLóð ð�k‰kÔ4Ñ4ˆØ—[‘[Ô#CÑCˆ ØŸ ™ Ô&FÑFˆ áØ$ˆDŒKØ×(Ñ(ÜÐHÓIóð ô—,‘,“.ˆØ� ‰ �e—m‘mÔ$ð ØØ *˜NÜ" =Ó1ñ 4 ˆ×Ñ §¡Ñ0ñ¡-Ø×-Ñ-¨e¯o©oÓ>Ð >á™]Ð*Ð*Ø*ˆŒ Ø×(Ñ(Ó*Ð*r6cóò—|jtk(r9|jtzr|j |«S|j |«}|r|S|j |jvr.d|_|jtd«|j z«S|j |jvr.d|_|jtd«|j z«S|j|j }|jtk(rÒ|jtz}t|jtz«}|dr!d|_|jtd««S||dk7r!d|_|jtd««S|dj|j «|sd |d<|s|s|j#|j «S|j%«S|jt&k(ra|ds.d|_|jtd «|j z«S|d €t)j*«|d <|j-||«Sd|_|jtd «|jz«S) Nrds3received frame for request that is still active: %ds4received frame for request that is not receiving: %dr¢sGreceived command request frame when request frames were supposedly doner¿s4mismatch between expect data flag and previous framer£TsFreceived command data frame for request that is not expecting data: %dr¤s"received unexpected frame type: %d)r4rzr$rvrlr±r1r]rVrhrr[ryrÂrxrÁr=r«r­r~r rÀÚ_handlecommanddataframe)r@r9rôr©rÃrÄs r&rmz&serverreactor._onframecommandreceiving5sg€Ø �<‰<Ô5Ò 5à�{‰{Ô5Ò5Ø×(Ñ(¨Ó/Ð/à×3Ñ3°EÓ:ˆCÙØ� ð �?‰?˜d×2Ñ2Ñ 2Ø$ˆDŒKØ×(Ñ(ÜÐHÓIØ—/‘/ñ"óð ð �?‰? $×"9Ñ"9Ñ 9Ø$ˆDŒKØ×(Ñ(ÜÐIÓJØ—/‘/ñ"óð ð ×'Ñ'¨¯©Ñ8ˆà �<‰<Ô5Ò 5ØŸ™Ô'GÑGˆJÜ  §¡Ô/OÑ!OÓPˆMà�^Ò$Ø(�” Ø×,Ñ,Üð0óóðð Ð&6Ñ 7Ò7Ø(�” Ø×,Ñ,ÜÐMÓNóðð �*Ñ × #Ñ # E§M¡MÔ 2áØ(,��nÑ%á¡mØ×1Ñ1°%·/±/ÓBÐBà×,Ñ,Ó.Ð .à �\‰\Ô4Ò 4ØÐ)Ò*Ø(�” Ø×,Ñ,Üð.óð—o‘oñ &óðð�W‰~Ð%Ü!%§¡£��g‘à×/Ñ/°°uÓ=Ð =à$ˆDŒKØ×(Ñ(ÜÐ7Ó8¸5¿<¹<ÑGóð r6cót—|jtk(sJ‚|dj|j«|jt zr|j «S|jtzr/|djd«|j|j«Sd|_ |jtd««S)Nr¤rrds command data frame without flags)r4r~rÁr=r$r|r­r}r¥r«r1rVrhr)r@r9r©s r&rÆz%serverreactor._handlecommanddataframeƒs›€Ø�|‰|Ô6Ò6Ð6Ð6ð ˆg‰×јUŸ]™]Ô+à �;‰;Ô7Ò 7Ø×,Ñ,Ó.Ð .Ø �[‰[Ô0Ò 0Ø �'‰N× Ñ  Ô "Ø×-Ñ-¨e¯o©oÓ>Ð >à$ˆDŒKØ×(Ñ(¬Ð+NÓ)OÓPÐ Pr6có6—|jtd««S)Nsserver already errored)rhrrµs r&rnzserverreactor._onframeerrored’s€Ø×$Ñ$¤QÐ'@Ó%AÓBÐBr6r0rÔ)r+r,r-r.rËrqrŒr”r‹ršr�rŸrhr«r­r±rjrkrlrmrÆrnr5r6r&rQrQæsn„ñ>ó@!ò@/òbK4òZ ò*ò 4ó 4òò, ò ) òV ò ò,ò*J+òX3+òjLò\ QóCr6rQcó—eZdZdZdd„Zy)Úcommandrequestz&Represents a request to run a command.NcóX—||_||_||_||_||_d|_y)Nspending)r1rBr�r‚r„Ústate)r@r1rBr�r‚r„s r&rËzcommandrequest.__init__™s,€Ø"ˆŒØˆŒ ؈Œ ؈Œ Ø ˆŒ ؈� r6©NN)r+r,r-r.rËr5r6r&rÊrÊ–s „Ù0ô r6rÊcóJ—eZdZdZ d d„Zd d„Zd„Zd„Zd„Zd„Z d „Z d „Z y) Ú clientreactora¥Holds state of a client issuing frame-based protocol requests. This is like ``serverreactor`` but for client-side state. Each instance is bound to the lifetime of a connection. For persistent connection transports using e.g. TCP sockets and speaking the raw framing protocol, there will be a single instance for the lifetime of the TCP socket. For transports where there are multiple discrete interactions (say tunneled within in HTTP request), there will be a separate instance for each distinct interaction. Consumers are expected to tell instances when events occur by calling various methods. These methods return a 2-tuple describing any follow-up action(s) to take. The first element is the name of an action to perform. The second is a data structure (usually a dict) specific to that action that contains more information. e.g. if the reactor wants to send frames to the server, the data structure will contain a reference to those frames. Valid actions that consumers can be instructed to take are: noop Indicates no additional action is required. sendframes Indicates that frames should be sent to the server. The ``framegen`` key contains a generator of frames that should be sent. The reactor assumes that all frames in this generator are sent to the server. error Indicates that an error occurred. The ``message`` key contains an error message describing the failure. responsedata Indicates a response to a previously-issued command was received. The ``request`` key contains the ``commandrequest`` instance that represents the request this data is for. The ``data`` key contains the decoded data from the server. ``expectmore`` and ``eos`` evaluate to True when more response data is expected to follow or we're at the end of the response stream, respectively. Ncó—||_||_||_||_d|_d|_d|_d|_td«|_ tj«|_ i|_ i|_i|_t!«y)ašCreate a new instance. ``hasmultiplesend`` indicates whether multiple sends are supported by the transport. When True, it is possible to send commands immediately instead of buffering until the caller signals an intent to finish a send operation. ``buffercommands`` indicates whether sends should be buffered until the last request has been issued. ``clientcontentencoders`` is an iterable of content encoders the client will advertise to the server and that the server can use for encoding data. If not defined, the client will not advertise content encoders to the server. TFrN)rTÚ_hasmultiplesendÚ _buffersendsÚ_clientcontentencodersÚ_canissuecommandsÚ_cansendÚ_protocolsettingssentÚ_nextrequestidr=Ú_outgoingstreamÚ collectionsÚdequeÚ_pendingrequestsÚ_activerequestsrYÚ_streamsettingsdecodersr()r@rÕÚhasmultiplesendÚ buffersendsÚclientcontentencoderss r&rËzclientreactor.__init__Ñs}€ð,ˆŒØ /ˆÔØ'ˆÔØ&;ˆÔ#à!%ˆÔ؈Œ Ø%*ˆÔ"àˆÔä+¨A›ˆÔÜ +× 1Ñ 1Ó 3ˆÔØ!ˆÔØ "ˆÔØ')ˆÔ$äÕ r6có —|jstjd«‚|j}|xjdz c_t |||||¬«}|j r |j j|«|difS|jstjd«‚|jsd|_d|_|dd|j|«ifS) aRequest that a command be executed. Receives the command name, a dict of arguments to pass to the command, and an optional file object containing the raw data for the command. Returns a 3-tuple of (request, action, action data). scannot issue new commandsr©r‚r„rŽó*sends cannot be performed on this instanceFr’r“) rÔrrGr×rÊrÒrÛrrÕrÑÚ_makecommandframes)r@rBr�r‚r„r1rªs r&Ú callcommandzclientreactor.callcommandúsÚ€ð×%Ò%Ü×(Ñ(Ð)EÓFÐ Fà×'Ñ'ˆ Ø ×Ò˜qÑ Õä Ø �t˜T¨&¸8ô ˆð × Ò Ø × !Ñ !× (Ñ (¨Ô 1ؘG RÐ'Ð 'à—=’=Ü×,Ñ,ØAóðð×(Ò(Ø %�” Ø).�Ô&ðØà ×!8Ñ!8¸Ó!Aððð r6c󺇗‰jsdifS‰jstjd«‚‰jsd‰_d‰_ˆfd„}dd|«ifS)a_Request that all queued commands be sent. If any commands are buffered, this will instruct the caller to send them over the wire. If no commands are buffered it instructs the client to no-op. If instances aren't configured for multiple sends, no new command requests are allowed after this is called. rŽrãFc3óª•K—‰jrB‰jj«}‰j|«D]}|–—Œ‰jrŒAyy­wrÔ)rÛÚpoplefträ)rªr9r@s €r&Ú makeframesz/clientreactor.flushcommands..makeframes9sIøèø€Ø×'Ò'Ø×/Ñ/×7Ñ7Ó9�Ø!×4Ñ4°WÖ=�EØ“Kð>ð×'Õ'ùs ƒA AÁAr’r“)rÛrÕrrGrÑrÔ)r@rés` r&Ú flushcommandszclientreactor.flushcommands!soø€ð×$Ò$ؘB�;Ð à�}Š}Ü×(Ñ(Ø=óð ð ×$Ò$Ø%*ˆDÔ "Ø!ˆDŒMô ð Ø ™›ð ð ð r6c#óK—||j|j<d|_|jsv|jrjd|_dj t jd|ji««}|jj|jtt|¬«–—t|j|j|j|j|j|j ¬«}|D]}|–—Œd|_y­w) z‹Emit frames to issue a command request. As a side-effect, update request accounting to reflect its changed state. ssendingTr6rOrurâssentN)rÜr1rÌrÖrÓrr rSrØrMr³r¸r‡rBr�r‚r„)r@rªr=rôr9s r&räz clientreactor._makecommandframesCsòèø€ð 3:ˆ×јW×.Ñ.Ñ/Ø"ˆŒ à×)Ò)¨d×.IÒ.IØ)-ˆDÔ &à—h‘hÜ×%Ñ%à+¨T×-HÑ-HðóóˆGð×&Ñ&×0Ñ0Ø!×+Ñ+Ü:Ü7Øð 1óò ô"Ø × Ñ Ø × Ñ Ø �L‰LØ �L‰LØ—>‘>Ø×%Ñ%ô  ˆóˆEØ‹Kðð ˆ� ùs‚DDcóÔ—|jdzrddtd«|jzifS|j|jvrN|jtzsddtd«ifSt |j«|j|j<|j|j}|jt zr |j|j«|_|jtzr|j|j=|jtk(r|j|«S|j|jvrddtd«|jzifS|j|j}d|_t |j"t$|j&i}|j)|j«}|s"t+j,d|jz«‚|||«S) zÊProcess a frame that has been received off the wire. Returns a 2-tuple of (action, meta) describing further action the caller needs to take as a result of receiving this frame. rr¥r¦s.received frame with odd numbered stream ID: %dsEreceived frame on unknown stream without beginning of stream flag sets*received frame for inactive request ID: %ds receivingsunhandled frame type: %d)r2rrYr3r/r2rHr¸r=rir4rIÚ_onstreamsettingsframer1rÜrÌrŽÚ_oncommandresponseframer­Ú_onerrorresponseframerrrG)r@r9rrªrorps r&rqzclientreactor.onframerecvlsÔ€ð �>‰>˜AÒ ààÜÐKÓLØŸ.™.ñ)ððð ð �>‰> ×!6Ñ!6Ñ 6Ø×$Ñ$Ô'?Ò?àà"¤AðDó%ðððô5@ÀÇÁÓ4OˆD× !Ñ ! %§.¡.Ñ 1à×&Ñ& u§~¡~Ñ6ˆð × Ñ Ô;Ò ;Ø"ŸM™M¨%¯-©-Ó8ˆEŒMà × Ñ Ô5Ò 5Ø×%Ñ% e§n¡nÐ5à �<‰<Ô5Ò 5Ø×.Ñ.¨uÓ5Ð 5à �?‰? $×"6Ñ"6Ñ 6ààÜÐGÓHØŸ/™/ñ*ððð ð×&Ñ& u§¡Ñ7ˆØ$ˆŒ ô (¨×)EÑ)EÜ % t×'AÑ'Að ˆð �|‰|˜EŸL™LÓ)ˆÙÜ×(Ñ(Ø+¨e¯l©lÑ:óð ñ�G˜UÓ#Ð#r6có¦—|jtk(sJ‚|jtz}|jtz}|r|rddt d«ifS|s|sddt d«ifS|j |jvr-tj«}||j|j <|j|j } |j|j«|rdifS|sJ‚|j«}|j|j =|sddt d«ifS |j |j j#|j$|d|d d«difS#t$r/}ddt d«tj|«zifcYd}~Sd}~wwxYw#t$r/}ddt d «tj|«zifcYd}~Sd}~wwxYw) Nr¥r¦sXstream encoding settings frame cannot have both continuation and end of stream flags setsOstream encoding settings frame must have continuation or end of stream flag sets;error decoding CBOR from stream encoding settings frame: %srŽs8stream encoding settings frame did not contain CBOR datarrs error setting stream decoder: %s)r4rIr$Ú*FLAG_STREAM_ENCODING_SETTINGS_CONTINUATIONrJrr2rÝr r´r¸r=rzr r{r¹rYr8rT)r@r9rºr»Údecoderr†r¼s r&ríz$clientreactor._onstreamsettingsframe´s €Ø�|‰|Ô9Ò9Ð9Ð9à�{‰{ÔGÑGˆØ�k‰kÔ=Ñ=ˆá ‘CààÜðHóðð ð ñ™Càà¤ðBó!ððð ð �>‰> ×!=Ñ!=Ñ =Ü×/Ñ/Ó1ˆGØ;BˆD× (Ñ (¨¯©Ñ 8à×.Ñ.¨u¯~©~Ñ>ˆð Ø �N‰N˜5Ÿ=™=Ô )ñ ؘB�;Рሠˆsà×&Ñ&Ó(ˆØ × (Ñ (¨¯©Ð 8áàà¤ð%ó!ððð ð Ø × !Ñ ! %§.¡.Ñ 1× <Ñ <Ø—‘˜' !™* g¨a¨b kô ð˜ˆ{Ðøôaò ààÜð2óô%×1Ñ1°!Ó4ñ 5ðð õ ûð ûôJò ààÜÐ=Ó>Ü$×1Ñ1°!Ó4ñ5ððõ ûð ús<ÃEÄ:FÅ FÅ&$FÆ FÆFÆ GÆ!$G ÇGÇ GcóΗ|jtzrd|_|j|j=d||jt z|jtz|j dœfS)Nsreceiveds responsedata)órequests expectmorerr¤)r$r”rÌrÜr1r�r=)r@rªr9s r&rîz%clientreactor._oncommandresponseframe sb€Ø �;‰;Ô2Ò 2Ø'ˆGŒMØ×$Ñ$ W×%6Ñ%6Ð7ð à#Ø$Ÿ{™{Ô-OÑOØŸ ™ Ô&?Ñ?ØŸ™ñ  ð ð r6cóž—d|_|j|j=tj|j «d}d||d|ddœfS)Nrdrr¥r¬r¦)rôr¬r¦)rÌrÜr1r r¦r=)r@rªr9r¨s r&rïz#clientreactor._onerrorresponseframes]€Ø"ˆŒ Ø × Ñ  ×!2Ñ!2Ð 3ô × Ñ ˜uŸ}™}Ó -¨aÑ 0ˆð à#ؘ7™Ø˜j™Mñ ð ð r6)FTNrÍ) r+r,r-r.rËrårêrärqrírîrïr5r6r&rÏrÏ¢sC„ñ,ðbØØ"ó '!óR%òN  òD' òRF$òPVòp  ó r6rÏrÔ)VrÙrIÚi18nrr rÚ thirdpartyrrrrr r Úutilsr r rHr{r/rirHr>rzr~rŽr­r¹ÚFRAME_TYPE_PROGRESSr³rIr;rvrwryrxÚFLAGS_COMMAND_REQUESTr|r}ÚFLAGS_COMMAND_DATAr�r”ÚFLAGS_COMMAND_RESPONSEr·r¸ÚFLAGS_SENDER_PROTOCOL_SETTINGSrñrJÚFLAGS_STREAM_ENCODING_SETTINGSr?ÚStructÚARGUMENT_RECORD_HEADERr'rVr*r9rMr^rgrpr‡r‘r–r£r©r°rÁrÃrÒràrår÷rrrr r$r'r(rr2r=rNr`rQrÊrÏr5r6r&ÚrsðóÛ åÝÝ÷õ÷ð ÐØÐàÐØÐØ#Ðð.Ø)Ø,ñ€ ð "ÐØÐØ"ÐØ ÐØÐØÐØ&*Ð#Ø!Ðð3Ø,Ø4Ø0Ø*Ø$Ø!DØ2ñ € ð ÐØ$(Ð!Ø#'Ð Ø#'Ð ð %Ø6Ø -Ø2ñ Ðð"&ÐØÐð4Ø !ñÐð &*Ð"Ø Ðð8Ø %ñÐð .2Ð*Ø$(Ð!ð@Ø -ñ"Ðð .2Ð*Ø$(Ð!ð@Ø -ñ"ÐðÐ 5ØÐ/ØÐ!7ؘrؘBؘØ'Ð)GØÐ >ð Ðð'˜Ÿ™ uÓ-Ðò ð€‡�ˆdÔ÷ðóðð€‡�ˆd˜Ô÷ ð ó ð ò@ò*?òDò2ðN Ø'Ø óJòZð,%;óò<"óJò.ð,,Bó5÷pg ñg ÷\ ñ ÷ ñ ÷ñ÷* 3ñ 3÷ñô.0�_ô0÷ 3ñ3ôH�_ôHð€ØÐò.÷. ñ ô,%�&ô%ôBR �6ôR òj ð˜+˜ðÐ÷ m Cñm C÷`  ñ  ÷G òG r6