fix truncation check: use == instead of >= for buffer-full detection
recv_from can never return more bytes than the buffer size — the kernel truncates silently. == is the correct heuristic for detecting truncation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ pub async fn forward_query(
|
||||
let mut recv_buffer = BytePacketBuffer::new();
|
||||
let (size, _) = timeout(timeout_duration, socket.recv_from(&mut recv_buffer.buf)).await??;
|
||||
|
||||
if size >= recv_buffer.buf.len() {
|
||||
if size == recv_buffer.buf.len() {
|
||||
log::debug!(
|
||||
"upstream response truncated ({} bytes, buffer {})",
|
||||
size,
|
||||
|
||||
Reference in New Issue
Block a user