Skip to content

Commit

Permalink
Merge pull request #112 from bgp/nodelay-switch
Browse files Browse the repository at this point in the history
Add switch to disable TCP_NODELAY
  • Loading branch information
job committed Feb 9, 2024
2 parents 03532ba + 5bd081b commit 7bec069
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,16 @@ func (s *Server) Start(bind string) error {

var DisableBGPSec = flag.Bool("disable.bgpsec", false, "Disable sending out BGPSEC Router Keys")
var DisableASPA = flag.Bool("disable.aspa", false, "Disable sending out ASPA objects")
var EnableNODELAY = flag.Bool("enable.nodelay", false, "Force enable TCP NODELAY (Likely increases CPU)")

func (s *Server) acceptClientTCP(tcpconn net.Conn) error {
if !*EnableNODELAY {
tc, ok := tcpconn.(*net.TCPConn)
if ok {
tc.SetNoDelay(false)
}
}

client := ClientFromConn(tcpconn, s, s)
client.log = s.log
if s.enforceVersion {
Expand Down

0 comments on commit 7bec069

Please sign in to comment.