94 |
end |
end |
95 |
else |
else |
96 |
(* direct adsdess *) |
(* direct adsdess *) |
97 |
if Ip.valid ip && ip_reachable ip then |
if Ip.usable ip then |
98 |
if not ( is_black_address ip port ) then |
if not ( is_black_address ip port ) then |
99 |
if not ( Hashtbl.mem banned_ips ip) then |
if not ( Hashtbl.mem banned_ips ip) then |
100 |
Direct_address ( ip, port ) |
Direct_address ( ip, port ) |
764 |
|
|
765 |
(* TODO: check if we are connected to this server. If yes, issue a |
(* TODO: check if we are connected to this server. If yes, issue a |
766 |
query_id instead of a UDP packet *) |
query_id instead of a UDP packet *) |
767 |
if ip_reachable client_ip then |
if Ip.reachable client_ip then |
768 |
let module Q = DonkeyProtoUdp.QueryCallUdp in |
let module Q = DonkeyProtoUdp.QueryCallUdp in |
769 |
(* lprintf "Ask connection from indirect client\n"; *) |
(* lprintf "Ask connection from indirect client\n"; *) |
770 |
|
|
1932 |
| None -> |
| None -> |
1933 |
Invalid_address (!name, Md4.to_string t.CR.md4) |
Invalid_address (!name, Md4.to_string t.CR.md4) |
1934 |
| Some (ip,port) -> |
| Some (ip,port) -> |
1935 |
if Ip.valid ip && Ip.reachable ip then |
if Ip.usable ip then |
1936 |
Indirect_address (ip, port, id_of_ip t.CR.ip) |
Indirect_address (ip, port, id_of_ip t.CR.ip) |
1937 |
else |
else |
1938 |
Invalid_address (!name, Md4.to_string t.CR.md4) |
Invalid_address (!name, Md4.to_string t.CR.md4) |
1939 |
else |
else |
1940 |
if Ip.valid t.CR.ip && Ip.reachable t.CR.ip then |
if Ip.usable t.CR.ip then |
1941 |
Direct_address (t.CR.ip, t.CR.port) |
Direct_address (t.CR.ip, t.CR.port) |
1942 |
else |
else |
1943 |
Invalid_address (!name, Md4.to_string t.CR.md4) |
Invalid_address (!name, Md4.to_string t.CR.md4) |
2334 |
| Invalid_address _ -> () |
| Invalid_address _ -> () |
2335 |
| Indirect_address (ip, port, id) -> |
| Indirect_address (ip, port, id) -> |
2336 |
|
|
2337 |
if low_id ip && ip_reachable ip then |
if low_id ip && Ip.reachable ip then |
2338 |
query_id ip port id; |
query_id ip port id; |
2339 |
|
|
2340 |
|
|