@@ -38,7 +38,6 @@ type config =
38
38
single : bool ; (* * only process one request at a time (intended for preforked workers) *)
39
39
exit_thread : unit Lwt .t option ;
40
40
(* * if set, stop accepting connections as soon as exit_thread terminates (defaults to [Daemon.should_exit_lwt]) *)
41
- reuseport : bool ;
42
41
nodelay : bool ;
43
42
strict_args : bool ;
44
43
(* * default false, if enabled - will in particular fail on "/path?arg1&arg2", why would anyone want that? *)
@@ -71,7 +70,6 @@ let default =
71
70
yield = true ;
72
71
single = false ;
73
72
exit_thread = Some Daemon. should_exit_lwt;
74
- reuseport = false ;
75
73
nodelay = false ;
76
74
strict_args = false ;
77
75
max_time = default_max_time;
@@ -556,14 +554,13 @@ module Tcp = struct
556
554
557
555
open Unix
558
556
559
- let listen ~name ?(backlog =100 ) ?( reuseport = false ) addr =
557
+ let listen ~name ?(backlog =100 ) addr =
560
558
let domain = domain_of_sockaddr addr in
561
559
let fd = socket ~cloexec: true domain SOCK_STREAM 0 in
562
560
try
563
561
setsockopt fd SO_REUSEADDR true ;
564
- begin match domain, reuseport with
565
- | PF_UNIX , true -> log #warn " TCP.listen %s : reuseport doesn't make sense for unix socket, ignoring" (Nix. show_addr addr)
566
- | PF_INET , true -> U. setsockopt fd SO_REUSEPORT true
562
+ begin match domain with
563
+ | PF_INET -> U. setsockopt fd SO_REUSEPORT true
567
564
| _ -> ()
568
565
end ;
569
566
bind fd addr;
@@ -664,7 +661,7 @@ let reap_orphans srv =
664
661
in loop ()
665
662
666
663
let start_listen config =
667
- Tcp. listen ~name: config.name ~backlog: config.backlog ~reuseport: config.reuseport config.connection
664
+ Tcp. listen ~name: config.name ~backlog: config.backlog config.connection
668
665
669
666
let setup_server_fd fd config answer =
670
667
let server = make_server_state fd config in
0 commit comments