diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-27 05:36:45 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-27 05:36:45 +0400 |
commit | e06b3dbd76a0a76c872ca27b4ea33b4465d14da3 (patch) | |
tree | f797719a25bce95a95a3b30e02b50af7a7e7520a /src/Data/Torrent/InfoHash.hs | |
parent | 89151d4315631243840fcae54244c144ff42329d (diff) |
Fix get_peers response encoding
Diffstat (limited to 'src/Data/Torrent/InfoHash.hs')
-rw-r--r-- | src/Data/Torrent/InfoHash.hs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Data/Torrent/InfoHash.hs b/src/Data/Torrent/InfoHash.hs index 4d49fcb7..9eec631c 100644 --- a/src/Data/Torrent/InfoHash.hs +++ b/src/Data/Torrent/InfoHash.hs | |||
@@ -120,6 +120,7 @@ instance Convertible BS.ByteString InfoHash where | |||
120 | -- | Parse infohash from base16\/base32\/base64 encoded string. | 120 | -- | Parse infohash from base16\/base32\/base64 encoded string. |
121 | instance Convertible Text InfoHash where | 121 | instance Convertible Text InfoHash where |
122 | safeConvert t | 122 | safeConvert t |
123 | | 20 == hashLen = pure (InfoHash hashStr) | ||
123 | | 26 <= hashLen && hashLen <= 28 = | 124 | | 26 <= hashLen && hashLen <= 28 = |
124 | case Base64.decode hashStr of | 125 | case Base64.decode hashStr of |
125 | Left msg -> convError ("invalid base64 encoding " ++ msg) t | 126 | Left msg -> convError ("invalid base64 encoding " ++ msg) t |