From 3cb104cd1bbd799fd34357963e1fc20bdce99b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B2=B3?= Date: Fri, 12 Apr 2019 05:39:59 +0800 Subject: [PATCH] http connection --- server/proxy/http.go | 2 +- server/proxy/p2p.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/server/proxy/http.go b/server/proxy/http.go index ce78228..3e16e4c 100644 --- a/server/proxy/http.go +++ b/server/proxy/http.go @@ -158,10 +158,10 @@ func (s *httpServer) httpHandle(c *conn.Conn, r *http.Request) { defer connClient.Close() defer c.Close() for { - r := <-reqCh if resp, err := http.ReadResponse(bufio.NewReader(connClient), r); err != nil { return } else { + r := <-reqCh //if the cache is start and the response is in the extension,store the response to the cache list if s.useCache && strings.Contains(r.URL.Path, ".") { b, err := httputil.DumpResponse(resp, true) diff --git a/server/proxy/p2p.go b/server/proxy/p2p.go index 2ec9429..e553ffb 100644 --- a/server/proxy/p2p.go +++ b/server/proxy/p2p.go @@ -65,7 +65,6 @@ func (s *P2PServer) p2pProcess(c *conn.Conn) { logs.Trace("new p2p connection ,role %s , password %s, nat type %s ,local address %s", f, string(b), strconv.Itoa(int(natType)), c.RemoteAddr().String()) //存储 if f == common.WORK_P2P_VISITOR { - logs.Warn("try visitor") v.visitorAddr = c.Conn.RemoteAddr().String() v.visitorNatType = natType v.visitor = c