Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
6f43e85b
Commit
6f43e85b
authored
Dec 19, 2018
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #2030
parent
88bff42c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
+2
-2
core/src/main/jni/jni-helper.cpp
core/src/main/jni/jni-helper.cpp
+2
-1
No files found.
core/src/main/java/com/github/shadowsocks/bg/VpnService.kt
View file @
6f43e85b
...
...
@@ -261,11 +261,11 @@ class VpnService : BaseVpnService(), LocalDnsService.Interface {
var
tries
=
0
val
path
=
File
(
Core
.
deviceStorage
.
noBackupFilesDir
,
"sock_path"
).
absolutePath
while
(
true
)
try
{
Thread
.
sleep
(
3
0L
shl
tries
)
Thread
.
sleep
(
5
0L
shl
tries
)
JniHelper
.
sendFd
(
fd
,
path
)
return
}
catch
(
e
:
ErrnoException
)
{
if
(
tries
>
=
10
)
throw
e
if
(
tries
>
5
)
throw
e
tries
+=
1
}
}
...
...
core/src/main/jni/jni-helper.cpp
View file @
6f43e85b
...
...
@@ -24,7 +24,8 @@ static void throwException(JNIEnv* env, jclass exceptionClass, jmethodID ctor2,
static
void
throwErrnoException
(
JNIEnv
*
env
,
const
char
*
functionName
)
{
int
error
=
errno
;
static
jclass
ErrnoException
=
env
->
FindClass
(
"android/system/ErrnoException"
);
static
jclass
ErrnoException
=
static_cast
<
jclass
>
(
env
->
NewGlobalRef
(
env
->
FindClass
(
"android/system/ErrnoException"
)));
static
jmethodID
ctor2
=
env
->
GetMethodID
(
ErrnoException
,
"<init>"
,
"(Ljava/lang/String;I)V"
);
throwException
(
env
,
ErrnoException
,
ctor2
,
functionName
,
error
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment