summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolgerReinhardt <>2019-12-18 17:43:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-12-18 17:43:00 (GMT)
commit247ef15a168ef709b430f3dedffa602de58ced1a (patch)
tree9f7bc67f9aee67b9e4db0710e5cacff3d76f05ea
parent912ce4cb935bc0bff7b564170cd4c38ce36e0a05 (diff)
version 0.19.00.19.0
-rw-r--r--Network/AMQP.hs2
-rw-r--r--Network/AMQP/Internal.hs4
-rw-r--r--Network/AMQP/Types.hs6
-rw-r--r--amqp.cabal2
-rwxr-xr-xchangelog.md4
-rwxr-xr-xexamples/ExampleConsumer.hs2
-rwxr-xr-xexamples/ExampleProducer.hs2
7 files changed, 15 insertions, 7 deletions
diff --git a/Network/AMQP.hs b/Network/AMQP.hs
index 852f8c1..eec7e07 100644
--- a/Network/AMQP.hs
+++ b/Network/AMQP.hs
@@ -640,7 +640,7 @@ plain loginName loginPassword = SASLMechanism "PLAIN" initialResponse Nothing
amqplain :: Text -> Text -> SASLMechanism
amqplain loginName loginPassword = SASLMechanism "AMQPLAIN" initialResponse Nothing
where
- initialResponse = toStrict $ BL.drop 4 $ runPut $ put $ FieldTable $ M.fromList [("LOGIN",FVString loginName), ("PASSWORD", FVString loginPassword)]
+ initialResponse = toStrict $ BL.drop 4 $ runPut $ put $ FieldTable $ M.fromList [("LOGIN",FVString $ E.encodeUtf8 loginName), ("PASSWORD", FVString $ E.encodeUtf8 loginPassword)]
-- | The @RABBIT-CR-DEMO@ SASL mechanism needs to be explicitly enabled on the RabbitMQ server and should only be used for demonstration purposes of the challenge-response cycle.
-- See <http://www.rabbitmq.com/authentication.html>.
diff --git a/Network/AMQP/Internal.hs b/Network/AMQP/Internal.hs
index 3d561f3..efbf02d 100644
--- a/Network/AMQP/Internal.hs
+++ b/Network/AMQP/Internal.hs
@@ -343,9 +343,9 @@ openConnection'' connOpts = withSocketsDo $ do
(LongString $ saslInitialResponse sasl)
(ShortString "en_US")) ))
where clientProperties = FieldTable $ M.fromList $ [ ("platform", FVString "Haskell")
- , ("version" , FVString . T.pack $ showVersion version)
+ , ("version" , FVString . E.encodeUtf8 . T.pack $ showVersion version)
, ("capabilities", FVFieldTable clientCapabilities)
- ] ++ maybe [] (\x -> [("connection_name", FVString x)]) (coName connOpts)
+ ] ++ maybe [] (\x -> [("connection_name", FVString $ E.encodeUtf8 x)]) (coName connOpts)
clientCapabilities = FieldTable $ M.fromList $ [ ("consumer_cancel_notify", FVBool True),
("connection.blocked", FVBool True) ]
diff --git a/Network/AMQP/Types.hs b/Network/AMQP/Types.hs
index 2c27f80..fdd6ecd 100644
--- a/Network/AMQP/Types.hs
+++ b/Network/AMQP/Types.hs
@@ -142,7 +142,7 @@ data FieldValue = FVBool Bool
| FVFloat Float
| FVDouble Double
| FVDecimal DecimalValue
- | FVString Text
+ | FVString BS.ByteString
| FVFieldArray [FieldValue]
| FVTimestamp Timestamp
| FVFieldTable FieldTable
@@ -164,7 +164,7 @@ instance Binary FieldValue where
'D' -> FVDecimal <$> get
'S' -> do
LongString x <- get :: Get LongString
- return $ FVString $ T.decodeUtf8 x
+ return $ FVString x
'A' -> do
len <- get :: Get Int32
if len > 0
@@ -189,7 +189,7 @@ instance Binary FieldValue where
put (FVFloat x) = put 'f' >> putFloat32be x
put (FVDouble x) = put 'd' >> putFloat64be x
put (FVDecimal x) = put 'D' >> put x
- put (FVString x) = put 'S' >> put (LongString $ T.encodeUtf8 x)
+ put (FVString x) = put 'S' >> put (LongString x)
put (FVFieldArray x) = do
put 'A'
if length x == 0
diff --git a/amqp.cabal b/amqp.cabal
index 2c837bb..0bc7fab 100644
--- a/amqp.cabal
+++ b/amqp.cabal
@@ -1,5 +1,5 @@
Name: amqp
-Version: 0.18.3
+Version: 0.19.0
Synopsis: Client library for AMQP servers (currently only RabbitMQ)
Description: Client library for AMQP servers (currently only RabbitMQ)
License: BSD3
diff --git a/changelog.md b/changelog.md
index 94e2534..b5ceb79 100755
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,7 @@
+### Version 0.19.0
+
+* change `FVString` to be binary instead of UTF-8 encoded
+
### Version 0.18.3
* respond to `channel.close` messages from the server with `channel.close_ok`
diff --git a/examples/ExampleConsumer.hs b/examples/ExampleConsumer.hs
index 5ea6a9a..8f2913e 100755
--- a/examples/ExampleConsumer.hs
+++ b/examples/ExampleConsumer.hs
@@ -1,4 +1,6 @@
{-# OPTIONS -XOverloadedStrings #-}
+module ExampleConsumer where
+
import Network.AMQP
import qualified Data.ByteString.Lazy.Char8 as BL
diff --git a/examples/ExampleProducer.hs b/examples/ExampleProducer.hs
index 080a60c..4cad4c1 100755
--- a/examples/ExampleProducer.hs
+++ b/examples/ExampleProducer.hs
@@ -1,4 +1,6 @@
{-# OPTIONS -XOverloadedStrings #-}
+module ExampleProducer where
+
import Network.AMQP
import qualified Data.ByteString.Lazy.Char8 as BL