Fix bug that could cause the server to crash when an old client connected

This commit is contained in:
A.J. Beamon 2021-04-27 11:15:16 -07:00
parent 823873a9aa
commit 9009780aa8
1 changed files with 4 additions and 1 deletions

View File

@ -1215,9 +1215,12 @@ ACTOR static Future<Void> connectionReader(TransportData* transport,
}
compatible = false;
if (!protocolVersion.hasInexpensiveMultiVersionClient()) {
if(peer) {
peer->protocolVersion->set(protocolVersion);
}
// Older versions expected us to hang up. It may work even if we don't hang up here, but
// it's safer to keep the old behavior.
peer->protocolVersion->set(protocolVersion);
throw incompatible_protocol_version();
}
} else {