Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
obfs4-deprecated
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leap
obfs4-deprecated
Commits
50cc1800
Commit
50cc1800
authored
10 years ago
by
Yawning Angel
Browse files
Options
Downloads
Patches
Plain Diff
Use os.MkdirAll() for creating the pt state directory.
parent
013c3c7c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
obfs4proxy/obfs4proxy.go
+8
-16
8 additions, 16 deletions
obfs4proxy/obfs4proxy.go
with
8 additions
and
16 deletions
obfs4proxy/obfs4proxy.go
+
8
−
16
View file @
50cc1800
...
...
@@ -297,31 +297,23 @@ func ptIsServer() bool {
return
env
!=
""
}
func
ptGetStateDir
()
string
{
dir
:
=
os
.
Getenv
(
"TOR_PT_STATE_LOCATION"
)
func
ptGetStateDir
()
(
dir
string
,
err
error
)
{
dir
=
os
.
Getenv
(
"TOR_PT_STATE_LOCATION"
)
if
dir
==
""
{
return
dir
return
}
stat
,
err
:
=
os
.
Stat
(
dir
)
err
=
os
.
MkdirAll
(
dir
,
0755
)
if
err
!=
nil
{
if
!
os
.
IsNotExist
(
err
)
{
log
.
Fatalf
(
"[ERROR] Failed to stat path: %s"
,
err
)
}
err
=
os
.
Mkdir
(
dir
,
0755
)
if
err
!=
nil
{
log
.
Fatalf
(
"[ERROR] Failed to create path: %s"
,
err
)
}
}
else
if
!
stat
.
IsDir
()
{
log
.
Fatalf
(
"[ERROR] Pluggable Transport state location is not a directory"
)
log
.
Fatalf
(
"[ERROR] Failed to create path: %s"
,
err
)
}
return
dir
return
}
func
ptInitializeLogging
()
{
dir
:=
ptGetStateDir
()
if
dir
==
""
{
dir
,
err
:=
ptGetStateDir
()
if
err
!=
nil
||
dir
==
""
{
return
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment