ocaml-cohttp icon indicating copy to clipboard operation
ocaml-cohttp copied to clipboard

Cohttp-lwt, Server: How should we now close `Expert response_action?

Open pirbo opened this issue 2 years ago • 2 comments

Type Cohttp.S.IO.ic is now abstract and (as far as I can see) there is no function provided to "close" one. Therefore either

https://github.com/mirage/ocaml-cohttp/blob/de3900238f6f3cd167fa550c3095e23225147f57/cohttp-lwt/src/s.ml#L293-L294

is not anymore the way to go and the comment needs an update or we need a way to do the recommended action :-)

Note that in any case, this introduce a breaking change as existing code using cohttp.5 has some Lwt_io.close ic that doesn't type anymore. (Discovered by testing the compatibility of https://gitlab.com/nomadic-labs/resto with cohttp.6)

pirbo avatar Jul 12 '23 07:07 pirbo

I would go with your second suggestion, do you have a suggestion on how to re-introduce it?

mseri avatar Sep 15 '23 14:09 mseri

In cohttp-lwt-unix the Input_channel has a close function, perhaps we could make that a requirement from the signature?

mseri avatar Sep 15 '23 14:09 mseri