mirror of
https://github.com/soypat/lneto.git
synced 2026-08-13 03:13:43 +00:00
TCP: advertising the currently available window size (#35)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user