code: func (h *handshake) processSegments() *tcpip.Error {
  	for i := 0; i < maxSegmentsPerWake; i++ {
  		s := h.ep.segmentQueue.dequeue()
  		if s == nil {
  			return nil
  		}
  
  		err := h.handleSegment(s)
  		s.decRef()
  		if err != nil {
  			return err
  		}
  
  		// We stop processing packets once the handshake is completed,
  		// otherwise we may process packets meant to be processed by
  		// the main protocol goroutine.
  		if h.state == handshakeCompleted {
  			break
  		}
  	}
  
  	// If the queue is not empty, make sure we'll wake up in the next
  	// iteration.
  	if !h.ep.segmentQueue.empty() {
  		h.ep.newSegmentWaker.Assert()
  	}
  
  	return nil
  }
docs: // processSegments goes through the segment queue and processes up to
  // maxSegmentsPerWake (if they're available).