v2ray-core/common/protocol/protocol.go
Vigilans 8ceba34970
Correctly implement QUIC sniffer when handling multiple initial packets (#3310)
* Correctly implement QUIC sniffer when handling multiple initial packets

* Only parse token for initial packet

Signed-off-by: Vigilans <vigilans@foxmail.com>

* Update test case for QUIC sniffer

* Fix testcases
* Third packet in `Handshake[2]; packet 1-3` mistakenly copied UDP header into payload, making the payload length 1278 instead of 1250

* Introduce `protocol.ErrProtoNeedMoreData` to allow sniffer to fetch more packets until complete

---------

Signed-off-by: Vigilans <vigilans@foxmail.com>
Co-authored-by: Shelikhoo <xiaokangwang@outlook.com>
Co-authored-by: dyhkwong <50692134+dyhkwong@users.noreply.github.com>
2025-02-16 14:11:27 +00:00

10 lines
215 B
Go

package protocol
import (
"errors"
)
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
var ErrProtoNeedMoreData = errors.New("protocol matches, but need more data to complete sniffing")