mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-06 05:17:38 +03:00
Fix buffer usage
This commit is contained in:
parent
6089c358c2
commit
f1b87be6e4
21 changed files with 121 additions and 24 deletions
|
@ -119,7 +119,7 @@ func (b *Buffer) ExtendHeader(size int) []byte {
|
|||
}
|
||||
}
|
||||
|
||||
func (b *Buffer) WriteBufferAtFirst(buffer *Buffer) *Buffer {
|
||||
func (b *Buffer) _WriteBufferAtFirst(buffer *Buffer) *Buffer {
|
||||
size := buffer.Len()
|
||||
if b.start >= size {
|
||||
n := copy(b.data[b.start-size:b.start], buffer.Bytes())
|
||||
|
@ -140,7 +140,7 @@ func (b *Buffer) WriteBufferAtFirst(buffer *Buffer) *Buffer {
|
|||
}
|
||||
}
|
||||
|
||||
func (b *Buffer) WriteAtFirst(data []byte) (n int, err error) {
|
||||
func (b *Buffer) _WriteAtFirst(data []byte) (n int, err error) {
|
||||
size := len(data)
|
||||
if b.start >= size {
|
||||
n = copy(b.data[b.start-size:b.start], data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue