mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
add a control packet type for LightACK
This commit is contained in:
parent
28d9610bd4
commit
cf98d4a8f7
2 changed files with 7 additions and 6 deletions
|
@ -237,7 +237,7 @@ void Connection::sendLightACK() {
|
|||
|
||||
// create the light ACK packet, make it static so we can re-use it
|
||||
static const int LIGHT_ACK_PACKET_PAYLOAD_BYTES = sizeof(SequenceNumber);
|
||||
static auto lightACKPacket = ControlPacket::create(ControlPacket::ACK, LIGHT_ACK_PACKET_PAYLOAD_BYTES);
|
||||
static auto lightACKPacket = ControlPacket::create(ControlPacket::LightACK, LIGHT_ACK_PACKET_PAYLOAD_BYTES);
|
||||
|
||||
// reset the lightACKPacket before we go to write the ACK to it
|
||||
lightACKPacket->reset();
|
||||
|
@ -407,13 +407,13 @@ void Connection::processControl(std::unique_ptr<ControlPacket> controlPacket) {
|
|||
switch (controlPacket->getType()) {
|
||||
case ControlPacket::ACK:
|
||||
if (_hasReceivedHandshakeACK) {
|
||||
if (controlPacket->getPayloadSize() == sizeof(SequenceNumber)) {
|
||||
processLightACK(move(controlPacket));
|
||||
} else {
|
||||
processACK(move(controlPacket));
|
||||
}
|
||||
processACK(move(controlPacket));
|
||||
}
|
||||
break;
|
||||
case ControlPacket::LightACK:
|
||||
if (_hasReceivedHandshakeACK) {
|
||||
processLightACK(move(controlPacket));
|
||||
}
|
||||
case ControlPacket::ACK2:
|
||||
if (_hasReceivedHandshake) {
|
||||
processACK2(move(controlPacket));
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
enum Type : uint16_t {
|
||||
ACK,
|
||||
ACK2,
|
||||
LightACK,
|
||||
NAK,
|
||||
TimeoutNAK,
|
||||
Handshake,
|
||||
|
|
Loading…
Reference in a new issue