mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -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
|
in
|
||||||
|
|
||||||
object (self)
|
object
|
||||||
method flush () =
|
method flush () =
|
||||||
write_buf ~force:true ();
|
write_buf ~force:true ();
|
||||||
flush self
|
flush oc
|
||||||
|
|
||||||
method close () =
|
method close () =
|
||||||
write_buf ~force:true ();
|
write_buf ~force:true ();
|
||||||
(* write an empty chunk to close the stream *)
|
(* 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) *)
|
(* write another crlf after the stream (see #56) *)
|
||||||
output_string self "\r\n";
|
output_string oc "\r\n";
|
||||||
self#flush ();
|
flush oc;
|
||||||
if close_rec then close oc
|
if close_rec then close oc
|
||||||
|
|
||||||
method output b i n =
|
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
|
let out = Out.create_of_out out in
|
||||||
if top then Out.add_string out "<!DOCTYPE html>\n";
|
if top then Out.add_string out "<!DOCTYPE html>\n";
|
||||||
self out;
|
self out;
|
||||||
Out.add_format_nl out
|
Out.add_format_nl out;
|
||||||
|
Out.flush out
|
||||||
|
|
||||||
(** Convert a HTML element to a string.
|
(** Convert a HTML element to a string.
|
||||||
@param top if true, add DOCTYPE at the beginning. The top element should then
|
@param top if true, add DOCTYPE at the beginning. The top element should then
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ depends: [
|
||||||
"base-threads"
|
"base-threads"
|
||||||
"result"
|
"result"
|
||||||
"hmap"
|
"hmap"
|
||||||
|
"iostream" {>= "0.2"}
|
||||||
"ocaml" {>= "4.08"}
|
"ocaml" {>= "4.08"}
|
||||||
"odoc" {with-doc}
|
"odoc" {with-doc}
|
||||||
"logs" {with-test}
|
"logs" {with-test}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ depends: [
|
||||||
"dune" {>= "2.9"}
|
"dune" {>= "2.9"}
|
||||||
"tiny_httpd" {= version}
|
"tiny_httpd" {= version}
|
||||||
"camlzip" {>= "1.06"}
|
"camlzip" {>= "1.06"}
|
||||||
|
"iostream-camlzip"
|
||||||
"logs" {with-test}
|
"logs" {with-test}
|
||||||
"odoc" {with-doc}
|
"odoc" {with-doc}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue