diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-07-08 21:15:19 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-07-08 21:15:19 +0400 |
commit | a437e18badb78bd4946ce4ecec830acdf000abee (patch) | |
tree | 84001c3ee85247386e3723dea34ef553636d9967 /src | |
parent | 2be391c59deb670fd8084c6bd0fa9c2cbe2fd5cf (diff) |
~ Fix GHC 7.6.3 warnings.
Diffstat (limited to 'src')
-rw-r--r-- | src/Remote/KRPC/Protocol.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Remote/KRPC/Protocol.hs b/src/Remote/KRPC/Protocol.hs index 462f72eb..2e41bb2e 100644 --- a/src/Remote/KRPC/Protocol.hs +++ b/src/Remote/KRPC/Protocol.hs | |||
@@ -36,9 +36,8 @@ module Remote.KRPC.Protocol | |||
36 | , encode, encoded, decode, decoded, toBEncode, fromBEncode | 36 | , encode, encoded, decode, decoded, toBEncode, fromBEncode |
37 | ) where | 37 | ) where |
38 | 38 | ||
39 | import Prelude hiding (catch) | ||
40 | import Control.Applicative | 39 | import Control.Applicative |
41 | import Control.Exception.Lifted | 40 | import Control.Exception.Lifted as Lifted |
42 | import Control.Monad | 41 | import Control.Monad |
43 | import Control.Monad.IO.Class | 42 | import Control.Monad.IO.Class |
44 | import Control.Monad.Trans.Control | 43 | import Control.Monad.Trans.Control |
@@ -213,7 +212,6 @@ sendMessage :: BEncodable msg => msg -> KRemoteAddr -> KRemote -> IO () | |||
213 | sendMessage msg (host, port) sock = | 212 | sendMessage msg (host, port) sock = |
214 | sendAllTo sock (LB.toStrict (encoded msg)) (SockAddrInet port host) | 213 | sendAllTo sock (LB.toStrict (encoded msg)) (SockAddrInet port host) |
215 | {-# INLINE sendMessage #-} | 214 | {-# INLINE sendMessage #-} |
216 | {-# SPECIALIZE sendMessage :: BEncode -> KRemoteAddr -> KRemote -> IO () #-} | ||
217 | 215 | ||
218 | recvResponse :: KRemote -> IO (Either KError KResponse) | 216 | recvResponse :: KRemote -> IO (Either KError KResponse) |
219 | recvResponse sock = do | 217 | recvResponse sock = do |
@@ -230,9 +228,9 @@ remoteServer :: (MonadBaseControl IO remote, MonadIO remote) | |||
230 | -> (KRemoteAddr -> KQuery -> remote (Either KError KResponse)) | 228 | -> (KRemoteAddr -> KQuery -> remote (Either KError KResponse)) |
231 | -- ^ Handler. | 229 | -- ^ Handler. |
232 | -> remote () | 230 | -> remote () |
233 | remoteServer servport action = bracket (liftIO bind) (liftIO . sClose) loop | 231 | remoteServer servport action = bracket (liftIO bindServ) (liftIO . sClose) loop |
234 | where | 232 | where |
235 | bind = do | 233 | bindServ = do |
236 | sock <- socket AF_INET Datagram defaultProtocol | 234 | sock <- socket AF_INET Datagram defaultProtocol |
237 | bindSocket sock (SockAddrInet servport iNADDR_ANY) | 235 | bindSocket sock (SockAddrInet servport iNADDR_ANY) |
238 | return sock | 236 | return sock |
@@ -249,5 +247,5 @@ remoteServer servport action = bracket (liftIO bind) (liftIO . sClose) loop | |||
249 | where | 247 | where |
250 | handleMsg bs addr = case decoded bs of | 248 | handleMsg bs addr = case decoded bs of |
251 | Right query -> (either toBEncode toBEncode <$> action addr query) | 249 | Right query -> (either toBEncode toBEncode <$> action addr query) |
252 | `catch` (return . toBEncode . serverError) | 250 | `Lifted.catch` (return . toBEncode . serverError) |
253 | Left decodeE -> return $ toBEncode (ProtocolError (BC.pack decodeE)) | 251 | Left decodeE -> return $ toBEncode (ProtocolError (BC.pack decodeE)) |