Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Feb 9, 2024
1 parent 8e3c4d8 commit 3a4e951
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion internal/experiment/webconnectivitylte/cleartextflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ func (t *CleartextFlow) Run(parentCtx context.Context, index int64) error {
tcpConn, err := tcpDialer.DialContext(tcpCtx, "tcp", t.Address)
t.TestKeys.AppendTCPConnectResults(trace.TCPConnects()...)
defer func() {
t.TestKeys.AppendNetworkEvents(trace.NetworkEvents()...) // here to include "connect" events
// BUGFIX: we must call trace.NetworkEvents()... inside the defer block otherwise
// we miss the read/write network events. See https://github.com/ooni/probe/issues/2674.
//
// Additionally, we must register this defer here because we want to include
// the "connect" event in case connect has failed.
t.TestKeys.AppendNetworkEvents(trace.NetworkEvents()...)
}()
if err != nil {
ol.Stop(err)
Expand Down
7 changes: 6 additions & 1 deletion internal/experiment/webconnectivitylte/secureflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ func (t *SecureFlow) Run(parentCtx context.Context, index int64) error {
tcpConn, err := tcpDialer.DialContext(tcpCtx, "tcp", t.Address)
t.TestKeys.AppendTCPConnectResults(trace.TCPConnects()...)
defer func() {
t.TestKeys.AppendNetworkEvents(trace.NetworkEvents()...) // here to include "connect" events
// BUGFIX: we must call trace.NetworkEvents()... inside the defer block otherwise
// we miss the read/write network events. See https://github.com/ooni/probe/issues/2674.
//
// Additionally, we must register this defer here because we want to include
// the "connect" event in case connect has failed.
t.TestKeys.AppendNetworkEvents(trace.NetworkEvents()...)
}()
if err != nil {
ol.Stop(err)
Expand Down

0 comments on commit 3a4e951

Please sign in to comment.