Fix bug that could cause the server to crash when an old client connected
This commit is contained in:
parent
823873a9aa
commit
9009780aa8
|
@ -1215,9 +1215,12 @@ ACTOR static Future<Void> connectionReader(TransportData* transport,
|
||||||
}
|
}
|
||||||
compatible = false;
|
compatible = false;
|
||||||
if (!protocolVersion.hasInexpensiveMultiVersionClient()) {
|
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
|
// 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.
|
// it's safer to keep the old behavior.
|
||||||
peer->protocolVersion->set(protocolVersion);
|
|
||||||
throw incompatible_protocol_version();
|
throw incompatible_protocol_version();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue