From b4e3e3f4e7ad32ec0270e1537c175a5a72f023d0 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Mon, 21 Jul 2025 23:23:26 -0500 Subject: [PATCH] clean up --- internal/udp/connection.go | 5 ----- internal/udp/packet.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/udp/connection.go b/internal/udp/connection.go index e58b395..892b14f 100644 --- a/internal/udp/connection.go +++ b/internal/udp/connection.go @@ -55,10 +55,6 @@ type Connection struct { // Connection timing lastPacketTime time.Time // Last received packet timestamp lastAckTime time.Time // Last acknowledgment timestamp - - // Flow control - sendWindow []bool // Sliding window for sent packets - windowStart uint16 // Start of the sliding window } // NewConnection creates a new connection instance with default settings @@ -76,7 +72,6 @@ func NewConnection(addr *net.UDPAddr, conn *net.UDPConn, handler PacketHandler) fragmentMgr: NewFragmentManager(MaxPacketSize), combiner: NewPacketCombiner(), outOfOrderMap: make(map[uint16]*ProtocolPacket), - sendWindow: make([]bool, DefaultWindowSize), } } diff --git a/internal/udp/packet.go b/internal/udp/packet.go index f22f43d..9d5b560 100644 --- a/internal/udp/packet.go +++ b/internal/udp/packet.go @@ -70,7 +70,7 @@ func (p *ProtocolPacket) Serialize() []byte { var result []byte // Handle variable opcode encoding - if p.Opcode >= 0xFF { + if p.Opcode == 0xFF { // 2-byte opcode format: [0x00][actual_opcode][data] result = make([]byte, 2+len(p.Data)) result[0] = 0x00