Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask-vpn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Julian Merlin
bitmask-vpn
Commits
7c4a4f5a
Unverified
Commit
7c4a4f5a
authored
4 years ago
by
meskio
Browse files
Options
Downloads
Patches
Plain Diff
Quit if there was an initializaton error
Let's close properly without segfaults :)
parent
abb65c7f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
gui/qml/main.qml
+5
-1
5 additions, 1 deletion
gui/qml/main.qml
pkg/backend/api.go
+6
-3
6 additions, 3 deletions
pkg/backend/api.go
pkg/backend/init.go
+1
-1
1 addition, 1 deletion
pkg/backend/init.go
pkg/vpn/launcher_linux.go
+2
-1
2 additions, 1 deletion
pkg/vpn/launcher_linux.go
with
14 additions
and
6 deletions
gui/qml/main.qml
+
5
−
1
View file @
7c4a4f5a
...
...
@@ -20,12 +20,14 @@ ApplicationWindow {
donate
.
visible
=
true
}
if
(
ctx
.
errors
)
{
// TODO consider disabling on/off buttons, or quit after closing the dialog
if
(
ctx
.
errors
==
"
nohelpers
"
)
{
showInitFailure
(
qsTr
(
"
Could not find helpers. Check your installation
"
))
}
else
if
(
ctx
.
errors
==
"
nopolkit
"
)
{
showInitFailure
(
qsTr
(
"
Could not find polkit agent.
"
))
}
else
{
//: %1 -> application name
//: %2 -> error string
showInitFailure
(
qsTr
(
"
Got an error starting %1: %2
"
).
arg
(
ctx
.
appName
).
arg
(
ctx
.
errors
))
console
.
debug
(
ctx
.
errors
)
}
}
...
...
@@ -248,5 +250,7 @@ ApplicationWindow {
title
:
qsTr
(
"
Initialization Error
"
)
text
:
""
visible
:
false
onAccepted
:
backend
.
quit
()
onRejected
:
backend
.
quit
()
}
}
This diff is collapsed.
Click to expand it.
pkg/backend/api.go
+
6
−
3
View file @
7c4a4f5a
...
...
@@ -4,7 +4,6 @@ package backend
import
(
"C"
"fmt"
"log"
"strconv"
"unsafe"
...
...
@@ -31,7 +30,9 @@ func Quit() {
}
else
{
ctx
.
cfg
.
SetUserStoppedVPN
(
true
)
}
ctx
.
bm
.
Close
()
if
ctx
.
bm
!=
nil
{
ctx
.
bm
.
Close
()
}
}
func
DonateAccepted
()
{
...
...
@@ -55,7 +56,9 @@ func InitializeBitmaskContext(opts *InitOpts) {
initOnce
.
Do
(
func
()
{
initializeContext
(
opts
)
})
runDonationReminder
()
go
ctx
.
updateStatus
()
if
ctx
.
bm
!=
nil
{
go
ctx
.
updateStatus
()
}
}
func
RefreshContext
()
*
C
.
char
{
...
...
This diff is collapsed.
Click to expand it.
pkg/backend/init.go
+
1
−
1
View file @
7c4a4f5a
...
...
@@ -45,6 +45,7 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
os
.
Exit
(
1
)
}
bitmask
.
InitializeLogger
()
ctx
.
cfg
=
config
.
ParseConfig
()
b
,
err
:=
bitmask
.
InitializeBitmask
(
opts
.
SkipLaunch
)
if
err
!=
nil
{
...
...
@@ -70,5 +71,4 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
}
ctx
.
bm
=
b
ctx
.
cfg
=
config
.
ParseConfig
()
}
This diff is collapsed.
Click to expand it.
pkg/vpn/launcher_linux.go
+
2
−
1
View file @
7c4a4f5a
...
...
@@ -230,7 +230,8 @@ func bitmaskRootPath() (string, error) {
return
path
,
nil
}
}
return
""
,
errors
.
New
(
"No bitmask-root found"
)
log
.
Println
(
"Can't find bitmask-root"
)
return
""
,
errors
.
New
(
"nohelpers"
)
}
func
getOpenvpnPath
()
string
{
...
...
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