Explorar o código

Fix shadowsocks client handling proxied connection

Darien Raymond %!s(int64=8) %!d(string=hai) anos
pai
achega
bb498cbfa8
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      proxy/shadowsocks/client.go

+ 5 - 3
proxy/shadowsocks/client.go

@@ -99,9 +99,11 @@ func (v *Client) Dispatch(destination v2net.Destination, payload *buf.Buffer, ra
 			return
 		}
 
-		if err := bodyWriter.Write(payload); err != nil {
-			log.Info("Shadowsocks|Client: Failed to write payload: ", err)
-			return
+		if !payload.IsEmpty() {
+			if err := bodyWriter.Write(payload); err != nil {
+				log.Info("Shadowsocks|Client: Failed to write payload: ", err)
+				return
+			}
 		}
 
 		var responseMutex sync.Mutex