def client.data.content

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

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

1087def client.data.content(end_stream: Bool, content: Bytes.Bytes, writes: List<&1, Bytes.Bytes>,
1088    s: Stream, tail: List<&1, Stream>, input: Bytes.Bytes,
1089    encoder: Hpack.State, decoder: Hpack.State, control: Control) -> Reply:
1090  match end_stream:
1091    case False{}:
1092      Stream{id, send_window, recv_window, local_end, remote_end, head,
1093        headers, partial, body, outgoing} = s
1094      Advanced{Client{input,
1095        Con{Stream{id, send_window, recv_window, local_end, False{}, head,
1096          headers, partial, Bytes.append(body, content), outgoing}, tail},
1097        encoder, decoder, control}, writes, Nil{}}
1098    case True{}:
1099      Stream{id, send_window, recv_window, local_end, remote_end, head,
1100        headers, partial, body, outgoing} = s
1101      client.after(client.complete(Stream{id, send_window, recv_window, local_end, True{}, head,
1102        headers, partial, Bytes.append(body, content), outgoing}, tail, input, encoder, decoder, control),
1103        next => extra => events =>
1104          Advanced{next, List.append(&1, Bytes.Bytes, writes, extra), events})

Uses (12)

Used by (1)