From bd03cac80d669b42d39e9055f780f271c7c4cbc3 Mon Sep 17 00:00:00 2001
From: kr328 <kr328app@outlook.com>
Date: Sun, 13 Jun 2021 19:05:12 +0800
Subject: [PATCH] Chore: remove system proxy timeout

---
 core/src/main/golang/proxy/http.go | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/core/src/main/golang/proxy/http.go b/core/src/main/golang/proxy/http.go
index 3eef3f74..589244f7 100644
--- a/core/src/main/golang/proxy/http.go
+++ b/core/src/main/golang/proxy/http.go
@@ -5,17 +5,12 @@ import (
 	"net"
 	"net/http"
 	"sync"
-	"time"
 
 	"github.com/Dreamacro/clash/adapter/inbound"
 	"github.com/Dreamacro/clash/log"
 	"github.com/Dreamacro/clash/tunnel"
 )
 
-const (
-	LocalHttpTimeout = time.Minute * 5
-)
-
 var listener *httpListener
 var lock sync.Mutex
 
@@ -79,18 +74,14 @@ func stopLocked() {
 }
 
 func (l *httpListener) handleConn(conn net.Conn) {
-	_ = conn.SetReadDeadline(time.Now().Add(LocalHttpTimeout))
-
 	br := bufio.NewReader(conn)
 	request, err := http.ReadRequest(br)
 
-	_ = conn.SetReadDeadline(time.Time{})
-
 	if err != nil || request.URL.Host == "" {
 		if err != nil {
-			log.Warnln("HTTP Connection closed: %s", err.Error())
+			log.Warnln("[HTTP] Connection closed: %s", err.Error())
 		} else {
-			log.Warnln("HTTP Connection closed: unknown host")
+			log.Warnln("[HTTP] Connection closed: unknown host")
 		}
 
 		_ = conn.Close()
-- 
GitLab