diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-06-07 17:04:32 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-06-07 17:04:32 +0400 |
commit | a2c8d014636103da15dc013ad3015c8150db0e42 (patch) | |
tree | 348a3b9e8357f686e78ff788f3275d3915b43388 /src/Network/BitTorrent/Tracker/Protocol.hs | |
parent | 095f22bba763aba8303322b104ae39e2ff2807c2 (diff) |
~ Use bytestring stream in tracker communication.
stringBufferOp is defined in terms of strictBuffer op. So we previously
we have convertion from strict bytestring to string and then manually
pack string back to strict bytestring to with BC.pack. We could avoid
this unnecessary convertion by just using bytestring streams.
http://hackage.haskell.org/packages/archive/HTTP/4000.0.9/doc/html/Network-BufferType.html#v:stringBufferOp
Diffstat (limited to 'src/Network/BitTorrent/Tracker/Protocol.hs')
-rw-r--r-- | src/Network/BitTorrent/Tracker/Protocol.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Tracker/Protocol.hs b/src/Network/BitTorrent/Tracker/Protocol.hs index a6c1c8b6..1bd70268 100644 --- a/src/Network/BitTorrent/Tracker/Protocol.hs +++ b/src/Network/BitTorrent/Tracker/Protocol.hs | |||
@@ -178,8 +178,8 @@ sendRequest req = do | |||
178 | 178 | ||
179 | rawResp <- simpleHTTP r | 179 | rawResp <- simpleHTTP r |
180 | respBody <- getResponseBody rawResp | 180 | respBody <- getResponseBody rawResp |
181 | return (decoded (BC.pack respBody)) | 181 | return (decoded respBody) |
182 | 182 | ||
183 | where | 183 | where |
184 | mkHTTPRequest :: URI -> Request String | 184 | mkHTTPRequest :: URI -> Request ByteString |
185 | mkHTTPRequest uri = Request uri GET [] "" | 185 | mkHTTPRequest uri = Request uri GET [] "" |