refactor(tunnel): remove nil tunnels hack (#296)
* refactor(tunnel): remove nil tunnels hack This code was originally introduced because a tunnel could be nil in session.go. I have verified that every invocation of tunnel.Start is careful to ensure that we have a tunnel name and that we don't manipulate a nil tunnel. For this reason, I'd rather remove this tricky bit of code and further simplify the tunnel code. Part of https://github.com/ooni/probe/issues/985 * even better docs
This commit is contained in:
parent
c5ad5eedeb
commit
2bafb179c3
7 changed files with 69 additions and 82 deletions
|
|
@ -10,14 +10,16 @@ import (
|
|||
)
|
||||
|
||||
// Config contains the configuration for creating a Tunnel instance. You need
|
||||
// to fill the mandatory fields. You SHOULD NOT modify the content of this
|
||||
// to fill all the mandatory fields. You SHOULD NOT modify the content of this
|
||||
// structure while in use, because that may lead to data races.
|
||||
type Config struct {
|
||||
// Name is the mandatory name of the tunnel. We support
|
||||
// "tor" and "psiphon" tunnels.
|
||||
Name string
|
||||
|
||||
// Session is the mandatory measurement session.
|
||||
// Session is the mandatory measurement session, or a suitable
|
||||
// mock of the required functionality. That is, the possibility
|
||||
// of obtaining a valid psiphon configuration.
|
||||
Session Session
|
||||
|
||||
// TorArgs contains the optional arguments that you want us to pass
|
||||
|
|
|
|||
Loading…
Reference in a new issue