Skip to content

Commit 530187f

Browse files
committed
fix: error messages starting UDP tracker
String interpolation was not being doing well.
1 parent 18b46df commit 530187f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/servers/udp/server.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl Launcher {
203203

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

209209
impl std::fmt::Debug for ActiveRequests {
@@ -241,8 +241,14 @@ impl Udp {
241241
tx_start: oneshot::Sender<Started>,
242242
rx_halt: oneshot::Receiver<Halted>,
243243
) {
244-
let socket = Arc::new(UdpSocket::bind(bind_to).await.expect("Could not bind to {self.socket}."));
245-
let address = socket.local_addr().expect("Could not get local_addr from {binding}.");
244+
let socket = Arc::new(
245+
UdpSocket::bind(bind_to)
246+
.await
247+
.unwrap_or_else(|_| panic!("Could not bind to {bind_to}.")),
248+
);
249+
let address = socket
250+
.local_addr()
251+
.unwrap_or_else(|_| panic!("Could not get local_addr from {bind_to}."));
246252
let halt = shutdown_signal_with_message(rx_halt, format!("Halting Http Service Bound to Socket: {address}"));
247253

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

0 commit comments

Comments
 (0)