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

@@ -241,7 +241,7 @@ func (p *QuicProxy) newConnection(cliAddr *net.UDPAddr) (*connection, error) {
// runProxy listens on the proxy address and handles incoming packets.
func (p *QuicProxy) runProxy() error {
for {
buffer := make([]byte, protocol.MaxReceivePacketSize)
buffer := make([]byte, protocol.MaxPacketBufferSize)
n, cliaddr, err := p.conn.ReadFromUDP(buffer)
if err != nil {
return err
@@ -294,7 +294,7 @@ func (p *QuicProxy) runOutgoingConnection(conn *connection) error {
outgoingPackets := make(chan packetEntry, 10)
go func() {
for {
buffer := make([]byte, protocol.MaxReceivePacketSize)
buffer := make([]byte, protocol.MaxPacketBufferSize)
n, err := conn.ServerConn.Read(buffer)
if err != nil {
return