Fix DNS over QUIC stream close

This commit is contained in:
dyhkwong 2025-03-27 10:19:57 +08:00 committed by GitHub
parent 9656bc0938
commit 7c8bd19afb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -140,12 +140,12 @@ func (t *Transport) exchange(ctx context.Context, message *mDNS.Msg, conn quic.C
if err != nil {
return nil, err
}
defer stream.Close()
defer stream.CancelRead(0)
err = transport.WriteMessage(stream, 0, message)
if err != nil {
stream.Close()
return nil, err
}
stream.Close()
return transport.ReadMessage(stream)
}