tersified connect/disconnect/refuse messages
This commit is contained in:
parent
b013ab7001
commit
a618abf463
10
sunbeam.rs
10
sunbeam.rs
|
@ -194,11 +194,11 @@ fn main() {
|
|||
},
|
||||
Ok((stream,address)) => {
|
||||
if blocklist.contains(&address.ip()) {
|
||||
println!("-x- refusing connection to {} on port {} (listed in {})",address,port,BLOCKFILE_NAME);
|
||||
println!("-x- refuse {}: {} (listed in {})",port,address,BLOCKFILE_NAME);
|
||||
} else if privacy == PortPrivacy::Whitelist && !address.ip().is_loopback() && !allowlist.contains(&address.ip()) {
|
||||
println!("-x- refusing connection to {} on port {} (not listed in {})",address,port,ALLOWFILE_NAME);
|
||||
println!("-x- refuse {}: {} (not listed in {})",port,address,ALLOWFILE_NAME);
|
||||
} else {
|
||||
println!("--> connection opened by {} on port {}",address,port);
|
||||
println!("--> connect {}: {}",port,address);
|
||||
stream.set_nonblocking(true).expect("cannot set stream to nonblocking");
|
||||
stream.set_nodelay(true).expect("cannot set stream to nodelay");
|
||||
connections.push_back((stream,address));
|
||||
|
@ -217,11 +217,11 @@ fn main() {
|
|||
connections.push_back((stream,address));
|
||||
},
|
||||
_ => {
|
||||
println!("<-- closing connection to {} on port {}: {}",address,port,why);
|
||||
println!("<-- disconnect {}: {} ({})",port,address,why);
|
||||
},
|
||||
},
|
||||
Ok(_) => {
|
||||
println!("<-- closing connection to {} on port {}: end of stream",address,port);
|
||||
println!("<-- disconnect {}: {} (closed by remote endpoint)",port,address);
|
||||
},
|
||||
};
|
||||
if bottle.len() > 0 {
|
||||
|
|
Loading…
Reference in New Issue