mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-22 05:29:14 -04:00
A temporary testing fix for the buffer corruption issue (#3331)
This commit is contained in:
committed by
GitHub
parent
4144c87fc1
commit
561f31245d
@@ -250,7 +250,10 @@ func (d *DefaultDispatcher) Dispatch(ctx context.Context, destination net.Destin
|
||||
|
||||
func sniffer(ctx context.Context, cReader *cachedReader, metadataOnly bool, network net.Network) (SniffResult, error) {
|
||||
payload := buf.New()
|
||||
defer payload.Release()
|
||||
|
||||
defer func() {
|
||||
payload.Release()
|
||||
}()
|
||||
|
||||
sniffer := NewSniffer(ctx)
|
||||
|
||||
|
||||
@@ -52,7 +52,9 @@ func SniffQUIC(b []byte) (*SniffHeader, error) {
|
||||
// Crypto data separated across packets
|
||||
cryptoLen := 0
|
||||
cryptoData := bytespool.Alloc(int32(len(b)))
|
||||
defer bytespool.Free(cryptoData)
|
||||
defer func() {
|
||||
bytespool.Free(cryptoData)
|
||||
}()
|
||||
|
||||
cache := buf.New()
|
||||
defer cache.Release()
|
||||
|
||||
Reference in New Issue
Block a user