This commit is contained in:
Simon Cruanes 2024-02-26 15:59:23 -05:00
parent adf4c6815f
commit e3047a7b6a
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
4 changed files with 9 additions and 6 deletions

View file

@ -77,18 +77,18 @@ module Output = struct
)
in
object (self)
object
method flush () =
write_buf ~force:true ();
flush self
flush oc
method close () =
write_buf ~force:true ();
(* write an empty chunk to close the stream *)
output_string self "0\r\n";
output_string oc "0\r\n";
(* write another crlf after the stream (see #56) *)
output_string self "\r\n";
self#flush ();
output_string oc "\r\n";
flush oc;
if close_rec then close oc
method output b i n =

View file

@ -18,7 +18,8 @@ let to_output ?(top = false) (self : elt) (out : #IO.Output.t) : unit =
let out = Out.create_of_out out in
if top then Out.add_string out "<!DOCTYPE html>\n";
self out;
Out.add_format_nl out
Out.add_format_nl out;
Out.flush out
(** Convert a HTML element to a string.
@param top if true, add DOCTYPE at the beginning. The top element should then

View file

@ -16,6 +16,7 @@ depends: [
"base-threads"
"result"
"hmap"
"iostream" {>= "0.2"}
"ocaml" {>= "4.08"}
"odoc" {with-doc}
"logs" {with-test}

View file

@ -11,6 +11,7 @@ depends: [
"dune" {>= "2.9"}
"tiny_httpd" {= version}
"camlzip" {>= "1.06"}
"iostream-camlzip"
"logs" {with-test}
"odoc" {with-doc}
]