pass the raw packet to the Drop- and Delay callbacks of the proxy

This commit is contained in:
Marten Seemann
2019-06-30 16:32:18 +07:00
parent 3dcbaee89e
commit 7827cd61bc
8 changed files with 58 additions and 68 deletions

View File

@@ -39,7 +39,7 @@ var _ = Describe("Drop Tests", func() {
serverPort := ln.Addr().(*net.UDPAddr).Port
proxy, err = quicproxy.NewQuicProxy("localhost:0", &quicproxy.Opts{
RemoteAddr: fmt.Sprintf("localhost:%d", serverPort),
DelayPacket: func(dir quicproxy.Direction, packetCount uint64) time.Duration {
DelayPacket: func(dir quicproxy.Direction, _ []byte) time.Duration {
return 5 * time.Millisecond // 10ms RTT
},
DropPacket: dropCallback,
@@ -75,7 +75,7 @@ var _ = Describe("Drop Tests", func() {
startTime := time.Now()
var numDroppedPackets int32
startListenerAndProxy(func(d quicproxy.Direction, p uint64) bool {
startListenerAndProxy(func(d quicproxy.Direction, _ []byte) bool {
if !d.Is(direction) {
return false
}