@@ -131,38 +131,38 @@ let run ~role:_ actions tls =
131
131
Miou. yield () ;
132
132
go buf tls actions
133
133
| Send str :: actions ->
134
- Tls_miou . write tls str;
134
+ Tls_miou_unix . write tls str;
135
135
go buf tls actions
136
136
| Close :: actions ->
137
- Tls_miou . close tls;
137
+ Tls_miou_unix . close tls;
138
138
go buf tls actions
139
139
| Shutdown cmd :: actions ->
140
- Tls_miou . shutdown tls (cmd :> [ `read | `write | `read_write ] );
140
+ Tls_miou_unix . shutdown tls (cmd :> [ `read | `write | `read_write ] );
141
141
go buf tls actions
142
142
| Recv len :: actions ->
143
143
let tmp = Bytes. make len '\000' in
144
- Tls_miou . really_read tls tmp;
144
+ Tls_miou_unix . really_read tls tmp;
145
145
Buffer. add_subbytes buf tmp 0 len;
146
146
go buf tls actions
147
147
in
148
148
let buf = Buffer. create 0x100 in
149
149
try go buf tls actions with
150
- | End_of_file | Tls_miou .Closed_by_peer | Tls_miou .Tls_alert _
151
- | Tls_miou .Tls_failure _ ->
152
- inhibit (fun () -> Miou_unix. close (Tls_miou . file_descr tls));
150
+ | End_of_file | Tls_miou_unix .Closed_by_peer | Tls_miou_unix .Tls_alert _
151
+ | Tls_miou_unix .Tls_failure _ ->
152
+ inhibit (fun () -> Miou_unix. close (Tls_miou_unix . file_descr tls));
153
153
Buffer. contents buf
154
154
| exn ->
155
- inhibit (fun () -> Miou_unix. close (Tls_miou . file_descr tls));
155
+ inhibit (fun () -> Miou_unix. close (Tls_miou_unix . file_descr tls));
156
156
raise exn
157
157
158
158
let run_client ~to_client :actions cfg addr =
159
159
let domain = Unix. domain_of_sockaddr addr in
160
160
let socket = Unix. socket ~cloexec: true domain Unix. SOCK_STREAM 0 in
161
161
Unix. connect socket addr;
162
162
let fd = Miou_unix. of_file_descr ~non_blocking: true socket in
163
- let tls = Tls_miou . client_of_fd cfg fd in
163
+ let tls = Tls_miou_unix . client_of_fd cfg fd in
164
164
let finally () =
165
- inhibit (fun () -> Miou_unix. close (Tls_miou . file_descr tls))
165
+ inhibit (fun () -> Miou_unix. close (Tls_miou_unix . file_descr tls))
166
166
in
167
167
Fun. protect ~finally @@ fun () -> run ~role: " client" actions tls
168
168
@@ -201,7 +201,7 @@ let run_server ~to_server:actions ~stop fd cfg =
201
201
| Ok (fd , _ ) ->
202
202
ignore
203
203
( Miou. call_cc ~orphans @@ fun () ->
204
- match Tls_miou . server_of_fd cfg fd with
204
+ match Tls_miou_unix . server_of_fd cfg fd with
205
205
| tls -> run ~role: " server" actions tls
206
206
| exception _ ->
207
207
Miou_unix. close fd;
0 commit comments