TCP/TLS connection pooling for Eio
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): replace Printf/Format with Fmt in block and bpsec

+13 -22
+11 -19
lib/config.ml
··· 32 32 ?on_connection_reused () = 33 33 (* Validate parameters *) 34 34 if max_connections_per_endpoint <= 0 then 35 - invalid_arg 36 - (Printf.sprintf "max_connections_per_endpoint must be positive, got %d" 37 - max_connections_per_endpoint); 35 + Fmt.invalid_arg "max_connections_per_endpoint must be positive, got %d" 36 + max_connections_per_endpoint; 38 37 39 38 if max_idle_time <= 0.0 then 40 - invalid_arg 41 - (Printf.sprintf "max_idle_time must be positive, got %.2f" max_idle_time); 39 + Fmt.invalid_arg "max_idle_time must be positive, got %.2f" max_idle_time; 42 40 43 41 if max_connection_lifetime <= 0.0 then 44 - invalid_arg 45 - (Printf.sprintf "max_connection_lifetime must be positive, got %.2f" 46 - max_connection_lifetime); 42 + Fmt.invalid_arg "max_connection_lifetime must be positive, got %.2f" 43 + max_connection_lifetime; 47 44 48 45 (match max_connection_uses with 49 46 | Some n when n <= 0 -> 50 - invalid_arg 51 - (Printf.sprintf "max_connection_uses must be positive, got %d" n) 47 + Fmt.invalid_arg "max_connection_uses must be positive, got %d" n 52 48 | _ -> ()); 53 49 54 50 if connect_timeout <= 0.0 then 55 - invalid_arg 56 - (Printf.sprintf "connect_timeout must be positive, got %.2f" 57 - connect_timeout); 51 + Fmt.invalid_arg "connect_timeout must be positive, got %.2f" connect_timeout; 58 52 59 53 if connect_retry_count < 0 then 60 - invalid_arg 61 - (Printf.sprintf "connect_retry_count must be non-negative, got %d" 62 - connect_retry_count); 54 + Fmt.invalid_arg "connect_retry_count must be non-negative, got %d" 55 + connect_retry_count; 63 56 64 57 if connect_retry_delay <= 0.0 then 65 - invalid_arg 66 - (Printf.sprintf "connect_retry_delay must be positive, got %.2f" 67 - connect_retry_delay); 58 + Fmt.invalid_arg "connect_retry_delay must be positive, got %.2f" 59 + connect_retry_delay; 68 60 69 61 { 70 62 max_connections_per_endpoint;
+2 -3
lib/endpoint.ml
··· 15 15 let v ~host ~port = 16 16 (* Validate port range *) 17 17 if port < 1 || port > 65535 then 18 - invalid_arg 19 - (Printf.sprintf "Invalid port number: %d (must be 1-65535)" port); 18 + Fmt.invalid_arg "Invalid port number: %d (must be 1-65535)" port; 20 19 21 20 (* Validate hostname is not empty *) 22 21 if String.trim host = "" then invalid_arg "Hostname cannot be empty"; ··· 27 26 let port t = t.port 28 27 let equal t1 t2 = String.equal t1.host t2.host && t1.port = t2.port 29 28 let hash t = Hashtbl.hash (t.host, t.port) 30 - let pp = Fmt.of_to_string (fun t -> Printf.sprintf "%s:%d" t.host t.port) 29 + let pp = Fmt.of_to_string (fun t -> Fmt.str "%s:%d" t.host t.port)