fix flaky drop tests by working around the div-nonce type byte issue

hopefully fixes #243
This commit is contained in:
Lucas Clemente
2016-08-05 11:27:41 +02:00
parent 62b06a003c
commit 095f32ec53
2 changed files with 11 additions and 9 deletions

View File

@@ -151,15 +151,17 @@ func (p *UDPProxy) runConnection(conn *connection) error {
}
raw := buffer[0:n]
r := bytes.NewReader(raw)
hdr, err := quic.ParsePublicHeader(r)
if err != nil {
return err
}
atomic.AddUint64(&conn.outgoingPacketCounter, 1)
// TODO: Switch back to using the public header once Chrome properly sets the type byte.
// r := bytes.NewReader(raw)
// , err := quic.ParsePublicHeader(r)
// if err != nil {
// return err
// }
if !p.dropOutgoingPacket(hdr.PacketNumber) {
v := atomic.AddUint64(&conn.outgoingPacketCounter, 1)
if !p.dropOutgoingPacket(protocol.PacketNumber(v)) {
// Relay it to client
go func() {
time.Sleep(p.rttGen.getRTT() / 2)