Skip to content

Commit

Permalink
fix(torembed): use embedded control conn (#1074)
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone authored Feb 3, 2023
1 parent a904ba5 commit f3c853b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/tunnel/torembed.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ func getTorStartConf(config *Config, dataDir string, extraArgs []string) (*tor.S
config.logger().Infof("tunnel: tor: exec: <internal/libtor> %s %s",
dataDir, strings.Join(extraArgs, " "))
return &tor.StartConf{
ProcessCreator: creator,
DataDir: dataDir,
ExtraArgs: extraArgs,
NoHush: true,
ProcessCreator: creator,
UseEmbeddedControlConn: true,
DataDir: dataDir,
ExtraArgs: extraArgs,
NoHush: true,
}, nil
}
7 changes: 7 additions & 0 deletions internal/tunnel/tormobile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ func getTorStartConf(config *Config, dataDir string, extraArgs []string) (*tor.S
config.logger().Infof("tunnel: tor: exec: <ooni/go-libtor> %s %s",
dataDir, strings.Join(extraArgs, " "))
return &tor.StartConf{
// Implementation note: go-libtor leaks a file descriptor when you set
// UseEmbeddedControlConn, as documented by
//
// https://github.com/ooni/probe/issues/2405
//
// This is why we're not using this field for now. The above mentioned
// issue also refers to what a possible fix would look like.
ProcessCreator: libtor.Creator,
DataDir: dataDir,
ExtraArgs: extraArgs,
Expand Down

0 comments on commit f3c853b

Please sign in to comment.