277 |
if not job.error then begin |
if not job.error then begin |
278 |
let ip = |
let ip = |
279 |
let list = Array.to_list job.entries in |
let list = Array.to_list job.entries in |
280 |
get_non_local_ip list |
get_non_local_ip list |
281 |
in |
in |
282 |
(* lprintf "Ip found for %s: %s\n" job.name (to_string ip); *) |
(* lprintf "Ip found for %s: %s\n" job.name (to_string ip); *) |
283 |
Hashtbl.add ip_cache job.name (ip, current_time +. 3600.); |
Hashtbl.add ip_cache job.name (ip, current_time +. 3600.); |
284 |
job.handler ip |
job.handler ip |
285 |
end else begin |
end else begin |
286 |
lprintf "Error: %s: address not found\n" job.name; |
lprintf "[NS]: lookup error: %s: address not found\n" job.name; |
287 |
|
raise Not_found |
288 |
end |
end |
289 |
end else raise Exit |
end else raise Exit |
290 |
done |
done |
291 |
) |
) |
292 |
|
|
293 |
|
|
294 |
type addr = |
type addr = |
295 |
AddrIp of t |
AddrIp of t |
296 |
| AddrName of string |
| AddrName of string |
297 |
|
|
298 |
let string_of_addr ip = |
let string_of_addr ip = |
299 |
match ip with |
match ip with |
300 |
AddrIp ip -> to_string ip |
AddrIp ip -> to_string ip |