rename ReadVarint / WriteVarInt / VarIntLen to Read / Write / Len

This commit is contained in:
Marten Seemann 2021-01-01 11:40:53 +08:00
parent 11c5045065
commit f9226887b4
46 changed files with 298 additions and 298 deletions

View file

@ -406,8 +406,8 @@ func (h *cryptoSetup) handleTransportParameters(data []byte) {
// must be called after receiving the transport parameters
func (h *cryptoSetup) marshalDataForSessionState() []byte {
buf := &bytes.Buffer{}
quicvarint.WriteVarInt(buf, clientSessionStateRevision)
quicvarint.WriteVarInt(buf, uint64(h.rttStats.SmoothedRTT().Microseconds()))
quicvarint.Write(buf, clientSessionStateRevision)
quicvarint.Write(buf, uint64(h.rttStats.SmoothedRTT().Microseconds()))
h.peerParams.MarshalForSessionTicket(buf)
return buf.Bytes()
}
@ -423,14 +423,14 @@ func (h *cryptoSetup) handleDataFromSessionState(data []byte) {
func (h *cryptoSetup) handleDataFromSessionStateImpl(data []byte) (*wire.TransportParameters, error) {
r := bytes.NewReader(data)
ver, err := quicvarint.ReadVarInt(r)
ver, err := quicvarint.Read(r)
if err != nil {
return nil, err
}
if ver != clientSessionStateRevision {
return nil, fmt.Errorf("mismatching version. Got %d, expected %d", ver, clientSessionStateRevision)
}
rtt, err := quicvarint.ReadVarInt(r)
rtt, err := quicvarint.Read(r)
if err != nil {
return nil, err
}