Skip to content

Commit

Permalink
Merge torrust#741: Fix error messages starting UDP tracker
Browse files Browse the repository at this point in the history
3a9c52f fix: error messages starting UDP tracker (Jose Celano)

Pull request description:

  String interpolation was not being doing well.

ACKs for top commit:
  josecelano:
    ACK 3a9c52f

Tree-SHA512: 137968f4b71ce53fa80afd29c4d305b22fbe8f419544ca0d77a0867f506455f05cf12101fc154688116c8cb969b8a3fe605ab89650113ba1741d68ffe51264f8
  • Loading branch information
josecelano committed Mar 19, 2024
2 parents 66f1635 + 3a9c52f commit 3e6e8b7
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 3e6e8b7

Please sign in to comment.