Skip to content

Commit

Permalink
Leave response flush to its default value in servers
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterDA committed Jun 20, 2024
1 parent 92d7091 commit 343574f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cohttp-async/src/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ let handle_client handle_request sock rd wr =
Http.Request.is_keep_alive req
&& Http.Response.is_keep_alive res
in
let flush = Http.Response.flush res in
let res =
let headers =
Http.Header.add_unless_exists
Expand All @@ -95,7 +94,7 @@ let handle_client handle_request sock rd wr =
in
{ res with Http.Response.headers }
in
Io.Response.write ~flush
Io.Response.write
(Body.Private.write_body Io.Response.write_body res_body)
res wr
>>= fun () ->
Expand Down
3 changes: 1 addition & 2 deletions cohttp-lwt/src/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ module Make (IO : S.IO) = struct

let handle_response ~keep_alive oc res body conn_closed handle_client =
IO.catch (fun () ->
let flush = Response.flush res in
Response.write ~flush
Response.write
(fun writer -> Body.write_body (Response.write_body writer) body)
res oc)
>>= function
Expand Down

0 comments on commit 343574f

Please sign in to comment.