瀏覽代碼

Fix gRPC lite header

Manually set the first byte to 0x00 (No Compression) since we can not ensure that the buffer is not polluted before.
Hellojack 2 年之前
父節點
當前提交
05620a369e
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      transport/v2raygrpclite/conn.go

+ 1 - 0
transport/v2raygrpclite/conn.go

@@ -117,6 +117,7 @@ func (c *GunConn) WriteBuffer(buffer *buf.Buffer) error {
 	dataLen := buffer.Len()
 	varLen := rw.UVariantLen(uint64(dataLen))
 	header := buffer.ExtendHeader(6 + varLen)
+	header[0] = 0x00
 	binary.BigEndian.PutUint32(header[1:5], uint32(1+varLen+dataLen))
 	header[5] = 0x0A
 	binary.PutUvarint(header[6:], uint64(dataLen))