diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2010-05-22 01:17:14 -0700 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2010-05-22 01:17:14 -0700 |
commit | 214711683ef2260ab502c8bb83885d30e2d5d19e (patch) | |
tree | bc277b06fb67a52b26ee4382b7ddb95610151a8e | |
parent | 388bff9b2257500d48274be2ee83b9a25b612e4a (diff) |
Some fixes to hello parsing and processing.
-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))) |