* Update anacrolix/go-libutp (v1.1.0 -> v1.2.0) * Pass client logger to anacrolix/go-libutp * Pass logger instead of option The project now compiles properly when CGO is not enabled. Additionally, the new argument (now log.Logger instead of utp.NewSocketOpt) is now required. The tests have been updated to match this change, and now pass logger.Default to NewUtpSocket. * Correct function signature of NewUtpSocket
19 lines
349 B
Go
19 lines
349 B
Go
//go:build !cgo || disable_libutp
|
|
// +build !cgo disable_libutp
|
|
|
|
package torrent
|
|
|
|
import (
|
|
"github.com/anacrolix/log"
|
|
"github.com/anacrolix/utp"
|
|
)
|
|
|
|
func NewUtpSocket(network, addr string, _ firewallCallback, _ log.Logger) (utpSocket, error) {
|
|
s, err := utp.NewSocket(network, addr)
|
|
if s == nil {
|
|
return nil, err
|
|
} else {
|
|
return s, err
|
|
}
|
|
}
|