Skip to content

Commit

Permalink
refactor(webconnectivitylte): {Append,Prepend}Requests (#1396)
Browse files Browse the repository at this point in the history
The new name is more accurate because we need to prepend to requests
such that the last request ends up being first in the list.

Part of ooni/probe#2634
  • Loading branch information
bassosimone authored Nov 28, 2023
1 parent 719c3c2 commit 683d20c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/experiment/webconnectivitylte/cleartextflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func (t *CleartextFlow) httpTransaction(ctx context.Context, network, address, a
err,
finished,
)
t.TestKeys.AppendRequests(ev)
t.TestKeys.PrependRequests(ev)
return resp, body, err
}

Expand Down
2 changes: 1 addition & 1 deletion internal/experiment/webconnectivitylte/secureflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func (t *SecureFlow) httpTransaction(ctx context.Context, network, address, alpn
err,
finished,
)
t.TestKeys.AppendRequests(ev)
t.TestKeys.PrependRequests(ev)
return resp, body, err
}

Expand Down
4 changes: 2 additions & 2 deletions internal/experiment/webconnectivitylte/testkeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ func (tk *TestKeys) AppendQueries(v ...*model.ArchivalDNSLookupResult) {
tk.mu.Unlock()
}

// AppendRequests appends to Requests.
func (tk *TestKeys) AppendRequests(v ...*model.ArchivalHTTPRequestResult) {
// PrependRequests prepends to Requests.
func (tk *TestKeys) PrependRequests(v ...*model.ArchivalHTTPRequestResult) {
tk.mu.Lock()
// Implementation note: append at the front since the most recent
// request must be at the beginning of the list.
Expand Down

0 comments on commit 683d20c

Please sign in to comment.