mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-06 05:17:38 +03:00
Remove legacy buffer header
This commit is contained in:
parent
99d07d6e5a
commit
d7ce998e7e
4 changed files with 11 additions and 17 deletions
|
@ -30,7 +30,7 @@ func (c *ChunkReader) ReadBuffer(buffer *buf.Buffer) error {
|
|||
} else if !c.cache.IsEmpty() {
|
||||
return common.Error(buffer.ReadFrom(c.cache))
|
||||
}
|
||||
c.cache.FullReset()
|
||||
c.cache.Reset()
|
||||
err := c.upstream.ReadBuffer(c.cache)
|
||||
if err != nil {
|
||||
c.cache.Release()
|
||||
|
@ -46,7 +46,7 @@ func (c *ChunkReader) Read(p []byte) (n int, err error) {
|
|||
} else if !c.cache.IsEmpty() {
|
||||
return c.cache.Read(p)
|
||||
}
|
||||
c.cache.FullReset()
|
||||
c.cache.Reset()
|
||||
err = c.upstream.ReadBuffer(c.cache)
|
||||
if err != nil {
|
||||
c.cache.Release()
|
||||
|
@ -70,7 +70,7 @@ func (c *ChunkReader) ReadChunk() (*buf.Buffer, error) {
|
|||
} else if !c.cache.IsEmpty() {
|
||||
return c.cache, nil
|
||||
}
|
||||
c.cache.FullReset()
|
||||
c.cache.Reset()
|
||||
err := c.upstream.ReadBuffer(c.cache)
|
||||
if err != nil {
|
||||
c.cache.Release()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue