func (s *sentPacket) markLost(now time.Time) *sentPacket {
	s.timeLost = now
	sp := newSentPacket(s.packetNumber, s.timeSent)
	sp.inFlight = s.inFlight
	sp.ackEliciting = s.ackEliciting
	sp.sentBytes = s.sentBytes
	sp.timeLost = s.timeLost
	sp.frames, s.frames = s.frames, sp.frames
	return sp
}
markLost marks this packet lost. It moves frames from the current sentPacket
to a clone that is returned.
package transport
import (
	"bytes"
	"fmt"
	"sync"
	"time"
)
const (
	packetThreshold = 3
	timeThreshold = 8
	granularity = 1 * time.Millisecond
	initialRTT = 333 * time.Millisecond
	persistentCongestionThreshold = 3
	maxProbes = 2
	maxAmplificationFactor = 3
	maxUint64 = ^uint64(0)
	maxUint   = ^uint(0)
)
type sentPacket struct {
	packetNumber uint64     
	frames       []frame    
	timeSent     time.Time  
	timeLost     time.Time  
	sentBytes    uint       
	ackEliciting bool
	inFlight bool
}
func newSentPacket(pn uint64, tm time.Time) *sentPacket {
	s := sentPacketPool.Get().(*sentPacket)
	s.packetNumber = pn
	s.timeSent = tm
	return s
}
func (s *sentPacket) addFrame(f frame) {
	s.frames = append(s.frames, f)
	if !s.ackEliciting {
		switch f.(type) {
		case *ackFrame, *connectionCloseFrame:
		case *paddingFrame:
			s.inFlight = true
		default:
			s.inFlight = true
			s.ackEliciting = true
		}
	}
}