mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-05 19:00:32 -05:00
fixes
This commit is contained in:
parent
adf4c6815f
commit
e3047a7b6a
4 changed files with 9 additions and 6 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ depends: [
|
|||
"base-threads"
|
||||
"result"
|
||||
"hmap"
|
||||
"iostream" {>= "0.2"}
|
||||
"ocaml" {>= "4.08"}
|
||||
"odoc" {with-doc}
|
||||
"logs" {with-test}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ depends: [
|
|||
"dune" {>= "2.9"}
|
||||
"tiny_httpd" {= version}
|
||||
"camlzip" {>= "1.06"}
|
||||
"iostream-camlzip"
|
||||
"logs" {with-test}
|
||||
"odoc" {with-doc}
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue