diff --git a/src/lib_rpc_http/RPC_client_unix.ml b/src/lib_rpc_http/RPC_client_unix.ml index be1d41413602c81fdc5a6ceea5af231334f7823a..17201d84208cb07207cafc9938f5aae197c0c2b5 100644 --- a/src/lib_rpc_http/RPC_client_unix.ml +++ b/src/lib_rpc_http/RPC_client_unix.ml @@ -54,7 +54,8 @@ module Attempt_logging = Internal_event.Make (struct let level = Internal_event.Error end) -module RetryClient : Cohttp_lwt.S.Client = struct +module RetryClient : + Cohttp_lwt.S.Client with type ctx = Cohttp_lwt_unix.Net.ctx = struct include Cohttp_lwt_unix.Client let clone_body = function `Stream s -> `Stream (Lwt_stream.clone s) | x -> x @@ -62,7 +63,9 @@ module RetryClient : Cohttp_lwt.S.Client = struct let call ?ctx ?headers ?body ?chunked meth uri = let rec call_and_retry_on_502 attempt delay = let open Lwt_syntax in - let* response, ansbody = call ?ctx ?headers ?body ?chunked meth uri in + let* response, ansbody = + Cohttp_lwt_unix.Client.call ?ctx ?headers ?body ?chunked meth uri + in let status = Cohttp.Response.status response in match status with | `Bad_gateway -> diff --git a/src/lib_rpc_http/RPC_client_unix.mli b/src/lib_rpc_http/RPC_client_unix.mli index 23d45509469e89f4d4e296f8b26f6b8080ce15be..0414afbb713221b808b0dfaf31c6b711b20f0ad0 100644 --- a/src/lib_rpc_http/RPC_client_unix.mli +++ b/src/lib_rpc_http/RPC_client_unix.mli @@ -23,4 +23,6 @@ (* *) (*****************************************************************************) +module RetryClient : Cohttp_lwt.S.Client with type ctx = Cohttp_lwt_unix.Net.ctx + include RPC_client.S