File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -1088,17 +1088,22 @@ let run (self:t) : (unit,_) result =
1088
1088
while self.running do
1089
1089
(* limit concurrency *)
1090
1090
Sem_. acquire 1 self.sem_max_connections;
1091
- let client_sock, _ = Unix. accept sock in
1092
- self.new_thread
1093
- (fun () ->
1094
- try
1095
- handle_client_ self client_sock;
1096
- Sem_. release 1 self.sem_max_connections;
1097
- with e ->
1098
- (try Unix. close client_sock with _ -> () );
1099
- Sem_. release 1 self.sem_max_connections;
1100
- raise e
1101
- );
1091
+ try
1092
+ let client_sock, _ = Unix. accept sock in
1093
+ self.new_thread
1094
+ (fun () ->
1095
+ try
1096
+ handle_client_ self client_sock;
1097
+ Sem_. release 1 self.sem_max_connections;
1098
+ with e ->
1099
+ (try Unix. close client_sock with _ -> () );
1100
+ Sem_. release 1 self.sem_max_connections;
1101
+ raise e
1102
+ );
1103
+ with e ->
1104
+ _debug (fun k -> k
1105
+ " Unix.accept or Thread.create raised an exception: %s"
1106
+ (Printexc. to_string e))
1102
1107
done ;
1103
1108
Ok ()
1104
1109
with e -> Error e
You can’t perform that action at this time.
0 commit comments