TCP/TLS connection pooling for Eio
0
fork

Configure Feed

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

conpool: drop unused [endpoint] parameter from wait_for_*_slot

Warning 27. [wait_for_shared_slot], [wait_for_exclusive_slot], and
[wait_for_available_slot] all took an [endpoint] they never used —
they operate on the [ep_pool] which is already indexed by endpoint at
the call site. Simplifying the internal calling convention; the
public API is unchanged.

+6 -6
+6 -6
lib/conpool.ml
··· 394 394 pool.protocol.on_acquire conn.pc_state; 395 395 conn 396 396 397 - let wait_for_shared_slot pool ep_pool conn endpoint = 397 + let wait_for_shared_slot pool ep_pool conn = 398 398 while 399 399 (conn.pc_active_users 400 400 >= ··· 408 408 if conn.pc_closed then None 409 409 else Some (activate_reused pool ep_pool conn ~was_idle:false) 410 410 411 - let wait_for_exclusive_slot pool ep_pool conn endpoint = 411 + let wait_for_exclusive_slot pool ep_pool conn = 412 412 while conn.pc_active_users > 0 && not conn.pc_closed do 413 413 Eio.Condition.await_no_mutex conn.pc_user_available 414 414 done; ··· 428 428 pool.protocol.on_acquire conn.pc_state; 429 429 conn 430 430 431 - let wait_for_available_slot pool ep_pool endpoint = 431 + let wait_for_available_slot pool ep_pool = 432 432 let wait_conn = 433 433 List.find_opt 434 434 (fun c -> ··· 438 438 !(ep_pool.connections) 439 439 in 440 440 match wait_conn with 441 - | Some conn -> wait_for_shared_slot pool ep_pool conn endpoint 441 + | Some conn -> wait_for_shared_slot pool ep_pool conn 442 442 | None -> 443 443 let any_conn = List.hd !(ep_pool.connections) in 444 - wait_for_exclusive_slot pool ep_pool any_conn endpoint 444 + wait_for_exclusive_slot pool ep_pool any_conn 445 445 446 446 let rec acquire_connection pool ep_pool endpoint = 447 447 Eio.Mutex.use_rw ~protect:true ep_pool.ep_mutex (fun () -> ··· 480 480 Log.debug (fun m -> 481 481 m "At connection limit for %a (%d), waiting..." Endpoint.pp 482 482 endpoint max_conns); 483 - match wait_for_available_slot pool ep_pool endpoint with 483 + match wait_for_available_slot pool ep_pool with 484 484 | Some conn -> conn 485 485 | None -> acquire_connection pool ep_pool endpoint 486 486 end