Skip to content

Commit

Permalink
fix: error messages starting UDP tracker
Browse files Browse the repository at this point in the history
String interpolation was not being doing well.
  • Loading branch information
josecelano committed Mar 19, 2024
1 parent 66f1635 commit 3a9c52f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/servers/udp/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl Launcher {

#[derive(Default)]
struct ActiveRequests {
rb: StaticRb<AbortHandle, 50>, // the number of requests we handle at the same time.
rb: StaticRb<AbortHandle, 1000>, // the number of requests we handle at the same time.
}

impl std::fmt::Debug for ActiveRequests {
Expand Down Expand Up @@ -241,8 +241,14 @@ impl Udp {
tx_start: oneshot::Sender<Started>,
rx_halt: oneshot::Receiver<Halted>,
) {
let socket = Arc::new(UdpSocket::bind(bind_to).await.expect("Could not bind to {self.socket}."));
let address = socket.local_addr().expect("Could not get local_addr from {binding}.");
let socket = Arc::new(
UdpSocket::bind(bind_to)
.await
.unwrap_or_else(|_| panic!("Could not bind to {bind_to}.")),
);
let address = socket
.local_addr()
.unwrap_or_else(|_| panic!("Could not get local_addr from {bind_to}."));
let halt = shutdown_signal_with_message(rx_halt, format!("Halting Http Service Bound to Socket: {address}"));

info!(target: "UDP TRACKER", "Starting on: udp://{}", address);
Expand Down

0 comments on commit 3a9c52f

Please sign in to comment.