refactor(datafmt): use "udp" instead of "quic" (#946)
This diff changes the data format to prefer "udp" to "quic" everywhere we were previously using "quic". Previously, the code inconsistently used "quic" for operations where we knew we were using "quic" and "udp" otherwise (e.g., for generic operations like ReadFrom). While it would be more correct to say that a specific HTTP request used "quic" rather than "udp", using "udp" consistently allows one to see how distinct events such as ReadFrom and an handshake all refer to the same address, port, and protocol triple. Therefore, this change makes it easier to programmatically unpack a single measurement and create endpoint stats. Before implementing this change, I discussed the problem with @hellais who mentioned that ooni/data is not currently using the "quic" string anywhere. I know that ooni/pipeline also doesn't rely on this string. The only users of this feature have been research-oriented experiments such as urlgetter, for which such a change would actually be acceptable. See https://github.com/ooni/probe/issues/2238 and https://github.com/ooni/spec/pull/262.
This commit is contained in:
parent
800217d15b
commit
b78b9aca51
21 changed files with 66 additions and 66 deletions
|
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
func TestHTTPTransport(t *testing.T) {
|
||||
t.Run("Network", func(t *testing.T) {
|
||||
expected := "quic"
|
||||
expected := "udp"
|
||||
txp := &HTTPTransport{
|
||||
MockNetwork: func() string {
|
||||
return expected
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ type HTTPClient interface {
|
|||
// HTTPTransport is an http.Transport-like structure.
|
||||
type HTTPTransport interface {
|
||||
// Network returns the network used by the transport, which
|
||||
// should be one of "tcp" and "quic".
|
||||
// should be one of "tcp" and "udp".
|
||||
Network() string
|
||||
|
||||
// RoundTrip performs the HTTP round trip.
|
||||
|
|
|
|||
Loading…
Reference in a new issue