Pārlūkot izejas kodu

Minor fixes (#45)

* Cleanup code
* Fix documentation typo
Hellojack 3 gadi atpakaļ
vecāks
revīzija
e0de96eb4c

+ 1 - 1
docs/configuration/inbound/trojan.zh.md

@@ -54,7 +54,7 @@ TLS 配置, 参阅 [TLS](/zh/configuration/shared/tls/#inbound)。
 
 !!! error ""
 
-    没有证据表明 GFW 基于 HTTP 响应检测并阻止木马服务器,并且在服务器上打开标准 http/s 端口是一个更大的特征。
+    没有证据表明 GFW 基于 HTTP 响应检测并阻止 Trojan 服务器,并且在服务器上打开标准 http/s 端口是一个更大的特征。
 
 回退服务器配置。如果 `fallback` 和 `fallback_for_alpn` 为空,则禁用回退。
 

+ 2 - 2
transport/v2raygrpclite/conn.go

@@ -102,8 +102,8 @@ func (c *GunConn) Write(b []byte) (n int, err error) {
 	binary.BigEndian.PutUint32(grpcHeader[1:5], grpcPayloadLen)
 	_, err = bufio.Copy(c.writer, io.MultiReader(bytes.NewReader(grpcHeader), bytes.NewReader(protobufHeader[:varuintLen+1]), bytes.NewReader(b)))
 	buf.Put(grpcHeader)
-	if f, ok := c.writer.(http.Flusher); ok {
-		f.Flush()
+	if c.flusher != nil {
+		c.flusher.Flush()
 	}
 	return len(b), wrapError(err)
 }