mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
close stream after Response.output
This commit is contained in:
parent
471810cf70
commit
095487ce85
1 changed files with 6 additions and 1 deletions
|
|
@ -406,7 +406,12 @@ module Response = struct
|
|||
begin match body with
|
||||
| `String "" | `Void -> ()
|
||||
| `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;
|
||||
flush oc
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue