mirror of
https://github.com/SagerNet/sing-shadowsocks.git
synced 2025-04-03 20:07:40 +03:00
Update headroom usage
This commit is contained in:
parent
a91eacdd01
commit
7e47fd1a99
8 changed files with 45 additions and 13 deletions
|
@ -310,10 +310,22 @@ func (c *clientPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error) {
|
|||
return len(p), nil
|
||||
}
|
||||
|
||||
func (c *clientPacketConn) Headroom() int {
|
||||
func (c *clientPacketConn) FrontHeadroom() int {
|
||||
return c.keySaltLength + M.MaxSocksaddrLength
|
||||
}
|
||||
|
||||
func (c *clientPacketConn) RearHeadroom() int {
|
||||
return Overhead
|
||||
}
|
||||
|
||||
func (c *clientPacketConn) ReaderMTU() int {
|
||||
return MaxPacketSize
|
||||
}
|
||||
|
||||
func (c *clientPacketConn) WriterMTU() int {
|
||||
return MaxPacketSize
|
||||
}
|
||||
|
||||
func (c *clientPacketConn) Upstream() any {
|
||||
return c.Conn
|
||||
}
|
||||
|
|
|
@ -208,6 +208,10 @@ func (c *serverConn) Upstream() any {
|
|||
return c.Conn
|
||||
}
|
||||
|
||||
func (s *Service) ReaderMTU() int {
|
||||
return MaxPacketSize
|
||||
}
|
||||
|
||||
func (s *Service) WriteIsThreadUnsafe() {
|
||||
}
|
||||
|
||||
|
@ -280,10 +284,18 @@ func (w *serverPacketWriter) WritePacket(buffer *buf.Buffer, destination M.Socks
|
|||
return w.source.WritePacket(buffer, M.SocksaddrFromNet(w.nat.LocalAddr()))
|
||||
}
|
||||
|
||||
func (w *serverPacketWriter) Headroom() int {
|
||||
func (w *serverPacketWriter) FrontHeadroom() int {
|
||||
return w.keySaltLength + M.MaxSocksaddrLength
|
||||
}
|
||||
|
||||
func (w *serverPacketWriter) RearHeadroom() int {
|
||||
return Overhead
|
||||
}
|
||||
|
||||
func (w *serverPacketWriter) WriterMTU() int {
|
||||
return MaxPacketSize
|
||||
}
|
||||
|
||||
func (w *serverPacketWriter) Upstream() any {
|
||||
return w.source
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue