diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2020-09-08 02:23:18 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2020-09-08 19:58:25 +0200 |
commit | e591c3147e3c504611ff612e8918018125ffa2eb (patch) | |
tree | d4004f33ddc2c7f9f70d95d0244b93ac27b9eb76 /gui/main.cpp | |
parent | c2871f4aece61b939e0e6c8d7a94677fb055620a (diff) |
[bug] pass json as bytes to go side
Diffstat (limited to 'gui/main.cpp')
-rw-r--r-- | gui/main.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gui/main.cpp b/gui/main.cpp index 8c7de4f..4ba9dd6 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -145,8 +145,14 @@ int main(int argc, char **argv) { GoString statusChangedEvt = {stCh, (long int)strlen(stCh)}; SubscribeToEvent(statusChangedEvt, (void *)onStatusChanged); + QJsonValue defaultProvider = providers->json().object().value("default"); + /* we send json as bytes because it breaks as a simple string */ + QString QProvidersJSON(providers->json().toJson(QJsonDocument::Compact)); + /* let the Go side initialize its internal state */ - InitializeBitmaskContext(); + InitializeBitmaskContext( + toGoStr(defaultProvider.toString()), + (char*)QProvidersJSON.toUtf8().data(), strlen(QProvidersJSON.toUtf8().data())); /* if requested, enable web api for controlling the VPN */ if (webAPI) { |