This repository was archived by the owner on Nov 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,14 @@ import (
42
42
"github.com/matrix-org/dendrite/setup/config"
43
43
)
44
44
45
- var sam , err = goSam .NewClient (* samAddr )
45
+ func client () (* goSam.Client , error ) {
46
+ if skip {
47
+ return nil , nil
48
+ }
49
+ return goSam .NewClient (* samAddr )
50
+ }
51
+
52
+ var sam , err = client ()
46
53
47
54
// Dial a network connection to an I2P server or a unix socket. Fail for clearnet addresses.
48
55
func Dial (network , addr string ) (net.Conn , error ) {
Original file line number Diff line number Diff line change @@ -40,8 +40,22 @@ import (
40
40
"github.com/matrix-org/dendrite/setup/config"
41
41
)
42
42
43
- var t , terr = tor .Start (context .Background (), nil )
44
- var tdialer , tderr = t .Dialer (context .TODO (), nil )
43
+ func start () (* tor.Tor , error ) {
44
+ if skip {
45
+ return nil , nil
46
+ }
47
+ return tor .Start (context .Background (), nil )
48
+ }
49
+
50
+ func dialer () (* tor.Dialer , error ) {
51
+ if skip {
52
+ return nil , nil
53
+ }
54
+ return t .Dialer (context .TODO (), nil )
55
+ }
56
+
57
+ var t , terr = start ()
58
+ var tdialer , tderr = dialer ()
45
59
46
60
// Dial either a unix socket address, or connect to a remote address over Tor. Always uses Tor.
47
61
func Dial (network , addr string ) (net.Conn , error ) {
You can’t perform that action at this time.
0 commit comments