type Phase
import bend-kube-runtime@0.2.0.0/src/http.bend as Httpimport Base
21# Where the decoder is.
22# PHead: header bytes, reversed, and how much of CRLF CRLF ends them
23# PLen: body bytes left under Content-Length
24# PSize: a chunk's hex size so far; ext once past a ';' extension
25# PData: chunk bytes left; PCrlf: the CRLF after a chunk's data
26# PTrail: trailer lines after the last chunk; blank if this line is empty
27# PClose: a body that runs to the end of the stream
28# PErr: a broken response; PLost: the connection failed before any byte
29# of a response (a request on it may safely be retried)
30type Phase is Data:
31 PHead{buf: List<&2, U32>, tail: U32}
32 PLen{left: U32}
33 PSize{size: U32, ext: Bool, any: Bool}
34 PData{left: U32}
35 PCrlf{}
36 PTrail{blank: Bool}
37 PClose{}
38 PDone{}
39 PErr{msg: String}
40 PLost{msg: String}