diff options
-rw-r--r-- | src/org/gnu/clojure/gnunet/hello.clj | 4 | ||||
-rw-r--r-- | src/org/gnu/clojure/gnunet/hostlist.clj | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/org/gnu/clojure/gnunet/hello.clj b/src/org/gnu/clojure/gnunet/hello.clj index b50f16e..6370954 100644 --- a/src/org/gnu/clojure/gnunet/hello.clj +++ b/src/org/gnu/clojure/gnunet/hello.clj @@ -8,13 +8,13 @@ [transport] (concat (encode-utf8 (:name transport)) - (encode-int32 (count (:bytes transport))) + (encode-int16 (count (:bytes transport))) (encode-date (:expiration transport)) (:bytes transport))) (def parse-transport (domonad parser-m [name- parse-utf8 - address-length parse-uint32 + address-length parse-uint16 expiration parse-date encoded-address (items address-length)] {:name name- diff --git a/src/org/gnu/clojure/gnunet/hostlist.clj b/src/org/gnu/clojure/gnunet/hostlist.clj index b07ceea..97b026c 100644 --- a/src/org/gnu/clojure/gnunet/hostlist.clj +++ b/src/org/gnu/clojure/gnunet/hostlist.clj @@ -4,7 +4,8 @@ (defn download-hostlist "Calls the hello-processor on all parsed hello messages at the given URL." [hello-processor url] - (doseq [[_ msg] (first ((none-or-more (parse-message-types - {message-type-hello parse-hello})) - (read-url url)))] - (hello-processor msg))) + (doseq [{hello :message} (first + ((none-or-more (parse-message-types + {message-type-hello parse-hello})) + (read-url url)))] + (hello-processor hello))) |