on e46572e help sign in
stackage/patching/patches/aws-0.8.3.patch
143 lines 5.7 kB history raw
1diff -ru orig/Aws/Core.hs new/Aws/Core.hs
2--- orig/Aws/Core.hs 2013-12-04 07:33:52.794606590 +0200
3+++ new/Aws/Core.hs 2013-12-04 07:33:51.000000000 +0200
4@@ -104,6 +104,8 @@
5 import Data.Char
6 import Data.Conduit (ResourceT, ($$+-))
7 import qualified Data.Conduit as C
8+import qualified Data.Conduit.List as CL
9+import Data.Default (def)
10 import Data.IORef
11 import Data.List
12 import Data.Maybe
13@@ -186,7 +188,11 @@
14 -- | Does not parse response. For debugging.
15 instance ResponseConsumer r (HTTP.Response L.ByteString) where
16 type ResponseMetadata (HTTP.Response L.ByteString) = ()
17- responseConsumer _ _ resp = HTTP.lbsResponse resp
18+ responseConsumer _ _ resp = do
19+ bss <- HTTP.responseBody resp $$+- CL.consume
20+ return resp
21+ { HTTP.responseBody = L.fromChunks bss
22+ }
24 -- | Class for responses that are fully loaded into memory
25 class AsMemoryResponse resp where
26@@ -340,16 +346,24 @@
27 -- | Additional non-"amz" headers.
28 , sqOtherHeaders :: HTTP.RequestHeaders
29 -- | Request body (used with 'Post' and 'Put').
30+#if MIN_VERSION_http_conduit(2, 0, 0)
31+ , sqBody :: Maybe HTTP.RequestBody
32+#else
33 , sqBody :: Maybe (HTTP.RequestBody (C.ResourceT IO))
34+#endif
35 -- | String to sign. Note that the string is already signed, this is passed mostly for debugging purposes.
36 , sqStringToSign :: B.ByteString
37 }
38 --deriving (Show)
40 -- | Create a HTTP request from a 'SignedQuery' object.
41+#if MIN_VERSION_http_conduit(2, 0, 0)
42+queryToHttpRequest :: SignedQuery -> HTTP.Request
43+#else
44 queryToHttpRequest :: SignedQuery -> HTTP.Request (C.ResourceT IO)
45+#endif
46 queryToHttpRequest SignedQuery{..}
47- = HTTP.def {
48+ = def {
49 HTTP.method = httpMethod sqMethod
50 , HTTP.secure = case sqProtocol of
51 HTTP -> False
52diff -ru orig/Aws/S3/Commands/GetObject.hs new/Aws/S3/Commands/GetObject.hs
53--- orig/Aws/S3/Commands/GetObject.hs 2013-12-04 07:33:52.794606590 +0200
54+++ new/Aws/S3/Commands/GetObject.hs 2013-12-04 07:33:51.000000000 +0200
55@@ -9,6 +9,7 @@
56 import qualified Data.ByteString.Char8 as B8
57 import qualified Data.ByteString.Lazy as L
58 import qualified Data.Conduit as C
59+import qualified Data.Conduit.List as CL
60 import Data.Maybe
61 import qualified Data.Text as T
62 import qualified Data.Text.Encoding as T
63@@ -81,4 +82,8 @@
65 instance AsMemoryResponse GetObjectResponse where
66 type MemoryResponse GetObjectResponse = GetObjectMemoryResponse
67- loadToMemory (GetObjectResponse om x) = GetObjectMemoryResponse om <$> HTTP.lbsResponse x
68+ loadToMemory (GetObjectResponse om x) = do
69+ bss <- HTTP.responseBody x C.$$+- CL.consume
70+ return $ GetObjectMemoryResponse om x
71+ { HTTP.responseBody = L.fromChunks bss
72+ }
73diff -ru orig/Aws/S3/Commands/PutObject.hs new/Aws/S3/Commands/PutObject.hs
74--- orig/Aws/S3/Commands/PutObject.hs 2013-12-04 07:33:52.794606590 +0200
75+++ new/Aws/S3/Commands/PutObject.hs 2013-12-04 07:33:51.000000000 +0200
76@@ -1,3 +1,4 @@
77+{-# LANGUAGE CPP #-}
78 module Aws.S3.Commands.PutObject
79 where
81@@ -27,11 +28,19 @@
82 poAcl :: Maybe CannedAcl,
83 poStorageClass :: Maybe StorageClass,
84 poWebsiteRedirectLocation :: Maybe T.Text,
85+#if MIN_VERSION_http_conduit(2, 0, 0)
86+ poRequestBody :: HTTP.RequestBody,
87+#else
88 poRequestBody :: HTTP.RequestBody (C.ResourceT IO),
89+#endif
90 poMetadata :: [(T.Text,T.Text)]
91 }
93+#if MIN_VERSION_http_conduit(2, 0, 0)
94+putObject :: Bucket -> T.Text -> HTTP.RequestBody -> PutObject
95+#else
96 putObject :: Bucket -> T.Text -> HTTP.RequestBody (C.ResourceT IO) -> PutObject
97+#endif
98 putObject bucket obj body = PutObject obj bucket Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing body []
100 data PutObjectResponse
101@@ -75,4 +84,4 @@
103 instance AsMemoryResponse PutObjectResponse where
104 type MemoryResponse PutObjectResponse = PutObjectResponse
105- loadToMemory = return
106\ No newline at end of file
107+ loadToMemory = return
108diff -ru orig/Aws/S3/Core.hs new/Aws/S3/Core.hs
109--- orig/Aws/S3/Core.hs 2013-12-04 07:33:52.794606590 +0200
110+++ new/Aws/S3/Core.hs 2013-12-04 07:33:51.000000000 +0200
111@@ -1,3 +1,4 @@
112+{-# LANGUAGE CPP #-}
113 module Aws.S3.Core where
115 import Aws.Core
116@@ -137,7 +138,11 @@
117 , s3QContentMd5 :: Maybe MD5
118 , s3QAmzHeaders :: HTTP.RequestHeaders
119 , s3QOtherHeaders :: HTTP.RequestHeaders
120+#if MIN_VERSION_http_conduit(2, 0, 0)
121+ , s3QRequestBody :: Maybe HTTP.RequestBody
122+#else
123 , s3QRequestBody :: Maybe (HTTP.RequestBody (C.ResourceT IO))
124+#endif
125 }
127 instance Show S3Query where
128diff -ru orig/aws.cabal new/aws.cabal
129--- orig/aws.cabal 2013-12-04 07:33:52.802606590 +0200
130+++ new/aws.cabal 2013-12-04 07:33:51.000000000 +0200
131@@ -107,10 +107,11 @@
132 crypto-api >= 0.9,
133 cryptohash >= 0.8 && < 0.12,
134 cryptohash-cryptoapi == 0.1.*,
135+ data-default == 0.5.*,
136 directory >= 1.0 && < 1.3,
137 failure >= 0.2.0.1 && < 0.3,
138 filepath >= 1.1 && < 1.4,
139- http-conduit >= 1.9 && < 1.10,
140+ http-conduit >= 1.9 && < 2.1,
141 http-types >= 0.7 && < 0.9,
142 lifted-base >= 0.1 && < 0.3,
143 monad-control >= 0.3,