@@ -409,30 +409,30 @@ module Sockets = struct
409409 let connect ?(read_buffer_size = default_read_buffer_size) (ip , port ) =
410410 let description = Fmt. strf " tcp:%a:%d" Ipaddr. pp_hum ip port in
411411 let label = match ip with
412- | Ipaddr. V4 _ -> " TCPv4"
413- | Ipaddr. V6 _ -> " TCPv6" in
412+ | Ipaddr. V4 _ -> " TCPv4"
413+ | Ipaddr. V6 _ -> " TCPv6" in
414414 register_connection_noexn description
415415 >> = function
416416 | None ->
417417 errorf " Socket.%s.connect %s: hit connection limit" label description
418418 | Some idx ->
419- let fd =
420- try match ip with
421- | Ipaddr. V4 _ -> Uwt.Tcp. init_ipv4_exn ()
422- | Ipaddr. V6 _ -> Uwt.Tcp. init_ipv6_exn ()
423- with e -> deregister_connection idx; raise e in
424- Lwt. catch (fun () ->
425- let sockaddr = make_sockaddr (ip, port) in
426- Uwt.Tcp. connect fd ~addr: sockaddr >> = fun () ->
427- of_fd ~idx ~label ~read_buffer_size ~description fd
428- |> Lwt_result. return
429- ) (fun e ->
430- deregister_connection idx;
431- log_exception_continue " Tcp.connect Uwt.Tcp.close_wait"
432- (fun () -> Uwt.Tcp. close_wait fd)
433- >> = fun () ->
434- errorf " Socket.%s.connect %s: caught %a" label description Fmt. exn e
435- )
419+ let fd =
420+ try match ip with
421+ | Ipaddr. V4 _ -> Uwt.Tcp. init_ipv4_exn ()
422+ | Ipaddr. V6 _ -> Uwt.Tcp. init_ipv6_exn ()
423+ with e -> deregister_connection idx; raise e in
424+ Lwt. catch (fun () ->
425+ let sockaddr = make_sockaddr (ip, port) in
426+ Uwt.Tcp. connect fd ~addr: sockaddr >> = fun () ->
427+ of_fd ~idx ~label ~read_buffer_size ~description fd
428+ |> Lwt_result. return
429+ ) (fun e ->
430+ deregister_connection idx;
431+ log_exception_continue " Tcp.connect Uwt.Tcp.close_wait"
432+ (fun () -> Uwt.Tcp. close_wait fd)
433+ >> = fun () ->
434+ errorf " Socket.%s.connect %s: caught %a" label description Fmt. exn e
435+ )
436436
437437 let shutdown_read _ =
438438 Lwt. return ()
0 commit comments