mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Ignores KeepAlive messages during initial handshakes (#128)
Shouldn't happen normally, but could happen if handshakes take a longer then normal period of time. Closes #126
This commit is contained in:
committed by
Peter Johnson
parent
b775b01e0a
commit
780e9580b7
@@ -403,6 +403,11 @@ bool DispatcherBase::ClientHandshake(
|
||||
DEBUG4("received init str=" << msg->str() << " id=" << msg->id()
|
||||
<< " seq_num=" << msg->seq_num_uid());
|
||||
if (msg->Is(Message::kServerHelloDone)) break;
|
||||
// shouldn't receive a keep alive, but handle gracefully
|
||||
if (msg->Is(Message::kKeepAlive)) {
|
||||
msg = get_msg();
|
||||
continue;
|
||||
}
|
||||
if (!msg->Is(Message::kEntryAssign)) {
|
||||
// unexpected message
|
||||
DEBUG("client: received message (" << msg->type() << ") other than entry assignment during initial handshake");
|
||||
@@ -491,6 +496,11 @@ bool DispatcherBase::ServerHandshake(
|
||||
return false;
|
||||
}
|
||||
if (msg->Is(Message::kClientHelloDone)) break;
|
||||
// shouldn't receive a keep alive, but handle gracefully
|
||||
if (msg->Is(Message::kKeepAlive)) {
|
||||
msg = get_msg();
|
||||
continue;
|
||||
}
|
||||
if (!msg->Is(Message::kEntryAssign)) {
|
||||
// unexpected message
|
||||
DEBUG("server: received message ("
|
||||
|
||||
Reference in New Issue
Block a user