Use goptlib's MakeStateDir instead of the one in pt_extras.

This requires changes in goptlib from last night, people may need to
run "go get -u" to update dependencies before building.
merge-requests/3/head
Yawning Angel 10 years ago
parent 5bdc376e2a
commit d9c6ecbf8f

@ -334,24 +334,10 @@ func clientSetup() (launched bool) {
return return
} }
func ptGetStateDir() (dir string, err error) {
dir = os.Getenv("TOR_PT_STATE_LOCATION")
if dir == "" {
return
}
err = os.MkdirAll(dir, 0755)
if err != nil {
log.Fatalf("[ERROR] Failed to create path: %s", err)
}
return
}
func ptInitializeLogging(enable bool) error { func ptInitializeLogging(enable bool) error {
if enable { if enable {
// pt.MakeStateDir will ENV-ERROR for us. // pt.MakeStateDir will ENV-ERROR for us.
dir, err := ptMakeStateDir() dir, err := pt.MakeStateDir()
if err != nil { if err != nil {
return err return err
} }

@ -58,15 +58,6 @@ func ptProxyDone() {
pt.Stdout.Write(line) pt.Stdout.Write(line)
} }
func ptMakeStateDir() (string, error) {
dir := os.Getenv("TOR_PT_STATE_LOCATION")
if dir == "" {
return "", ptEnvError("no TOR_PT_STATE_LOCATION enviornment variable")
}
err := os.MkdirAll(dir, 0700)
return dir, err
}
func ptIsClient() (bool, error) { func ptIsClient() (bool, error) {
clientEnv := os.Getenv("TOR_PT_CLIENT_TRANSPORTS") clientEnv := os.Getenv("TOR_PT_CLIENT_TRANSPORTS")
serverEnv := os.Getenv("TOR_PT_SERVER_TRANSPORTS") serverEnv := os.Getenv("TOR_PT_SERVER_TRANSPORTS")

Loading…
Cancel
Save