Fix copy with src buffer to headroom writer

This commit is contained in:
世界
2022-07-30 17:43:58 +08:00
parent 2ce09b6ffd
commit 2d3d46eb34
6 changed files with 59 additions and 18 deletions

View File

@@ -323,6 +323,10 @@ func (c *ClientPacketConn) WriteBuffer(buffer *buf.Buffer) error {
return c.ExtendedConn.WriteBuffer(buffer)
}
func (c *ClientPacketConn) Headroom() int {
return 2
}
func (c *ClientPacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error {
return c.WriteBuffer(buffer)
}
@@ -471,6 +475,10 @@ func (c *ClientPacketAddrConn) LocalAddr() net.Addr {
return c.ExtendedConn.LocalAddr()
}
func (c *ClientPacketAddrConn) Headroom() int {
return 2 + M.MaxSocksaddrLength
}
func (c *ClientPacketAddrConn) Upstream() any {
return c.ExtendedConn
}