Fetch: fix FetchStream logic

This commit is contained in:
Andrew Kelley 2025-08-07 19:53:29 -07:00
parent 8721efece4
commit 8da645c883

View file

@ -1114,8 +1114,8 @@ pub const Session = struct {
}
const buf = limit.slice(try w.writableSliceGreedy(1));
const n = @min(buf.len, fs.remaining_len);
@memcpy(buf[0..n], input.buffered()[0..n]);
input.toss(n);
try input.readSliceAll(buf[0..n]);
w.advance(n);
fs.remaining_len -= n;
return n;
}