From 8121e20cbd0ae520cec121f681d6e105d7262a52 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Sun, 9 Feb 2020 10:32:34 +0800 Subject: [PATCH] update func calls --- gost.go | 2 +- redirect.go | 3 ++- udp.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gost.go b/gost.go index cf75028..2de8465 100644 --- a/gost.go +++ b/gost.go @@ -20,7 +20,7 @@ import ( ) // Version is the gost version. -const Version = "2.10.1" +const Version = "2.10.1-dev" // Debug is a flag that enables the debug log. var Debug bool diff --git a/redirect.go b/redirect.go index f959770..0ab59d1 100644 --- a/redirect.go +++ b/redirect.go @@ -53,7 +53,8 @@ func (h *tcpRedirectHandler) Handle(c net.Conn) { log.Logf("[red-tcp] %s -> %s", srcAddr, dstAddr) - cc, err := h.options.Chain.Dial(dstAddr.String(), + cc, err := h.options.Chain.DialContext(context.Background(), + "tcp", dstAddr.String(), RetryChainOption(h.options.Retries), TimeoutChainOption(h.options.Timeout), ) diff --git a/udp.go b/udp.go index 5dccedf..5533a3b 100644 --- a/udp.go +++ b/udp.go @@ -345,7 +345,7 @@ func (c *udpClientConn) WriteTo(b []byte, addr net.Addr) (int, error) { } func (c *udpClientConn) ReadFrom(b []byte) (n int, addr net.Addr, err error) { - n, err = c.Read(b) + n, err = c.UDPConn.Read(b) addr = c.RemoteAddr() return }