Skip to content

Commit

Permalink
ocamlPackages.ocsigen_server: fix for conduit 7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vbgl committed Jan 28, 2025
1 parent cc64e7b commit 9e11985
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkgs/development/ocaml-modules/ocsigen-server/conduit.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/server/ocsigen_cohttp.ml b/src/server/ocsigen_cohttp.ml
index 66895339..edbfcbf2 100644
--- a/src/server/ocsigen_cohttp.ml
+++ b/src/server/ocsigen_cohttp.ml
@@ -105,7 +105,8 @@ let handler ~ssl ~address ~port ~connector (flow, conn) request body =
let rec getsockname = function
| `TCP (ip, port) -> Unix.ADDR_INET (Ipaddr_unix.to_inet_addr ip, port)
| `Unix_domain_socket path -> Unix.ADDR_UNIX path
- | `TLS (_, edn) -> getsockname edn
+ | `TLS (_, edn) -> getsockname (edn :> Conduit_lwt_unix.endp)
+ | `TLS_tunnel _ -> raise (Failure "TLS tunnel not supported")
| `Unknown err -> raise (Failure ("resolution failed: " ^ err))
| `Vchan_direct _ -> raise (Failure "VChan not supported")
| `Vchan_domain_socket _ -> raise (Failure "VChan not supported")
2 changes: 2 additions & 0 deletions pkgs/development/ocaml-modules/ocsigen-server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ buildDunePackage rec {
hash = "sha256-T3bgPZpDO6plgebLJDBtBuR2eR/bN3o24UAUv1VwgtI=";
};

patches = [ ./conduit.patch ];

nativeBuildInputs = [
makeWrapper
which
Expand Down

0 comments on commit 9e11985

Please sign in to comment.