Skip to content

Commit 2a8baea

Browse files
committed
quic: don't record fin bit as sent when it wasn't
When appendStreamFrame is provided with the last chunk of data for a stream, doesn't have enough space in the packet to include all the data, don't incorrectly record the packet as including a FIN bit. We were correctly sending a STREAM frame with no FIN bit--it's just the sent packet accounting that was off. No test, because I can't figure out a scenario where this actually has an observable effect, since we're always going to send the FIN when the remaining stream data is sent. Change-Id: I0ee81273165fcf10a52da76b33d2bf1b9c4f3523 Reviewed-on: https://go-review.googlesource.com/c/net/+/564796 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]>
1 parent 5e09712 commit 2a8baea

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

internal/quic/packet_writer.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,7 @@ func (w *packetWriter) appendStreamFrame(id streamID, off int64, size int, fin b
388388
w.b = appendVarint(w.b, uint64(size))
389389
start := len(w.b)
390390
w.b = w.b[:start+size]
391-
if fin {
392-
w.sent.appendAckElicitingFrame(frameTypeStreamBase | streamFinBit)
393-
} else {
394-
w.sent.appendAckElicitingFrame(frameTypeStreamBase)
395-
}
391+
w.sent.appendAckElicitingFrame(typ & (frameTypeStreamBase | streamFinBit))
396392
w.sent.appendInt(uint64(id))
397393
w.sent.appendOffAndSize(off, size)
398394
return w.b[start:][:size], true

0 commit comments

Comments
 (0)