mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-06 21:37:38 +03:00
Add direct copy
This commit is contained in:
parent
44534566a3
commit
bf0aaacc67
15 changed files with 912 additions and 136 deletions
|
@ -186,13 +186,16 @@ func (c *CachedPacketConn) ReadPacket(buffer *buf.Buffer) (destination M.Socksad
|
|||
return c.PacketConn.ReadPacket(buffer)
|
||||
}
|
||||
|
||||
func (c *CachedPacketConn) ReadCachedPacket() (destination M.Socksaddr, buffer *buf.Buffer) {
|
||||
buffer = c.buffer
|
||||
func (c *CachedPacketConn) ReadCachedPacket() *N.PacketBuffer {
|
||||
buffer := c.buffer
|
||||
c.buffer = nil
|
||||
if buffer != nil {
|
||||
buffer.DecRef()
|
||||
}
|
||||
return c.destination, buffer
|
||||
return &N.PacketBuffer{
|
||||
Buffer: buffer,
|
||||
Destination: c.destination,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CachedPacketConn) Upstream() any {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue