Address comments on workMu removal change.

Updates #231, #357

PiperOrigin-RevId: 301833669
This commit is contained in:
Bhasker Hariharan 2020-03-19 09:41:56 -07:00 committed by gVisor bot
parent e9e399c25d
commit fd27a917ef
2 changed files with 8 additions and 7 deletions

View File

@ -420,7 +420,7 @@ func (e *endpoint) handleSynSegment(ctx *listenContext, s *segment, opts *header
}
func (e *endpoint) incSynRcvdCount() bool {
if e.synRcvdCount >= (cap(e.acceptedChan)) {
if e.synRcvdCount >= cap(e.acceptedChan) {
return false
}
e.synRcvdCount++

View File

@ -2236,12 +2236,13 @@ func TestSegmentMerging(t *testing.T) {
c.CreateConnected(789, 30000, -1 /* epRcvBuf */)
// Send 10 1 byte segments to fill up InitialWindow but don't
// ACK. That should prevent anymore packets from going out.
for i := 0; i < 10; i++ {
// Send tcp.InitialCwnd number of segments to fill up
// InitialWindow but don't ACK. That should prevent
// anymore packets from going out.
for i := 0; i < tcp.InitialCwnd; i++ {
view := buffer.NewViewFromBytes([]byte{0})
if _, _, err := c.EP.Write(tcpip.SlicePayload(view), tcpip.WriteOptions{}); err != nil {
t.Fatalf("Write #%d failed: %v", i+1, err)
t.Fatalf("Write #%d failed: %s", i+1, err)
}
}
@ -2256,8 +2257,8 @@ func TestSegmentMerging(t *testing.T) {
}
}
// Check that we get 10 packets of 1 byte each.
for i := 0; i < 10; i++ {
// Check that we get tcp.InitialCwnd packets.
for i := 0; i < tcp.InitialCwnd; i++ {
b := c.GetPacket()
checker.IPv4(t, b,
checker.PayloadLen(header.TCPMinimumSize+1),