21 |
|
|
22 |
open Printf2 |
open Printf2 |
23 |
open Md4 |
open Md4 |
24 |
|
open Ip_set |
25 |
|
|
26 |
open CommonSources |
open CommonSources |
27 |
open CommonDownloads |
open CommonDownloads |
2201 |
(* lprintf "[REMOTE CONN]\n"; *) |
(* lprintf "[REMOTE CONN]\n"; *) |
2202 |
match event with |
match event with |
2203 |
TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) -> |
TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) -> |
2204 |
|
let from_ip = (Ip.of_inet_addr from_ip) in |
2205 |
if can_open_indirect_connection () then |
if can_open_indirect_connection () && |
2206 |
|
(match Ip_set.match_ip !Ip_set.bl from_ip with |
2207 |
|
None -> true |
2208 |
|
| Some br -> |
2209 |
|
if !verbose_connect then |
2210 |
|
lprintf "DKOV: %s:%d blocked: %s\n" |
2211 |
|
(Ip.to_string from_ip) from_port br.blocking_description; |
2212 |
|
false) then |
2213 |
begin |
begin |
2214 |
(* lprintf "+++++++++++++++++++++++++++++++++++++++++++++++\n"; *) |
(* lprintf "+++++++++++++++++++++++++++++++++++++++++++++++\n"; *) |
2215 |
(try |
(try |
2222 |
(client_handler2 c) |
(client_handler2 c) |
2223 |
(*client_msg_to_string*) |
(*client_msg_to_string*) |
2224 |
in |
in |
2225 |
init_connection sock (Ip.of_inet_addr from_ip); |
init_connection sock from_ip; |
2226 |
accept_connection_bandwidth sock; |
accept_connection_bandwidth sock; |
2227 |
|
|
2228 |
(* Normal connections have 20 minutes to live (AvailableSlot, QueryBloc |
(* Normal connections have 20 minutes to live (AvailableSlot, QueryBloc |