mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 14:41:57 +08:00
server now rejects clients that are not in the configuration.
added a protocol message to indicate this.
This commit is contained in:
@@ -294,6 +294,10 @@ void CClient::runSession(void*)
|
||||
onErrorBusy();
|
||||
break;
|
||||
}
|
||||
else if (memcmp(code, kMsgEUnknown, 4) == 0) {
|
||||
onErrorUnknown();
|
||||
break;
|
||||
}
|
||||
else if (memcmp(code, kMsgEBad, 4) == 0) {
|
||||
onErrorBad();
|
||||
break;
|
||||
@@ -606,6 +610,11 @@ void CClient::onErrorBusy()
|
||||
log((CLOG_ERR "server already has a connected client with name \"%s\"", m_name.c_str()));
|
||||
}
|
||||
|
||||
void CClient::onErrorUnknown()
|
||||
{
|
||||
log((CLOG_ERR "server refused client with name \"%s\"", m_name.c_str()));
|
||||
}
|
||||
|
||||
void CClient::onErrorBad()
|
||||
{
|
||||
log((CLOG_ERR "server disconnected due to a protocol error"));
|
||||
|
||||
Reference in New Issue
Block a user