def client.headers.fields.select

bend-kit-http2@0.4.0.0 · http2.bend:959

import bend-kit-http2@0.4.0.0/http2.bend as Http2
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-http2@0.4.0.0/hpack.bend as Hpack

959def client.headers.fields.select(interim: Bool, fields: List<&2, Hpack.Field>, s: Stream,
960    tail: List<&1, Stream>, input: Bytes.Bytes, encoder: Hpack.State,
961    decoder: Hpack.State, control: Control) -> Reply:
962  match interim:
963    case True{}:
964      Stream{+id, send_window, recv_window, local_end, +remote_end, head,
965        headers, partial, body, outgoing} = s
966      client.headers.interim.valid(Bool.not(remote_end), id, fields,
967        Stream{id, send_window, recv_window, local_end, remote_end, head,
968          headers, partial, body, outgoing}, tail, input, encoder, decoder, control)
969    case False{}:
970      Stream{id, send_window, recv_window, local_end, remote_end, head,
971        headers, partial, body, outgoing} = s
972      match remote_end:
973        case True{}:
974          client.complete(Stream{id, send_window, recv_window, local_end, True{}, True{},
975            List.append(&2, Hpack.Field, headers, fields), partial, body, outgoing},
976            tail, input, encoder, decoder, control)
977        case False{}:
978          client.ok(Client{input,
979            Con{Stream{id, send_window, recv_window, local_end, False{}, True{},
980              List.append(&2, Hpack.Field, headers, fields), partial, body, outgoing}, tail},
981            encoder, decoder, control})

Uses (14)

Used by (1)