Skip to content

Commit

Permalink
add env to disable the receive buffer warning (#3339)
Browse files Browse the repository at this point in the history
If the env QUIC_GO_DISABLE_RECEIVE_BUFFER_WARNING is set to true
(as defined by strconv.ParseBool()), the receive buffer warning
will not be printed out.
  • Loading branch information
arashpayan committed Mar 7, 2022
1 parent 17952f3 commit fa070e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packet_handler_map.go
Expand Up @@ -9,6 +9,8 @@ import (
"hash"
"log"
"net"
"os"
"strconv"
"sync"
"time"

Expand Down Expand Up @@ -122,6 +124,9 @@ func newPacketHandlerMap(
) (packetHandlerManager, error) {
if err := setReceiveBuffer(c, logger); err != nil {
receiveBufferWarningOnce.Do(func() {
if disable, _ := strconv.ParseBool(os.Getenv("QUIC_GO_DISABLE_RECEIVE_BUFFER_WARNING")); disable {
return
}
log.Printf("%s. See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.", err)
})
}
Expand Down

0 comments on commit fa070e5

Please sign in to comment.