TCP: advertising the currently available window size (#35)

This commit is contained in:
ddirect
2026-02-09 02:24:24 +02:00
committed by GitHub
parent 199d978c99
commit 085c7033cd
+1
View File
@@ -255,6 +255,7 @@ func (h *Handler) Send(b []byte) (int, error) {
var ok bool
available := min(buffered, len(b)-sizeHeaderTCP)
segment, ok = h.scb.PendingSegment(available)
segment.WND = Size(h.bufRx.Free())
if !ok {
// No pending control segment or data to send. Yield.
return 0, nil