Skip to content

Commit

Permalink
[ereport] register bound server address
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Oct 17, 2024
1 parent c0bb7c6 commit 84bd6b4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ereporter/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ReporterRegistry {
) -> anyhow::Result<RunningServer> {
let log = &self.0.log;

let _server = {
let server = {
let dropshot_cfg = ConfigDropshot {
bind_address: config.server_address,
request_body_max_bytes: config.request_body_max_bytes,
Expand Down Expand Up @@ -117,9 +117,15 @@ impl ReporterRegistry {

self.0
.server_tx
.send(Some(State { server_address: config.server_address, nexus }))
.send(Some(State {
// Use the server's actual address once it has been bound,
// rather than the configured address, since the configured port
// may be :0.
server_address: server.local_addr(),
nexus,
}))
.expect("receivers should never be dropped");
Ok(RunningServer { _server })
Ok(RunningServer { _server: server })
}
}

Expand Down

0 comments on commit 84bd6b4

Please sign in to comment.