Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion proxyd/backend_probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func probeDialer() *net.Dialer {
dialer := &net.Dialer{
Control: func(network, address string, c syscall.RawConn) error {
return c.Control(func(fd uintptr) {
_ = syscall.SetsockoptLinger(int(fd), syscall.SOL_SOCKET, syscall.SO_LINGER, &syscall.Linger{Onoff: 1, Linger: 1})
_ = setSockOptLinger(int(fd))
})
},
}
Expand Down
10 changes: 10 additions & 0 deletions proxyd/backend_syscall.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build !windows

package proxyd

import "syscall"

func setSockOptLinger(fd int) error {
// Unix only
return syscall.SetsockoptLinger(fd, syscall.SOL_SOCKET, syscall.SO_LINGER, &syscall.Linger{Onoff: 1, Linger: 1})
}
8 changes: 8 additions & 0 deletions proxyd/backend_syscall_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//go:build !windows

package proxyd

func setSockOptLinger(fd int) error {
// setSockOptLinger is not supported on Windows
return nil
}
Loading