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
fdff88e0
Commit
fdff88e0
authored
May 05, 2020
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RUST_BACKTRACE
parent
cf37e759
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
core/src/main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
...main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
+8
-4
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
.../src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
+1
-1
No files found.
core/src/main/java/com/github/shadowsocks/bg/GuardedProcessPool.kt
View file @
fdff88e0
...
@@ -43,7 +43,7 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
...
@@ -43,7 +43,7 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
}
}
}
}
private
inner
class
Guard
(
private
val
cmd
:
List
<
String
>)
{
private
inner
class
Guard
(
private
val
cmd
:
List
<
String
>
,
private
val
environment
:
Map
<
String
,
String
>
)
{
private
lateinit
var
process
:
Process
private
lateinit
var
process
:
Process
private
fun
streamLogger
(
input
:
InputStream
,
logger
:
(
String
)
->
Unit
)
=
try
{
private
fun
streamLogger
(
input
:
InputStream
,
logger
:
(
String
)
->
Unit
)
=
try
{
...
@@ -51,7 +51,10 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
...
@@ -51,7 +51,10 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
}
catch
(
_
:
IOException
)
{
}
// ignore
}
catch
(
_
:
IOException
)
{
}
// ignore
fun
start
()
{
fun
start
()
{
process
=
ProcessBuilder
(
cmd
).
directory
(
Core
.
deviceStorage
.
noBackupFilesDir
).
start
()
process
=
ProcessBuilder
(
cmd
).
apply
{
directory
(
Core
.
deviceStorage
.
noBackupFilesDir
)
environment
().
putAll
(
environment
)
}.
start
()
}
}
suspend
fun
looper
(
onRestartCallback
:
(
suspend
()
->
Unit
)?)
{
suspend
fun
looper
(
onRestartCallback
:
(
suspend
()
->
Unit
)?)
{
...
@@ -111,9 +114,10 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
...
@@ -111,9 +114,10 @@ class GuardedProcessPool(private val onFatal: suspend (IOException) -> Unit) : C
override
val
coroutineContext
=
Dispatchers
.
Main
.
immediate
+
Job
()
override
val
coroutineContext
=
Dispatchers
.
Main
.
immediate
+
Job
()
@MainThread
@MainThread
fun
start
(
cmd
:
List
<
String
>,
onRestartCallback
:
(
suspend
()
->
Unit
)?
=
null
)
{
fun
start
(
cmd
:
List
<
String
>,
environment
:
Map
<
String
,
String
>
=
emptyMap
(),
onRestartCallback
:
(
suspend
()
->
Unit
)?
=
null
)
{
Timber
.
i
(
"start process: ${Commandline.toString(cmd)}"
)
Timber
.
i
(
"start process: ${Commandline.toString(cmd)}"
)
Guard
(
cmd
).
apply
{
Guard
(
cmd
,
environment
).
apply
{
start
()
// if start fails, IOException will be thrown directly
start
()
// if start fails, IOException will be thrown directly
launch
{
looper
(
onRestartCallback
)
}
launch
{
looper
(
onRestartCallback
)
}
}
}
...
...
core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
View file @
fdff88e0
...
@@ -129,7 +129,7 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
...
@@ -129,7 +129,7 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
cmd
+=
Acl
.
getFile
(
route
).
absolutePath
cmd
+=
Acl
.
getFile
(
route
).
absolutePath
}
}
service
.
data
.
processes
!!
.
start
(
cmd
)
service
.
data
.
processes
!!
.
start
(
cmd
,
mapOf
(
"RUST_BACKTRACE"
to
"1"
)
)
}
}
fun
scheduleUpdate
()
{
fun
scheduleUpdate
()
{
...
...
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