Skip to content

Commit 480d5e6

Browse files
committed
Ocsigen_response: Mention possible optimisation
1 parent a4d22c4 commit 480d5e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/server/ocsigen_response.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ open Cohttp
22
open Lwt.Syntax
33

44
module Body = struct
5+
(* TODO: Avoid copies by passing buffers directly. This API was choosen
6+
because it is closer to [Lwt_stream] which was used before. This type
7+
forces data to be copied from buffers (usually [bytes]) to immutable
8+
strings, which is unecessary. *)
59
type t = ((string -> unit Lwt.t) -> unit Lwt.t) * Transfer.encoding
610

711
let make encoding writer : t = writer, encoding

0 commit comments

Comments
 (0)