aboutsummaryrefslogtreecommitdiff
path: root/src/cljs/gnunet_web/transport.cljs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cljs/gnunet_web/transport.cljs')
-rw-r--r--src/cljs/gnunet_web/transport.cljs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cljs/gnunet_web/transport.cljs b/src/cljs/gnunet_web/transport.cljs
index a93ec41..59332d8 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)
- address (read-memory address-pointer address-length)]
- (when (= "http_client" transport)
- (gcrypt/utf8ByteArrayToString
- (to-array (drop 8 address))))))})))
+ (let [transport (js/Pointer_stringify transport-pointer)]
+ (when (and (= "http_client" transport)
+ (<= 9 address-length))
+ (js/Pointer_stringify (+ 8 address-pointer)
+ (- address-length 9)))))})))
(def monitor-callback-pointer (+++ (js/addFunction monitor-callback)))