Skip to content

Commit

Permalink
Lock the SSH transport pipe when producing our identification string.
Browse files Browse the repository at this point in the history
  • Loading branch information
caladri committed Dec 23, 2016
1 parent 98b19f5 commit 7fed4c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ssh/ssh_session.h
Expand Up @@ -72,6 +72,10 @@ namespace SSH {
{ }
};

/*
* XXX
* Is the Session adequately locked?
*/
struct Session {
Role role_;

Expand Down
2 changes: 2 additions & 0 deletions ssh/ssh_transport_pipe.cc
Expand Up @@ -64,6 +64,8 @@ SSH::TransportPipe::TransportPipe(Session *session)
Buffer identification_string("SSH-2.0-WANProxy " + (std::string)log_);
session_->local_version(identification_string);
identification_string.append("\r\n");

ScopedLock _(&mtx_);
produce(&identification_string);
}

Expand Down

0 comments on commit 7fed4c5

Please sign in to comment.