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
Container registry
Model registry
Operate
Environments
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
leap
bitmask-vpn
Commits
4233cc60
Unverified
Commit
4233cc60
authored
4 years ago
by
Kali Kaneko
Browse files
Options
Downloads
Patches
Plain Diff
[pkg] relax reflect 1.14 requirement
parent
3e8193f1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/backend/callbacks.go
+12
-9
12 additions, 9 deletions
pkg/backend/callbacks.go
with
12 additions
and
9 deletions
pkg/backend/callbacks.go
+
12
−
9
View file @
4233cc60
...
@@ -2,7 +2,6 @@ package backend
...
@@ -2,7 +2,6 @@ package backend
import
(
import
(
"fmt"
"fmt"
"reflect"
"sync"
"sync"
"unsafe"
"unsafe"
)
)
...
@@ -40,6 +39,8 @@ const OnStatusChanged string = "OnStatusChanged"
...
@@ -40,6 +39,8 @@ const OnStatusChanged string = "OnStatusChanged"
func
subscribe
(
event
string
,
fp
unsafe
.
Pointer
)
{
func
subscribe
(
event
string
,
fp
unsafe
.
Pointer
)
{
callbackMutex
.
Lock
()
callbackMutex
.
Lock
()
defer
callbackMutex
.
Unlock
()
defer
callbackMutex
.
Unlock
()
/* I'm commenting this check because it imposes 1.14, which is only in buster-backports.
We can re-add it after buster is oldstable
e := &Events{}
e := &Events{}
v := reflect.Indirect(reflect.ValueOf(&e))
v := reflect.Indirect(reflect.ValueOf(&e))
hf := v.Elem().FieldByName(event)
hf := v.Elem().FieldByName(event)
...
@@ -48,6 +49,8 @@ func subscribe(event string, fp unsafe.Pointer) {
...
@@ -48,6 +49,8 @@ func subscribe(event string, fp unsafe.Pointer) {
} else {
} else {
callbacks[event] = (*[0]byte)(fp)
callbacks[event] = (*[0]byte)(fp)
}
}
*/
callbacks
[
event
]
=
(
*
[
0
]
byte
)(
fp
)
}
}
// trigger fires a callback from C-land.
// trigger fires a callback from C-land.
...
...
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