Commit 2155d503 authored by Julien Lepiller's avatar Julien Lepiller

torrent: Return host as a string.

* torrent/trackers.scm (parse-peers): Return hosts as a string.
parent e00f1443
......@@ -123,7 +123,13 @@
(begin
(let loop ((pos 0))
(if (< pos (bytevector-length peers))
(cons `(("host" . ,(bytevector-u32-ref peers pos (endianness big)))
(cons `(("host" . ,(with-output-to-string
(lambda _
(format #t "~d.~d.~d.~d"
(bytevector-u8-ref peers pos)
(bytevector-u8-ref peers (+ pos 1))
(bytevector-u8-ref peers (+ pos 2))
(bytevector-u8-ref peers (+ pos 3))))))
("port" . ,(bytevector-u16-ref peers (+ pos 4) (endianness big))))
(loop (+ pos 6)))
'()))))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment