aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cljs/gnunet_web/extractor.cljs4
-rw-r--r--src/cljs/gnunet_web/filesharing.cljs10
-rw-r--r--src/cljs/gnunet_web/service.cljs2
-rw-r--r--src/cljs/gnunet_web/transport.cljs6
-rw-r--r--src/cljs/gnunet_web/util.cljs2
-rw-r--r--src/js/window.crypto.ext.js1
6 files changed, 13 insertions, 12 deletions
diff --git a/src/cljs/gnunet_web/extractor.cljs b/src/cljs/gnunet_web/extractor.cljs
index cae5076..ff387c8 100644
--- a/src/cljs/gnunet_web/extractor.cljs
+++ b/src/cljs/gnunet_web/extractor.cljs
@@ -29,12 +29,12 @@
(defn metatype-to-string
[type]
- (js/Pointer_stringify
+ (js/UTF8ToString
(js/_EXTRACTOR_metatype_to_string type)))
(defn metatype-to-description
[type]
- (js/Pointer_stringify
+ (js/UTF8ToString
(js/_EXTRACTOR_metatype_to_description type)))
(defn metadata-destroy
diff --git a/src/cljs/gnunet_web/filesharing.cljs b/src/cljs/gnunet_web/filesharing.cljs
index 3c67a3d..0019c6a 100644
--- a/src/cljs/gnunet_web/filesharing.cljs
+++ b/src/cljs/gnunet_web/filesharing.cljs
@@ -36,7 +36,7 @@
(defn uri-pointer-to-string
[uri-pointer]
(let [uri-string-pointer (js/_GNUNET_FS_uri_to_string uri-pointer)
- uri-string (js/Pointer_stringify uri-string-pointer)]
+ uri-string (js/UTF8ToString uri-string-pointer)]
(js/_free uri-string-pointer)
uri-string))
@@ -52,7 +52,7 @@
[metadata]
(let [uri-pointer (js/_GNUNET_FS_uri_ksk_create_from_meta_data metadata)
keywords-pointer (js/_GNUNET_FS_uri_ksk_to_string_fancy uri-pointer)
- keywords (js/Pointer_stringify keywords-pointer)]
+ keywords (js/UTF8ToString keywords-pointer)]
(js/_free keywords-pointer)
(js/_GNUNET_FS_uri_destroy uri-pointer)
keywords))
@@ -61,13 +61,13 @@
[cls plugin-name type format mime-type data data-size]
(let [metadata (get-object cls)]
(swap! metadata conj
- {:plugin-name (js/Pointer_stringify plugin-name)
+ {:plugin-name (js/UTF8ToString plugin-name)
:type type
:format format
- :mime-type (js/Pointer_stringify mime-type)
+ :mime-type (js/UTF8ToString mime-type)
:data (if (or (= format e/format-utf8)
(= format e/format-string))
- (js/Pointer_stringify data)
+ (js/UTF8ToString data)
(read-memory data data-size))})))
(def metadata-iterator-pointer
diff --git a/src/cljs/gnunet_web/service.cljs b/src/cljs/gnunet_web/service.cljs
index 0eea5a2..efa49bf 100644
--- a/src/cljs/gnunet_web/service.cljs
+++ b/src/cljs/gnunet_web/service.cljs
@@ -75,7 +75,7 @@
(js/console.error "REKT" e))))
(.start port)
(.postMessage port (js-obj "type" "init"
- "private-key" (to-array private-key)
+ "private-key" (js/Uint8Array.from private-key)
"random-bytes" random-bytes))
worker))
diff --git a/src/cljs/gnunet_web/transport.cljs b/src/cljs/gnunet_web/transport.cljs
index 59332d8..5a1ee11 100644
--- a/src/cljs/gnunet_web/transport.cljs
+++ b/src/cljs/gnunet_web/transport.cljs
@@ -89,11 +89,11 @@
{:state state
:peer peer
:address (when-not (zero? transport-pointer)
- (let [transport (js/Pointer_stringify transport-pointer)]
+ (let [transport (js/UTF8ToString transport-pointer)]
(when (and (= "http_client" transport)
(<= 9 address-length))
- (js/Pointer_stringify (+ 8 address-pointer)
- (- address-length 9)))))})))
+ (js/UTF8ToString (+ 8 address-pointer)
+ (- address-length 9)))))})))
(def monitor-callback-pointer (+++ (js/addFunction monitor-callback)))
diff --git a/src/cljs/gnunet_web/util.cljs b/src/cljs/gnunet_web/util.cljs
index b58f629..a326d4a 100644
--- a/src/cljs/gnunet_web/util.cljs
+++ b/src/cljs/gnunet_web/util.cljs
@@ -66,6 +66,6 @@
"number"
(array "array" "number" "number" "number")
(array data-array data-len string-pointer strlen))
- (let [string (js/Pointer_stringify string-pointer strlen)]
+ (let [string (js/UTF8ToString string-pointer strlen)]
(js/_free string-pointer)
string)))
diff --git a/src/js/window.crypto.ext.js b/src/js/window.crypto.ext.js
index 6613e2c..a92c05f 100644
--- a/src/js/window.crypto.ext.js
+++ b/src/js/window.crypto.ext.js
@@ -1 +1,2 @@
window.crypto.getRandomValues = function() {};
+Uint8Array.from = function() {};