mirror of
https://github.com/YGGverse/yps.git
synced 2026-03-31 17:05:30 +00:00
use full var name
This commit is contained in:
parent
6c23a2c8e2
commit
c331e15fa2
1 changed files with 6 additions and 6 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -64,8 +64,8 @@ fn crawl(
|
|||
for (host, peers) in p.response.unwrap() {
|
||||
for port in &config.port {
|
||||
let address = SocketAddr::new(IpAddr::V6(host), *port);
|
||||
if let Some(i) = tcp {
|
||||
if !i.contains(&address) {
|
||||
if let Some(index) = tcp {
|
||||
if !index.contains(&address) {
|
||||
let url = format!("tcp://{address}");
|
||||
if TcpStream::connect_timeout(&address, Duration::from_secs(1)).is_ok()
|
||||
{
|
||||
|
|
@ -73,18 +73,18 @@ fn crawl(
|
|||
} else if config.debug {
|
||||
println!("\t{}: {url}", FAILURE.red());
|
||||
}
|
||||
i.push(address)
|
||||
index.push(address)
|
||||
}
|
||||
}
|
||||
if let Some((i, server)) = udp {
|
||||
if let Some((index, server)) = udp {
|
||||
let url = format!("udp://{address}");
|
||||
if !i.contains(&address) {
|
||||
if !index.contains(&address) {
|
||||
if server.check(address) {
|
||||
println!("\t{}: {url}", SUCCESS.green());
|
||||
} else if config.debug {
|
||||
println!("\t{}: {url}", FAILURE.red());
|
||||
}
|
||||
i.push(address)
|
||||
index.push(address)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue