Merge remote-tracking branch 'origin/close_stream'

This commit is contained in:
craff 2023-01-18 21:47:29 -10:00
commit 1caeff7840

View file

@ -406,7 +406,12 @@ module Response = struct
begin match body with begin match body with
| `String "" | `Void -> () | `String "" | `Void -> ()
| `String s -> output_string oc s; | `String s -> output_string oc s;
| `Stream str -> Byte_stream.output_chunked oc str; | `Stream str ->
try
Byte_stream.output_chunked oc str;
Byte_stream.close str
with
e -> Byte_stream.close str; raise e
end; end;
flush oc flush oc
end end