Codechange: use std::deque of std::unique_ptr to queue packets

This commit is contained in:
Rubidium
2024-02-03 19:35:36 +01:00
committed by rubidium42
parent c77a45ed86
commit 36e1b32ccf
5 changed files with 32 additions and 99 deletions

View File

@@ -41,8 +41,6 @@ typedef uint8_t PacketType; ///< Identifier for the packet
*/
struct Packet {
private:
/** The next packet. Used for queueing packets before sending. */
Packet *next;
/** The current read/write position in the packet */
PacketSize pos;
/** The buffer of this packet. */
@@ -57,9 +55,6 @@ public:
Packet(NetworkSocketHandler *cs, size_t limit, size_t initial_read_size = sizeof(PacketSize));
Packet(PacketType type, size_t limit = COMPAT_MTU);
static void AddToQueue(Packet **queue, Packet *packet);
static Packet *PopFromQueue(Packet **queue);
/* Sending/writing of packets */
void PrepareToSend();