Commit 2ce8716c authored by Vincent Laporte's avatar Vincent Laporte Committed by Vincent Laporte
Browse files

ocamlPackages.dream: init at 1.0.0-alpha8

parent cd5ff2ed
Loading
Loading
Loading
Loading
+67 −0
Original line number Diff line number Diff line
{
  lib,
  buildDunePackage,
  dream-pure,
  lwt_ppx,
  camlp-streams,
  caqti-lwt,
  cstruct,
  digestif,
  dream-httpaf,
  graphql-lwt,
  h2-lwt-unix,
  httpun-lwt-unix,
  httpun-ws,
  lambdasoup,
  lwt_ssl,
  magic-mime,
  markup,
  mirage-clock,
  mirage-crypto-rng,
  mirage-crypto-rng-lwt,
  multipart_form-lwt,
  ssl,
  unstrctrd,
  uri,
  yojson,
}:

buildDunePackage {
  pname = "dream";

  inherit (dream-pure) version src;

  # Compatibility with httpun 0.2.0 and h2 0.13
  patches = [ ./httpun.patch ];

  buildInputs = [ lwt_ppx ];

  propagatedBuildInputs = [
    camlp-streams
    caqti-lwt
    cstruct
    digestif
    dream-httpaf
    dream-pure
    graphql-lwt
    h2-lwt-unix
    httpun-lwt-unix
    httpun-ws
    lambdasoup
    lwt_ssl
    magic-mime
    markup
    mirage-clock
    mirage-crypto-rng
    mirage-crypto-rng-lwt
    multipart_form-lwt
    ssl
    unstrctrd
    uri
    yojson
  ];

  meta = dream-pure.meta // {
    description = "Tidy, feature-complete Web framework";
  };
}
+20 −0
Original line number Diff line number Diff line
diff --git a/src/http/adapt.ml b/src/http/adapt.ml
index c6bd416..5b01e17 100644
--- a/src/http/adapt.ml
+++ b/src/http/adapt.ml
@@ -74,7 +74,7 @@ let forward_body
     response
     (Httpun.Body.Writer.write_string body)
     (Httpun.Body.Writer.write_bigstring body)
-    (Httpun.Body.Writer.flush body)
+    (fun f -> Httpun.Body.Writer.flush body (fun _ -> f ()))
     (fun _code -> Httpun.Body.Writer.close body)
 
 let forward_body_h2
@@ -85,5 +85,5 @@ let forward_body_h2
     response
     (H2.Body.Writer.write_string body)
     (H2.Body.Writer.write_bigstring body)
-    (H2.Body.Writer.flush body)
+    (fun f -> H2.Body.Writer.flush body (fun _ -> f ()))
     (fun _code -> H2.Body.Writer.close body)
+2 −0
Original line number Diff line number Diff line
@@ -383,6 +383,8 @@ let

    dot-merlin-reader = callPackage ../development/tools/ocaml/merlin/dot-merlin-reader.nix { };

    dream = callPackage ../development/ocaml-modules/dream { };

    dream-httpaf = callPackage ../development/ocaml-modules/dream/httpaf.nix { };

    dream-pure = callPackage ../development/ocaml-modules/dream/pure.nix { };