315 |
(log_time ()) |
(log_time ()) |
316 |
(if Proto.redirector_section = "DKKO" then "Overnet" else "Kademlia"); lprintf_nl2 |
(if Proto.redirector_section = "DKKO" then "Overnet" else "Kademlia"); lprintf_nl2 |
317 |
|
|
318 |
let lprintf () = |
let lprintf_n () = |
319 |
lprintf "[%s] " |
lprintf "[%s] " |
320 |
(if Proto.redirector_section = "DKKO" then "Overnet" else "Kademlia"); lprintf |
(if Proto.redirector_section = "DKKO" then "Overnet" else "Kademlia"); lprintf |
321 |
|
|
1605 |
in |
in |
1606 |
List.iter (fun url -> |
List.iter (fun url -> |
1607 |
Printf.bprintf o.conn_buf "Loading %s\n" url; |
Printf.bprintf o.conn_buf "Loading %s\n" url; |
1608 |
CommonWeb.load_url web_info url) urls; |
CommonWeb.load_url true web_info url) urls; |
1609 |
"web boot started" |
"web boot started" |
1610 |
), "<urls> :\t\t\t\tdownload .ocl URLS (no arg load default)"; |
), "<urls> :\t\t\t\tdownload .ocl URLS (no arg load default)"; |
1611 |
|
|
1812 |
let port = String2.replace port '"' "" in |
let port = String2.replace port '"' "" in |
1813 |
Ip.async_ip name (fun ip -> |
Ip.async_ip name (fun ip -> |
1814 |
let port = int_of_string port in |
let port = int_of_string port in |
1815 |
if !verbose_overnet then begin |
if !verbose_overnet then |
1816 |
lprintf_nl () "Adding %s peer %s:%d" command_prefix_to_net name port; |
lprintf_nl () "Adding %s peer %s:%d" command_prefix_to_net name port; |
|
end; |
|
1817 |
bootstrap ip port) |
bootstrap ip port) |
1818 |
| _ -> |
| _ -> lprintf_nl () "BAD LINE ocl: %s" s; |
1819 |
lprintf_nl () "BAD LINE ocl: %s" s; |
with _ -> lprintf_nl () "DNS failed"; |
|
with _ -> |
|
|
begin |
|
|
lprintf_nl () "DNS failed"; |
|
|
end |
|
1820 |
) lines |
) lines |
1821 |
); |
); |
1822 |
|
|
1823 |
(* Add this kind of web_info only for overnet (Edonkey |
(* Add this kind of web_info only for overnet *) |
1824 |
Kademlia has web_info = "kad"). *) |
if Proto.redirector_section = "DKKO" then |
1825 |
if web_info = "contact.dat" then begin |
CommonWeb.add_web_kind "contact.dat" (fun url filename -> |
1826 |
if !!enable_overnet && !!overnet_update_nodes then |
if !!enable_overnet && !!overnet_update_nodes then |
|
CommonWeb.add_web_kind "contact.dat" (fun _ filename -> |
|
|
if !verbose_overnet then |
|
|
lprintf_nl () "LOADED contact.dat"; |
|
1827 |
let n = load_contact_dat filename in |
let n = load_contact_dat filename in |
1828 |
if !verbose_overnet then |
lprintf_nl () "contact.dat loaded from %s, added %d peers" url n; |
1829 |
lprintf_nl () "%d PEERS ADDED" n; |
else |
1830 |
|
if not !!enable_overnet then |
1831 |
|
lprintf_nl () "Overnet module is disabled, ignoring..." |
1832 |
|
else |
1833 |
|
lprintf_nl () "Overnet_update_nodes is disabled, ignoring..." |
1834 |
); |
); |
|
end; |
|
1835 |
|
|
1836 |
(************************************************************* |
(************************************************************* |
1837 |
|
|