Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

blaze-builder 0.2

  • Loading branch information...
commit 80682f7e49ef58c24ce69a66ea3e53b97ac68296 1 parent 1a10fd7
@snoyberg authored
Showing with 11 additions and 11 deletions.
  1. +9 −9 Network/HTTP/Enumerator.hs
  2. +2 −2 http-enumerator.cabal
View
18 Network/HTTP/Enumerator.hs
@@ -104,7 +104,7 @@ import Data.Bits
import Data.Maybe (fromMaybe)
import Data.ByteString.Lazy.Internal (defaultChunkSize)
import Codec.Binary.UTF8.String (encodeString)
-import qualified Text.Blaze.Builder.Core as Blaze
+import qualified Blaze.ByteString.Builder as Blaze
import Data.Monoid (Monoid (..))
-- | The OpenSSL library requires some initialization of variables to be used,
@@ -577,18 +577,18 @@ urlEncodedBody headers req = req
body = Blaze.toLazyByteString $ body' headers
body' [] = mempty
body' [x] = pair x
- body' (x:xs) = pair x `mappend` Blaze.singleton 38 `mappend` body' xs
+ body' (x:xs) = pair x `mappend` Blaze.fromWord8 38 `mappend` body' xs
pair (x, y)
| S.null y = single x
| otherwise =
- single x `mappend` Blaze.singleton 61 `mappend` single y
- single = Blaze.writeList go . S.unpack
- go 32 = Blaze.writeByte 43 -- space to plus
- go c | unreserved c = Blaze.writeByte c
+ single x `mappend` Blaze.fromWord8 61 `mappend` single y
+ single = Blaze.fromWrite4List go . S.unpack
+ go 32 = Blaze.writeWord8 43 -- space to plus
+ go c | unreserved c = Blaze.writeWord8 c
go c =
let x = shiftR c 4
y = c .&. 15
- in Blaze.writeByte 37 `mappend` hexChar x `mappend` hexChar y
+ in Blaze.writeWord8 37 `mappend` hexChar x `mappend` hexChar y
unreserved 45 = True -- hyphen
unreserved 46 = True -- period
unreserved 95 = True -- underscore
@@ -599,8 +599,8 @@ urlEncodedBody headers req = req
| 97 <= c && c <= 122 = True -- A - Z
unreserved _ = False
hexChar c
- | c < 10 = Blaze.writeByte $ c + 48
- | c < 16 = Blaze.writeByte $ c + 55
+ | c < 10 = Blaze.writeWord8 $ c + 48
+ | c < 16 = Blaze.writeWord8 $ c + 55
| otherwise = error $ "hexChar: " ++ show c
catchParser :: Monad m => String -> Iteratee a m b -> Iteratee a m b
View
4 http-enumerator.cabal
@@ -1,5 +1,5 @@
name: http-enumerator
-version: 0.2.0.4
+version: 0.2.0.5
license: BSD3
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
@@ -31,7 +31,7 @@ library
, attoparsec >= 0.8.0.2 && < 0.9
, attoparsec-enumerator >= 0.2 && < 0.3
, utf8-string >= 0.3.4 && < 0.4
- , blaze-builder >= 0.1 && < 0.2
+ , blaze-builder >= 0.2 && < 0.3
, zlib-bindings >= 0.0.0 && < 0.1
if flag(openssl)
build-depends: HsOpenSSL >= 0.8 && < 0.9
Please sign in to comment.
Something went wrong with that request. Please try again.