chore: code style
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -81,7 +81,7 @@ fn forward(bind_addr: &str, local_port: u16, remote_host: &str, remote_port: u16
|
|||||||
let client_id = format!("{}", src_addr);
|
let client_id = format!("{}", src_addr);
|
||||||
|
|
||||||
if remove_existing {
|
if remove_existing {
|
||||||
debugging!("Removing existing forwarder from map.");
|
debugging!("Removing existing forwarder from map: {}", client_id);
|
||||||
client_map.remove(&client_id);
|
client_map.remove(&client_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ fn forward(bind_addr: &str, local_port: u16, remote_host: &str, remote_port: u16
|
|||||||
|_| panic!("Failed to clone client-specific connection to upstream!")
|
|_| panic!("Failed to clone client-specific connection to upstream!")
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut timeouts : u64 = 0;
|
let mut timeouts: u64 = 0;
|
||||||
let timed_out = Arc::new(AtomicBool::new(false));
|
let timed_out = Arc::new(AtomicBool::new(false));
|
||||||
|
|
||||||
let local_timed_out = timed_out.clone();
|
let local_timed_out = timed_out.clone();
|
||||||
@@ -123,7 +123,7 @@ fn forward(bind_addr: &str, local_port: u16, remote_host: &str, remote_port: u16
|
|||||||
debugging!("Terminating forwarder thread for client {} due to timeout", src_addr);
|
debugging!("Terminating forwarder thread for client {} due to timeout", src_addr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -143,7 +143,7 @@ fn forward(bind_addr: &str, local_port: u16, remote_host: &str, remote_port: u16
|
|||||||
timed_out.store(true, Ordering::Relaxed);
|
timed_out.store(true, Ordering::Relaxed);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -161,7 +161,7 @@ fn forward(bind_addr: &str, local_port: u16, remote_host: &str, remote_port: u16
|
|||||||
debugging!("New connection received from previously timed-out client {}", client_id);
|
debugging!("New connection received from previously timed-out client {}", client_id);
|
||||||
remove_existing = true;
|
remove_existing = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user