Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Fixed deadlock in external_url (#4354)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkpar authored and gavofyork committed Jan 30, 2017
1 parent 15ffd9a commit 43cc4ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util/network/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,13 @@ impl Host {
}

pub fn external_url(&self) -> Option<String> {
self.info.read().public_endpoint.as_ref().map(|e| format!("{}", Node::new(self.info.read().id().clone(), e.clone())))
let info = self.info.read();
info.public_endpoint.as_ref().map(|e| format!("{}", Node::new(info.id().clone(), e.clone())))
}

pub fn local_url(&self) -> String {
let r = format!("{}", Node::new(self.info.read().id().clone(), self.info.read().local_endpoint.clone()));
println!("{}", r);
r
let info = self.info.read();
format!("{}", Node::new(info.id().clone(), info.local_endpoint.clone()))
}

pub fn stop(&self, io: &IoContext<NetworkIoMessage>) -> Result<(), NetworkError> {
Expand Down

0 comments on commit 43cc4ea

Please sign in to comment.