mirror of
https://github.com/soypat/lneto.git
synced 2026-09-09 08:19:09 +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
|
var ok bool
|
||||||
available := min(buffered, len(b)-sizeHeaderTCP)
|
available := min(buffered, len(b)-sizeHeaderTCP)
|
||||||
segment, ok = h.scb.PendingSegment(available)
|
segment, ok = h.scb.PendingSegment(available)
|
||||||
|
segment.WND = Size(h.bufRx.Free())
|
||||||
if !ok {
|
if !ok {
|
||||||
// No pending control segment or data to send. Yield.
|
// No pending control segment or data to send. Yield.
|
||||||
return 0, nil
|
return 0, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user