diff options
Diffstat (limited to 'src/Network/BitTorrent/Core')
-rw-r--r-- | src/Network/BitTorrent/Core/Fingerprint.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Core/Fingerprint.hs b/src/Network/BitTorrent/Core/Fingerprint.hs index a81edd8b..d743acd0 100644 --- a/src/Network/BitTorrent/Core/Fingerprint.hs +++ b/src/Network/BitTorrent/Core/Fingerprint.hs | |||
@@ -25,11 +25,13 @@ module Network.BitTorrent.Core.Fingerprint | |||
25 | ( ClientImpl (..) | 25 | ( ClientImpl (..) |
26 | , Fingerprint (..) | 26 | , Fingerprint (..) |
27 | , libFingerprint | 27 | , libFingerprint |
28 | , libUserAgent | ||
28 | ) where | 29 | ) where |
29 | 30 | ||
30 | import Data.Default | 31 | import Data.Default |
31 | import Data.List as L | 32 | import Data.List as L |
32 | import Data.List.Split as L | 33 | import Data.List.Split as L |
34 | import Data.Monoid | ||
33 | import Data.String | 35 | import Data.String |
34 | import Data.Version | 36 | import Data.Version |
35 | import Text.PrettyPrint hiding ((<>)) | 37 | import Text.PrettyPrint hiding ((<>)) |
@@ -190,6 +192,11 @@ instance Pretty Fingerprint where | |||
190 | libFingerprint :: Fingerprint | 192 | libFingerprint :: Fingerprint |
191 | libFingerprint = Fingerprint IlibHSbittorrent version | 193 | libFingerprint = Fingerprint IlibHSbittorrent version |
192 | 194 | ||
195 | -- | HTTP user agent of this (the bittorrent library) package. Can be | ||
196 | -- used in HTTP tracker requests. | ||
197 | libUserAgent :: String | ||
198 | libUserAgent = render (pretty IlibHSbittorrent <> "/" <> pretty version) | ||
199 | |||
193 | {----------------------------------------------------------------------- | 200 | {----------------------------------------------------------------------- |
194 | -- For torrent file | 201 | -- For torrent file |
195 | -----------------------------------------------------------------------} | 202 | -----------------------------------------------------------------------} |