mirror of
https://github.com/YGGverse/yps.git
synced 2026-03-31 08:55:28 +00:00
remove extras
This commit is contained in:
parent
0ee8946b0a
commit
0aa60d6580
1 changed files with 5 additions and 5 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -63,7 +63,7 @@ fn crawl(
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
if config.debug {
|
if config.debug {
|
||||||
println!("get peers for `{k}`...");
|
println!("get peers for `{k}`...")
|
||||||
}
|
}
|
||||||
let p = ygg.remote_peers(&k)?;
|
let p = ygg.remote_peers(&k)?;
|
||||||
if p.status == "success" {
|
if p.status == "success" {
|
||||||
|
|
@ -79,7 +79,7 @@ fn crawl(
|
||||||
if TcpStream::connect_timeout(&address, Duration::from_secs(1)).is_ok() {
|
if TcpStream::connect_timeout(&address, Duration::from_secs(1)).is_ok() {
|
||||||
println!("\t{}: {url}", SUCCESS.green())
|
println!("\t{}: {url}", SUCCESS.green())
|
||||||
} else if config.debug {
|
} else if config.debug {
|
||||||
println!("\t{}: {url}", FAILURE.red());
|
println!("\t{}: {url}", FAILURE.red())
|
||||||
}
|
}
|
||||||
index.push(address)
|
index.push(address)
|
||||||
}
|
}
|
||||||
|
|
@ -87,9 +87,9 @@ fn crawl(
|
||||||
let url = format!("udp://{address}");
|
let url = format!("udp://{address}");
|
||||||
if !index.contains(&address) {
|
if !index.contains(&address) {
|
||||||
if server.check(address) {
|
if server.check(address) {
|
||||||
println!("\t{}: {url}", SUCCESS.green());
|
println!("\t{}: {url}", SUCCESS.green())
|
||||||
} else if config.debug {
|
} else if config.debug {
|
||||||
println!("\t{}: {url}", FAILURE.red());
|
println!("\t{}: {url}", FAILURE.red())
|
||||||
}
|
}
|
||||||
index.push(address)
|
index.push(address)
|
||||||
}
|
}
|
||||||
|
|
@ -97,7 +97,7 @@ fn crawl(
|
||||||
}
|
}
|
||||||
for k in peers.keys {
|
for k in peers.keys {
|
||||||
if let Some(l) = config.latency {
|
if let Some(l) = config.latency {
|
||||||
std::thread::sleep(Duration::from_secs(l));
|
std::thread::sleep(Duration::from_secs(l))
|
||||||
}
|
}
|
||||||
crawl(k, config, ygg, key, tcp, udp)?;
|
crawl(k, config, ygg, key, tcp, udp)?;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue