From 5a6022d1ede87a7c984eee3f8da11e2637f166b8 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 15 Nov 2017 01:14:02 +0100 Subject: [PATCH] log err for SetReadDeadline(). fix #707 --- proxy/vmess/inbound/inbound.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy/vmess/inbound/inbound.go b/proxy/vmess/inbound/inbound.go index 36439c98..4e268a66 100644 --- a/proxy/vmess/inbound/inbound.go +++ b/proxy/vmess/inbound/inbound.go @@ -174,7 +174,7 @@ func transferResponse(timer signal.ActivityUpdater, session *encoding.ServerSess // Process implements proxy.Inbound.Process(). func (v *Handler) Process(ctx context.Context, network net.Network, connection internet.Connection, dispatcher dispatcher.Interface) error { if err := connection.SetReadDeadline(time.Now().Add(time.Second * 8)); err != nil { - return err + return newError("unable to set read deadline").Base(err).AtWarning() } reader := buf.NewBufferedReader(buf.NewReader(connection)) @@ -198,7 +198,9 @@ func (v *Handler) Process(ctx context.Context, network net.Network, connection i log.Access(connection.RemoteAddr(), request.Destination(), log.AccessAccepted, "") log.Trace(newError("received request for ", request.Destination())) - common.Must(connection.SetReadDeadline(time.Time{})) + if err := connection.SetReadDeadline(time.Time{}); err != nil { + log.Trace(newError("unable to set back read deadline").Base(err)) + } userSettings := request.User.GetSettings()