Engaging Start Images
This repository was archived by the owner on May 20, 2020. It is now read-only.

A Great Blog Graphic

lower blepharoplasty procedure upper and lower blepharoplasty in

:
Exceed Brand Launch
Internal change.
PiperOrigin-RevId: 278979065
1 parent IBM Launch PPT Template commit 8ef4b51

Engaging Start Images 3 files changed Credit Limit Vs Cash Advance Limit

Lines changed: 67 additions & 1 deletion

New Product Launch Speech Example A Great Blog Graphic

tcpip/transport/tcp/endpoint.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,11 @@ func newEndpoint(s *stack.Stack, netProto tcpip.NetworkProtocolNumber, waiterQue
594594
e.rcvAutoParams.disabled = !bool(mrb)
595595
}
596596

597+
var de DelayEnabled
598+
if err := s.TransportProtocolOption(ProtocolNumber, &de); err == nil && de {
599+
e.SetSockOptInt(tcpip.DelayOption, 1)
600+
}
601+
597602
if p := s.GetTCPProbe(); p != nil {
598603
e.probe = p
599604
}

tcpip/transport/tcp/protocol.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ const (
6060
// protocol. See: https://tools.ietf.org/html/rfc2018.
6161
type SACKEnabled bool
6262

63+
// DelayEnabled option can be used to enable Nagle's algorithm in the TCP protocol.
64+
type DelayEnabled bool
65+
6366
// SendBufferSizeOption allows the default, min and max send buffer sizes for
6467
// TCP endpoints to be queried or configured.
6568
type SendBufferSizeOption struct {
@@ -84,6 +87,7 @@ const (
8487
type protocol struct {
8588
mu sync.Mutex
8689
sackEnabled bool
90+
delayEnabled bool
8791
sendBufferSize SendBufferSizeOption
8892
recvBufferSize ReceiveBufferSizeOption
8993
congestionControl string
@@ -97,7 +101,7 @@ func (*protocol) Number() tcpip.TransportProtocolNumber {
97101
}
98102

99103
// NewEndpoint creates a new tcp endpoint.
100-
func (*protocol) NewEndpoint(stack *stack.Stack, netProto tcpip.NetworkProtocolNumber, waiterQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error) {
104+
func (p *protocol) NewEndpoint(stack *stack.Stack, netProto tcpip.NetworkProtocolNumber, waiterQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error) {
101105
return newEndpoint(stack, netProto, waiterQueue), nil
102106
}
103107

@@ -165,6 +169,12 @@ func (p *protocol) SetOption(option interface{}) *tcpip.Error {
165169
p.mu.Unlock()
166170
return nil
167171

172+
case DelayEnabled:
173+
p.mu.Lock()
174+
p.delayEnabled = bool(v)
175+
p.mu.Unlock()
176+
return nil
177+
168178
case SendBufferSizeOption:
169179
if v.Min <= 0 || v.Default < v.Min || v.Default > v.Max {
170180
return tcpip.ErrInvalidOptionValue
@@ -216,6 +226,12 @@ func (p *protocol) Option(option interface{}) *tcpip.Error {
216226
p.mu.Unlock()
217227
return nil
218228

229+
case *DelayEnabled:
230+
p.mu.Lock()
231+
*v = DelayEnabled(p.delayEnabled)
232+
p.mu.Unlock()
233+
return nil
234+
219235
case *SendBufferSizeOption:
220236
p.mu.Lock()
221237
*v = p.sendBufferSize

tcpip/transport/tcp/tcp_test.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4848,3 +4848,48 @@ func TestReceiveBufferAutoTuning(t *testing.T) {
48484848
payloadSize *= 2
48494849
}
48504850
}
4851+
4852+
func TestDelayEnabled(t *testing.T) {
4853+
c := context.New(t, defaultMTU)
4854+
defer c.Cleanup()
4855+
checkDelayOption(t, c, false, 0) // Delay is disabled by default.
4856+
4857+
for _, v := range []struct {
4858+
delayEnabled tcp.DelayEnabled
4859+
wantDelayOption int
4860+
}{
4861+
{delayEnabled: false, wantDelayOption: 0},
4862+
{delayEnabled: true, wantDelayOption: 1},
4863+
} {
4864+
c := context.New(t, defaultMTU)
4865+
defer c.Cleanup()
4866+
if err := c.Stack().SetTransportProtocolOption(tcp.ProtocolNumber, v.delayEnabled); err != nil {
4867+
t.Fatalf("SetTransportProtocolOption(tcp, %t) failed: %v", v.delayEnabled, err)
4868+
}
4869+
checkDelayOption(t, c, v.delayEnabled, v.wantDelayOption)
4870+
}
4871+
}
4872+
4873+
func checkDelayOption(t *testing.T, c *context.Context, wantDelayEnabled tcp.DelayEnabled, wantDelayOption int) {
4874+
t.Helper()
4875+
4876+
var gotDelayEnabled tcp.DelayEnabled
4877+
if err := c.Stack().TransportProtocolOption(tcp.ProtocolNumber, &gotDelayEnabled); err != nil {
4878+
t.Fatalf("TransportProtocolOption(tcp, &gotDelayEnabled) failed: %v", err)
4879+
}
4880+
if gotDelayEnabled != wantDelayEnabled {
4881+
t.Errorf("TransportProtocolOption(tcp, &gotDelayEnabled) got %t, want %t", gotDelayEnabled, wantDelayEnabled)
4882+
}
4883+
4884+
ep, err := c.Stack().NewEndpoint(tcp.ProtocolNumber, ipv4.ProtocolNumber, new(waiter.Queue))
4885+
if err != nil {
4886+
t.Fatalf("NewEndPoint(tcp, ipv4, new(waiter.Queue)) failed: %v", err)
4887+
}
4888+
gotDelayOption, err := ep.GetSockOptInt(tcpip.DelayOption)
4889+
if err != nil {
4890+
t.Fatalf("ep.GetSockOptInt(tcpip.DelayOption) failed: %v", err)
4891+
}
4892+
if gotDelayOption != wantDelayOption {
4893+
t.Errorf("ep.GetSockOptInt(tcpip.DelayOption) got: %d, want: %d", gotDelayOption, wantDelayOption)
4894+
}
4895+
}

Post Ideas Through Image A Great Blog Graphic

Comments
 (0)