proxy: add source and destination address to delay and drop callbacks (#4964)

This commit is contained in:
Marten Seemann
2025-02-22 12:21:40 +01:00
committed by GitHub
parent eb2f986a06
commit 6033030017
19 changed files with 65 additions and 53 deletions

View File

@@ -82,8 +82,8 @@ func TestPathMTUDiscovery(t *testing.T) {
proxy := &quicproxy.Proxy{
Conn: newUPDConnLocalhost(t),
ServerAddr: ln.Addr().(*net.UDPAddr),
DelayPacket: func(_ quicproxy.Direction, _ []byte) time.Duration { return rtt / 2 },
DropPacket: func(dir quicproxy.Direction, packet []byte) bool {
DelayPacket: func(quicproxy.Direction, net.Addr, net.Addr, []byte) time.Duration { return rtt / 2 },
DropPacket: func(dir quicproxy.Direction, _, _ net.Addr, packet []byte) bool {
if len(packet) > mtu {
return true
}