throw errors about writing buffers >8192;

pull/121/merge
Bryan Biedenkapp 3 weeks ago
parent 36ab54e120
commit ae93c4cb27

@ -157,7 +157,12 @@ bool FrameQueue::write(const uint8_t* message, uint32_t length, uint32_t streamI
// bryanb: this is really a developer warning not a end-user warning, there's nothing the end-users can do about
// this message
if (bufferLen > (DATA_PACKET_LENGTH - OVERSIZED_PACKET_WARN)) {
LogWarning(LOG_NET, "FrameQueue::enqueueMessage(), WARN: packet length is possibly oversized, possible data truncation - BUGBUG, peerId = %u, func = $%02X, subfunc = $%02X, address = %s, port = %u, bufferLen = %u",
LogWarning(LOG_NET, "FrameQueue::write(), WARN: packet length is possibly oversized, possible data truncation - BUGBUG, peerId = %u, func = $%02X, subfunc = $%02X, address = %s, port = %u, bufferLen = %u",
peerId, opcode.first, opcode.second, udp::Socket::address(addr).c_str(), udp::Socket::port(addr), bufferLen);
}
if (bufferLen > DATA_PACKET_LENGTH) {
LogError(LOG_NET, "FrameQueue::write(), packet length is oversized, data truncation - BUGBUG, peerId = %u, func = $%02X, subfunc = $%02X, address = %s, port = %u, bufferLen = %u",
peerId, opcode.first, opcode.second, udp::Socket::address(addr).c_str(), udp::Socket::port(addr), bufferLen);
}
@ -207,6 +212,11 @@ void FrameQueue::enqueueMessage(udp::BufferQueue* queue, const uint8_t* message,
peerId, opcode.first, opcode.second, udp::Socket::address(addr).c_str(), udp::Socket::port(addr), bufferLen);
}
if (bufferLen > DATA_PACKET_LENGTH) {
LogError(LOG_NET, "FrameQueue::enqueueMessage(), packet length is oversized, data truncation - BUGBUG, peerId = %u, func = $%02X, subfunc = $%02X, address = %s, port = %u, bufferLen = %u",
peerId, opcode.first, opcode.second, udp::Socket::address(addr).c_str(), udp::Socket::port(addr), bufferLen);
}
udp::UDPDatagram *dgram = new udp::UDPDatagram;
dgram->buffer = buffer;
dgram->length = bufferLen;

Loading…
Cancel
Save

Powered by TurnKey Linux.