42 |
open DonkeyOptions |
open DonkeyOptions |
43 |
open DonkeyComplexOptions |
open DonkeyComplexOptions |
44 |
open DonkeyGlobals |
open DonkeyGlobals |
45 |
|
open DonkeyUdp |
46 |
|
|
47 |
|
|
48 |
module Udp = DonkeyProtoUdp |
module Udp = DonkeyProtoUdp |
127 |
List.iter ( |
List.iter ( |
128 |
fun file -> |
fun file -> |
129 |
if !verbose_location then |
if !verbose_location then |
130 |
lprintf_nl () "TCP: Query Location of %s" |
lprintf_nl () "TCP: Query Location of %s [%s] [%Ld]" |
131 |
(file_best_name file); |
(file_best_name file) (Md4.to_string file.file_md4) (file_size file); |
132 |
let module M = DonkeyProtoServer in |
let module M = DonkeyProtoServer in |
133 |
server_send sock ( M.QueryLocationReq file.file_md4 ) |
let module E = M.QueryLocation in |
134 |
|
server_send sock ( M.QueryLocationReq { |
135 |
|
E.md4 = file.file_md4; |
136 |
|
E.size = file_size file; |
137 |
|
}); |
138 |
) (get_query_files server files_queries_per_minute); |
) (get_query_files server files_queries_per_minute); |
139 |
) |
) |
140 |
end |
end |
189 |
(* query "new servers" ie servers which understand multiple filerequests *) |
(* query "new servers" ie servers which understand multiple filerequests *) |
190 |
List.iter ( |
List.iter ( |
191 |
fun s -> |
fun s -> |
192 |
let md4s = List.map ( |
let l = List.map ( |
193 |
fun file -> |
fun file -> |
194 |
file.file_md4; |
(file.file_md4,(file_size file)); |
195 |
) (get_query_files s udp_requests_new) |
) (get_query_files s udp_requests_new) |
196 |
in |
in |
197 |
udp_server_send s (Udp.QueryLocationUdpReq md4s); |
udp_server_send_query_location s l; |
198 |
s.server_next_udp <- last_time () + udp_requests_wait; |
s.server_next_udp <- last_time () + udp_requests_wait; |
199 |
) !new_servers; |
) !new_servers; |
200 |
|
|