rename MaxReceivePacketSize to MaxPacketBufferSize

We use the same buffer size for sending and receiving packets.
This commit is contained in:
Marten Seemann
2021-01-25 16:46:35 +08:00
parent fb5a45ac53
commit 82ac6dcf6d
14 changed files with 26 additions and 26 deletions

View File

@@ -11,7 +11,7 @@ var pool sync.Pool
func init() {
pool.New = func() interface{} {
return &StreamFrame{
Data: make([]byte, 0, protocol.MaxReceivePacketSize),
Data: make([]byte, 0, protocol.MaxPacketBufferSize),
fromPool: true,
}
}
@@ -26,7 +26,7 @@ func putStreamFrame(f *StreamFrame) {
if !f.fromPool {
return
}
if protocol.ByteCount(cap(f.Data)) != protocol.MaxReceivePacketSize {
if protocol.ByteCount(cap(f.Data)) != protocol.MaxPacketBufferSize {
panic("wire.PutStreamFrame called with packet of wrong size!")
}
pool.Put(f)