Skip to content

Commit 9c76f37

Browse files
committedJul 17, 2015
Display an access denied message when client detects a server timeout
1 parent 2c359da commit 9c76f37

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed
 

‎src/client.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -743,14 +743,19 @@ bool Client::loadMedia(const std::string &data, const std::string &filename)
743743
// Virtual methods from con::PeerHandler
744744
void Client::peerAdded(con::Peer *peer)
745745
{
746-
infostream<<"Client::peerAdded(): peer->id="
747-
<<peer->id<<std::endl;
746+
infostream << "Client::peerAdded(): peer->id="
747+
<< peer->id << std::endl;
748748
}
749749
void Client::deletingPeer(con::Peer *peer, bool timeout)
750750
{
751-
infostream<<"Client::deletingPeer(): "
751+
infostream << "Client::deletingPeer(): "
752752
"Server Peer is getting deleted "
753-
<<"(timeout="<<timeout<<")"<<std::endl;
753+
<< "(timeout=" << timeout << ")" << std::endl;
754+
755+
if (timeout) {
756+
m_access_denied = true;
757+
m_access_denied_reason = gettext("Connection timed out.");
758+
}
754759
}
755760

756761
/*

0 commit comments

Comments
 (0)
Please sign in to comment.