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

Commit

Permalink
Merge pull request #377 from ethcore/net
Browse files Browse the repository at this point in the history
beta: Check for handshake expiration before attempting replace
  • Loading branch information
Gav Wood committed Feb 8, 2016
2 parents 4076c41 + 2cf7734 commit ac218dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ branches:
- master
- /^beta-.*$/
- /^stable-.*$/
- /^beta$/
- /^stable$/
matrix:
fast_finish: true
include:
Expand Down
3 changes: 3 additions & 0 deletions util/src/network/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {

fn start_session(&self, token: StreamToken, io: &IoContext<NetworkIoMessage<Message>>) {
let mut connections = self.connections.write().unwrap();
if connections.get(token).is_none() {
return; // handshake expired
}
connections.replace_with(token, |c| {
match Arc::try_unwrap(c).ok().unwrap().into_inner().unwrap() {
ConnectionEntry::Handshake(h) => {
Expand Down

0 comments on commit ac218dc

Please sign in to comment.