From 45a7503bcf82735b2e7024e87de95d9044813478 Mon Sep 17 00:00:00 2001 From: Sven Anderson Date: Sat, 19 Jul 2025 15:42:28 +0200 Subject: [PATCH] Undo deprecation of connection value In #798 the connection value has been deprecated with the claim it is useless. However, in fact it is used at least with the Mirage backend in order to track the connections for logging etc. (See last two comments of the PR.) In over 3 years no replacement has been added, so this change removes the deprecation until some alternative exists. (Which could be possibly Mirage only.) --- cohttp-eio/src/server.ml | 2 +- cohttp-lwt/src/server.ml | 2 +- cohttp-mirage/src/static.ml | 2 +- cohttp/src/cohttp.ml | 2 +- cohttp/src/server.ml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cohttp-eio/src/server.ml b/cohttp-eio/src/server.ml index b1b2fe6f8..51543246a 100644 --- a/cohttp-eio/src/server.ml +++ b/cohttp-eio/src/server.ml @@ -2,7 +2,7 @@ open Utils module IO = Io.IO type body = Body.t -type conn = IO.conn * Cohttp.Connection.t [@@warning "-3"] +type conn = IO.conn * Cohttp.Connection.t type writer = Http.Request.t * IO.oc type response = writer -> unit diff --git a/cohttp-lwt/src/server.ml b/cohttp-lwt/src/server.ml index 397b80ed9..8b89c5b23 100644 --- a/cohttp-lwt/src/server.ml +++ b/cohttp-lwt/src/server.ml @@ -1,6 +1,6 @@ open Lwt.Infix module Header = Cohttp.Header -module Connection = Cohttp.Connection [@@warning "-3"] +module Connection = Cohttp.Connection module Make (IO : S.IO) = struct module IO = IO diff --git a/cohttp-mirage/src/static.ml b/cohttp-mirage/src/static.ml index 26b4c9509..d7b7fc30b 100644 --- a/cohttp-mirage/src/static.ml +++ b/cohttp-mirage/src/static.ml @@ -18,7 +18,7 @@ *) module Key = Mirage_kv.Key -module Connection = Cohttp.Connection [@@warning "-3"] +module Connection = Cohttp.Connection module HTTP (FS : Mirage_kv.RO) (S : Cohttp_lwt.S.Server) = struct open Lwt.Infix diff --git a/cohttp/src/cohttp.ml b/cohttp/src/cohttp.ml index a5aa7db98..52035cc4a 100644 --- a/cohttp/src/cohttp.ml +++ b/cohttp/src/cohttp.ml @@ -2,7 +2,7 @@ module Accept = Accept module Auth = Auth module Body = Body module Conf = Conf -module Connection = Connection [@@deprecated "Connection.t values are useless."] +module Connection = Connection module Code = Code module Cookie = Cookie module Header = Header diff --git a/cohttp/src/server.ml b/cohttp/src/server.ml index 0c2675322..c83bf702c 100644 --- a/cohttp/src/server.ml +++ b/cohttp/src/server.ml @@ -2,7 +2,7 @@ module type S = sig module IO : S.IO type body - type conn = IO.conn * Connection.t [@@warning "-3"] + type conn = IO.conn * Connection.t type response type response_action =