Skip to content

Commit

Permalink
refactor(oonimkall): expose the session close call (#1657)
Browse files Browse the repository at this point in the history
## Checklist

- [x] I have read the [contribution
guidelines](https://github.com/ooni/probe-cli/blob/master/CONTRIBUTING.md)
- [x] reference issue for this pull request:
ooni/probe#2810
- [ ] if you changed anything related to how experiments work and you
need to reflect these changes in the ooni/spec repository, please link
to the related ooni/spec pull request: <!-- add URL here -->
- [ ] if you changed code inside an experiment, make sure you bump its
version number

<!-- Reminder: Location of the issue tracker:
https://github.com/ooni/probe -->

## Description

This diff exposes the `Session.Close` call for the geoip session we
initialize in the mobile app. This is required to close the
circumvention tunnel before we use start another tunnel as part of the
async tasks to run the experiments.
  • Loading branch information
DecFox authored Nov 21, 2024
1 parent e64f736 commit 051ab4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/oonimkall/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@ func (sess *Session) NewContextWithTimeout(timeout int64) *Context {
return &Context{cancel: cancel, ctx: ctx}
}

// Close closes the session. This is done by closing the embedded engine
// session and ensures that any tunnel (if open) is stopped
func (sess *Session) Close() error {
err := sess.sessp.Close()
return err
}

// GeolocateResults contains the results of session.Geolocate.
type GeolocateResults struct {
// ASN is the autonomous system number.
Expand Down

0 comments on commit 051ab4a

Please sign in to comment.