pass the time a packet was received to the short header opener

This saves us one time.Now() syscall per received 1-RTT packet.
This commit is contained in:
Marten Seemann 2019-08-11 13:33:02 +07:00
parent ee00cbe088
commit bb48c9b31a
9 changed files with 92 additions and 80 deletions

View file

@ -4,6 +4,7 @@ import (
"crypto/tls"
"errors"
"io"
"time"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/marten-seemann/qtls"
@ -34,7 +35,7 @@ type LongHeaderOpener interface {
// ShortHeaderOpener opens a short header packet
type ShortHeaderOpener interface {
headerDecryptor
Open(dst, src []byte, pn protocol.PacketNumber, kp protocol.KeyPhaseBit, associatedData []byte) ([]byte, error)
Open(dst, src []byte, rcvTime time.Time, pn protocol.PacketNumber, kp protocol.KeyPhaseBit, associatedData []byte) ([]byte, error)
}
// LongHeaderSealer seals a long header packet