mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Add gRPC Transport support (#356)
Co-authored-by: JimhHan <50871214+JimhHan@users.noreply.github.com>
This commit is contained in:
parent
60b06877bf
commit
a0a32ee00d
23 changed files with 1564 additions and 4 deletions
|
@ -31,6 +31,22 @@ func New() *Buffer {
|
|||
}
|
||||
}
|
||||
|
||||
func NewExisted(b []byte) *Buffer {
|
||||
if cap(b) < Size {
|
||||
panic("Invalid buffer")
|
||||
}
|
||||
|
||||
oLen := len(b)
|
||||
if oLen < Size {
|
||||
b = append(b, make([]byte, Size-oLen)...)
|
||||
}
|
||||
|
||||
return &Buffer{
|
||||
v: b,
|
||||
end: int32(oLen),
|
||||
}
|
||||
}
|
||||
|
||||
// StackNew creates a new Buffer object on stack.
|
||||
// This method is for buffers that is released in the same function.
|
||||
func StackNew() Buffer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue