Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

fix: drop raw EINVAL (from keepalives) errors as well #115

Merged
merged 1 commit into from
Feb 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net"
"os"
"runtime"
"syscall"
"time"

"github.com/libp2p/go-libp2p-core/network"
Expand Down Expand Up @@ -45,7 +46,7 @@ func tryKeepAlive(conn net.Conn, keepAlive bool) {
//
// But there's nothing we can do about invalid arguments, so we'll drop this to a
// debug.
if errors.Is(err, os.ErrInvalid) {
if errors.Is(err, os.ErrInvalid) || errors.Is(err, syscall.EINVAL) {
log.Debugw("failed to enable TCP keepalive", "error", err)
} else {
log.Errorw("failed to enable TCP keepalive", "error", err)
Expand Down