Browse Source

Merge pull request #80 from qbit/openbsd_keepalive

Skip SetKeepAlivePeriod call on OpenBSD
pull/1418/head
Marten Seemann 3 years ago
committed by GitHub
parent
commit
464f1b343f
  1. 8
      p2p/transport/tcp/tcp.go

8
p2p/transport/tcp/tcp.go

@ -3,6 +3,7 @@ package tcp
import (
"context"
"net"
"runtime"
"time"
logging "github.com/ipfs/go-log"
@ -41,8 +42,11 @@ func tryKeepAlive(conn net.Conn, keepAlive bool) {
log.Errorf("Failed to enable TCP keepalive: %s", err)
return
}
if err := keepAliveConn.SetKeepAlivePeriod(keepAlivePeriod); err != nil {
log.Errorf("Failed set keepalive period: %s", err)
if runtime.GOOS != "openbsd" {
if err := keepAliveConn.SetKeepAlivePeriod(keepAlivePeriod); err != nil {
log.Errorf("Failed set keepalive period: %s", err)
}
}
}

Loading…
Cancel
Save