summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-05-26 13:51:45 +0200
committerRuben Pollan <meskio@sindominio.net>2018-05-26 13:51:45 +0200
commit9ad429d7030a3b07286fdc63f62181783149f494 (patch)
tree89e7eba6bb0b8274adb77d4e889788567e091359
parent3681fd33051eec54d79542205c7409c3573399bf (diff)
[pkg] windows doesn't have curve
Let's have our own hasCurve() func to don't use curve if is windows.
-rw-r--r--bitmask/darwin.go10
-rw-r--r--bitmask/events.go2
-rw-r--r--bitmask/unix.go10
-rw-r--r--bitmask/windows.go4
4 files changed, 23 insertions, 3 deletions
diff --git a/bitmask/darwin.go b/bitmask/darwin.go
index 32a9b07..f425078 100644
--- a/bitmask/darwin.go
+++ b/bitmask/darwin.go
@@ -16,8 +16,16 @@
package bitmask
-import "os"
+import (
+ "os"
+
+ "github.com/pebbe/zmq4"
+)
const coreEndpoint = "ipc:///var/tmp/bitmask.core.sock"
var ConfigPath = os.Getenv("HOME") + "/Library/Preferences/leap"
+
+func hasCurve() bool {
+ return zmq4.HasCurve()
+}
diff --git a/bitmask/events.go b/bitmask/events.go
index 3fbdc43..f8b3725 100644
--- a/bitmask/events.go
+++ b/bitmask/events.go
@@ -35,7 +35,7 @@ func initEvents() (*zmq4.Socket, error) {
return nil, err
}
- if zmq4.HasCurve() {
+ if hasCurve() {
err = initCurve(socket)
if err != nil {
return nil, err
diff --git a/bitmask/unix.go b/bitmask/unix.go
index a976857..321f1c0 100644
--- a/bitmask/unix.go
+++ b/bitmask/unix.go
@@ -16,8 +16,16 @@
package bitmask
-import "os"
+import (
+ "os"
+
+ "github.com/pebbe/zmq4"
+)
const coreEndpoint = "ipc:///var/tmp/bitmask.core.sock"
var ConfigPath = os.Getenv("HOME") + "/.config/leap"
+
+func hasCurve() bool {
+ return zmq4.HasCurve()
+}
diff --git a/bitmask/windows.go b/bitmask/windows.go
index b3d41aa..1802405 100644
--- a/bitmask/windows.go
+++ b/bitmask/windows.go
@@ -21,3 +21,7 @@ import "os"
const coreEndpoint = "tcp://127.0.0.1:5001"
var ConfigPath = os.Getenv("APPDATA") + "\\leap"
+
+func hasCurve() bool {
+ return false
+}