diff --git a/capnp-rpc-mirage.opam b/capnp-rpc-mirage.opam index a4e79f09..41514d70 100644 --- a/capnp-rpc-mirage.opam +++ b/capnp-rpc-mirage.opam @@ -19,6 +19,7 @@ depends: [ "dns-client" {>= "6.0.0"} "tls-mirage" "mirage-stack" {>= "2.2.0"} + "mirage-protocols" {>= "6.0.0"} "arp" {>= "2.3.0" & with-test} "alcotest" {>= "1.0.1" & with-test} "alcotest-lwt" {>= "1.0.1" & with-test} diff --git a/capnp-rpc/struct_proxy.ml b/capnp-rpc/struct_proxy.ml index c6bd9ce8..e7b996b9 100644 --- a/capnp-rpc/struct_proxy.ml +++ b/capnp-rpc/struct_proxy.ml @@ -170,7 +170,10 @@ module Make (C : S.CORE_TYPES) = struct | PromiseField p -> p.sr#field_sealed_dispatch p.path brand end - class virtual ['promise] t init = object (self : #C.struct_ref) + class virtual ['promise] t init = object (self : 'self) + constraint 'self = #C.struct_ref + constraint 'self = #C.struct_resolver + val mutable state = Unresolved { target = init; diff --git a/mirage/capnp_rpc_mirage.ml b/mirage/capnp_rpc_mirage.ml index 490e3e40..1fcde787 100644 --- a/mirage/capnp_rpc_mirage.ml +++ b/mirage/capnp_rpc_mirage.ml @@ -37,7 +37,7 @@ module Make (R : Mirage_random.S) (T : Mirage_time.S) (M : Mirage_clock.MCLOCK) in match listen_address with | `TCP port -> - Stack.listen_tcp t.stack ~port (fun flow -> + Stack.TCP.listen (Stack.tcp t.stack) ~port (fun flow -> Log.info (fun f -> f ?tags "Accepting new connection"); let secret_key = if serve_tls then Some (Vat_config.secret_key config) else None in Lwt.async (fun () -> handle_connection ?tags ~secret_key vat flow); diff --git a/test-mirage/test_mirage.ml b/test-mirage/test_mirage.ml index 3ac6d618..90c2ab25 100644 --- a/test-mirage/test_mirage.ml +++ b/test-mirage/test_mirage.ml @@ -37,7 +37,7 @@ module Stack = struct module Icmp = Icmpv4.Make(I4) include Tcpip_stack_direct.MakeV4V6(Time)(Random)(V)(E)(A)(I)(Icmp)(U)(T) - let create_network () = B.create ~use_async_readers:true ~yield:Lwt_unix.yield () + let create_network () = B.create ~use_async_readers:true ~yield:Lwt.pause () let create_interface backend cidr = V.connect backend >>= fun v ->