mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
Merge pull request #55 from craff/close_stream
close stream after Response.output
This commit is contained in:
commit
c81ca48fbd
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue