mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:29:40 +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
|
// 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 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
|
// reset the lightACKPacket before we go to write the ACK to it
|
||||||
lightACKPacket->reset();
|
lightACKPacket->reset();
|
||||||
|
@ -407,13 +407,13 @@ void Connection::processControl(std::unique_ptr<ControlPacket> controlPacket) {
|
||||||
switch (controlPacket->getType()) {
|
switch (controlPacket->getType()) {
|
||||||
case ControlPacket::ACK:
|
case ControlPacket::ACK:
|
||||||
if (_hasReceivedHandshakeACK) {
|
if (_hasReceivedHandshakeACK) {
|
||||||
if (controlPacket->getPayloadSize() == sizeof(SequenceNumber)) {
|
processACK(move(controlPacket));
|
||||||
processLightACK(move(controlPacket));
|
|
||||||
} else {
|
|
||||||
processACK(move(controlPacket));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ControlPacket::LightACK:
|
||||||
|
if (_hasReceivedHandshakeACK) {
|
||||||
|
processLightACK(move(controlPacket));
|
||||||
|
}
|
||||||
case ControlPacket::ACK2:
|
case ControlPacket::ACK2:
|
||||||
if (_hasReceivedHandshake) {
|
if (_hasReceivedHandshake) {
|
||||||
processACK2(move(controlPacket));
|
processACK2(move(controlPacket));
|
||||||
|
|
|
@ -29,6 +29,7 @@ public:
|
||||||
enum Type : uint16_t {
|
enum Type : uint16_t {
|
||||||
ACK,
|
ACK,
|
||||||
ACK2,
|
ACK2,
|
||||||
|
LightACK,
|
||||||
NAK,
|
NAK,
|
||||||
TimeoutNAK,
|
TimeoutNAK,
|
||||||
Handshake,
|
Handshake,
|
||||||
|
|
Loading…
Reference in a new issue