diff options
author | joe <joe@jerkface.net> | 2018-06-22 21:17:22 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-06-22 21:17:22 -0400 |
commit | f5f854c8144dc29086928a94b2ea86cfae0d0557 (patch) | |
tree | 5a7daccc1be66375edd35b238f348129f540b146 /src/Network/Tox | |
parent | 6f040764654640730d3f832cf4e41174562718fb (diff) |
Removed redundant imports and other clean up.
Diffstat (limited to 'src/Network/Tox')
-rw-r--r-- | src/Network/Tox/Avahi.hs | 2 | ||||
-rw-r--r-- | src/Network/Tox/ContactInfo.hs | 4 | ||||
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 10 | ||||
-rw-r--r-- | src/Network/Tox/DHT/Handlers.hs | 7 | ||||
-rw-r--r-- | src/Network/Tox/DHT/Transport.hs | 6 | ||||
-rw-r--r-- | src/Network/Tox/NodeId.hs | 2 | ||||
-rw-r--r-- | src/Network/Tox/Onion/Handlers.hs | 16 | ||||
-rw-r--r-- | src/Network/Tox/Onion/Transport.hs | 3 | ||||
-rw-r--r-- | src/Network/Tox/Transport.hs | 1 |
9 files changed, 2 insertions, 49 deletions
diff --git a/src/Network/Tox/Avahi.hs b/src/Network/Tox/Avahi.hs index ed52de74..7fe87db2 100644 --- a/src/Network/Tox/Avahi.hs +++ b/src/Network/Tox/Avahi.hs | |||
@@ -7,10 +7,8 @@ module Network.Tox.Avahi | |||
7 | ) where | 7 | ) where |
8 | 8 | ||
9 | import Data.Foldable | 9 | import Data.Foldable |
10 | import GHC.Word (Word16) | ||
11 | import Network.Address | 10 | import Network.Address |
12 | import Network.Avahi | 11 | import Network.Avahi |
13 | import Network.Socket | ||
14 | import Network.Tox.NodeId | 12 | import Network.Tox.NodeId |
15 | import Text.Read | 13 | import Text.Read |
16 | 14 | ||
diff --git a/src/Network/Tox/ContactInfo.hs b/src/Network/Tox/ContactInfo.hs index e76e2f1b..3f794197 100644 --- a/src/Network/Tox/ContactInfo.hs +++ b/src/Network/Tox/ContactInfo.hs | |||
@@ -1,7 +1,6 @@ | |||
1 | {-# LANGUAGE NamedFieldPuns #-} | 1 | {-# LANGUAGE NamedFieldPuns #-} |
2 | module Network.Tox.ContactInfo where | 2 | module Network.Tox.ContactInfo where |
3 | 3 | ||
4 | import ConnectionKey | ||
5 | import Connection | 4 | import Connection |
6 | 5 | ||
7 | import Data.Time.Clock.POSIX | 6 | import Data.Time.Clock.POSIX |
@@ -11,13 +10,10 @@ import Crypto.PubKey.Curve25519 | |||
11 | import qualified Data.HashMap.Strict as HashMap | 10 | import qualified Data.HashMap.Strict as HashMap |
12 | ;import Data.HashMap.Strict (HashMap) | 11 | ;import Data.HashMap.Strict (HashMap) |
13 | import Data.Maybe | 12 | import Data.Maybe |
14 | import qualified Data.Set as Set | ||
15 | ;import Data.Set (Set) | ||
16 | import Network.Socket | 13 | import Network.Socket |
17 | import Network.Tox.DHT.Transport as DHT | 14 | import Network.Tox.DHT.Transport as DHT |
18 | import Network.Tox.NodeId (id2key) | 15 | import Network.Tox.NodeId (id2key) |
19 | import Network.Tox.Onion.Transport as Onion | 16 | import Network.Tox.Onion.Transport as Onion |
20 | import System.IO | ||
21 | import DPut | 17 | import DPut |
22 | 18 | ||
23 | newtype ContactInfo extra = ContactInfo | 19 | newtype ContactInfo extra = ContactInfo |
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index 73e5f686..282a7dce 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -9,20 +9,16 @@ module Network.Tox.Crypto.Handlers where | |||
9 | 9 | ||
10 | import Network.Tox.NodeId | 10 | import Network.Tox.NodeId |
11 | import Network.Tox.Crypto.Transport | 11 | import Network.Tox.Crypto.Transport |
12 | import Network.Tox.DHT.Transport (Cookie(..),CookieData(..), CookieRequest(..), NoSpam(..)) | 12 | import Network.Tox.DHT.Transport (Cookie(..), NoSpam(..)) |
13 | import Network.Tox.DHT.Handlers (Client, cookieRequest, createCookieSTM ) | ||
14 | import Crypto.Tox | 13 | import Crypto.Tox |
15 | import Control.Arrow | 14 | import Control.Arrow |
16 | import Control.Concurrent.STM | 15 | import Control.Concurrent.STM |
17 | import Control.Concurrent.STM.TMChan | 16 | import Control.Concurrent.STM.TMChan |
18 | import Network.Address | 17 | import Network.Address |
19 | import qualified Data.Map.Strict as Map | 18 | import qualified Data.Map.Strict as Map |
20 | import Crypto.Hash | ||
21 | import Control.Applicative | ||
22 | import Control.Monad | 19 | import Control.Monad |
23 | import Data.Time.Clock.POSIX | 20 | import Data.Time.Clock.POSIX |
24 | import qualified Data.ByteString as B | 21 | import qualified Data.ByteString as B |
25 | import System.IO | ||
26 | import Data.ByteString (ByteString) | 22 | import Data.ByteString (ByteString) |
27 | import Control.Lens | 23 | import Control.Lens |
28 | import Data.Function | 24 | import Data.Function |
@@ -39,10 +35,8 @@ import qualified Data.Set as Set | |||
39 | import qualified Data.Array.Unboxed as A | 35 | import qualified Data.Array.Unboxed as A |
40 | import SensibleDir | 36 | import SensibleDir |
41 | import System.FilePath | 37 | import System.FilePath |
42 | import System.IO.Temp | ||
43 | import System.Environment | 38 | import System.Environment |
44 | import System.Directory | 39 | import System.Directory |
45 | import System.Random -- for ping fuzz | ||
46 | #ifdef THREAD_DEBUG | 40 | #ifdef THREAD_DEBUG |
47 | import Control.Concurrent.Lifted.Instrument | 41 | import Control.Concurrent.Lifted.Instrument |
48 | #else | 42 | #else |
@@ -54,11 +48,9 @@ import qualified Data.IntMap.Strict as IntMap | |||
54 | import Control.Concurrent.Supply | 48 | import Control.Concurrent.Supply |
55 | import Data.InOrOut | 49 | import Data.InOrOut |
56 | import DPut | 50 | import DPut |
57 | import Debug.Trace | ||
58 | import Text.Printf | 51 | import Text.Printf |
59 | import Data.Bool | 52 | import Data.Bool |
60 | import Connection (Status(..), Policy(..)) | 53 | import Connection (Status(..), Policy(..)) |
61 | import Network.Tox.ContactInfo | ||
62 | import Network.Tox.Handshake | 54 | import Network.Tox.Handshake |
63 | 55 | ||
64 | -- | This type indicates the progress of a tox encrypted friend link | 56 | -- | This type indicates the progress of a tox encrypted friend link |
diff --git a/src/Network/Tox/DHT/Handlers.hs b/src/Network/Tox/DHT/Handlers.hs index 6c29e958..09d6f66b 100644 --- a/src/Network/Tox/DHT/Handlers.hs +++ b/src/Network/Tox/DHT/Handlers.hs | |||
@@ -14,7 +14,7 @@ import Network.Kademlia.Search | |||
14 | import qualified Data.Wrapper.PSQInt as Int | 14 | import qualified Data.Wrapper.PSQInt as Int |
15 | import Network.Kademlia | 15 | import Network.Kademlia |
16 | import Network.Kademlia.Bootstrap | 16 | import Network.Kademlia.Bootstrap |
17 | import Network.Address (WantIP (..), ipFamily, testIdBit,fromSockAddr, sockAddrPort) | 17 | import Network.Address (WantIP (..), ipFamily, fromSockAddr, sockAddrPort) |
18 | import qualified Network.Kademlia.Routing as R | 18 | import qualified Network.Kademlia.Routing as R |
19 | import Control.TriadCommittee | 19 | import Control.TriadCommittee |
20 | import System.Global6 | 20 | import System.Global6 |
@@ -29,7 +29,6 @@ import Control.Concurrent.Lifted.Instrument | |||
29 | import Control.Concurrent.STM | 29 | import Control.Concurrent.STM |
30 | import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime) | 30 | import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime) |
31 | import Network.Socket | 31 | import Network.Socket |
32 | import Data.Hashable | ||
33 | import qualified Data.HashMap.Strict as HashMap | 32 | import qualified Data.HashMap.Strict as HashMap |
34 | ;import Data.HashMap.Strict (HashMap) | 33 | ;import Data.HashMap.Strict (HashMap) |
35 | #if MIN_VERSION_iproute(1,7,4) | 34 | #if MIN_VERSION_iproute(1,7,4) |
@@ -37,13 +36,9 @@ import Data.IP hiding (fromSockAddr) | |||
37 | #else | 36 | #else |
38 | import Data.IP | 37 | import Data.IP |
39 | #endif | 38 | #endif |
40 | import Data.Ord | ||
41 | import Data.Maybe | 39 | import Data.Maybe |
42 | import Data.Bits | ||
43 | import Data.Serialize (Serialize) | 40 | import Data.Serialize (Serialize) |
44 | import Data.Word | 41 | import Data.Word |
45 | import Data.List | ||
46 | import System.IO | ||
47 | import DPut | 42 | import DPut |
48 | 43 | ||
49 | data TransactionId = TransactionId | 44 | data TransactionId = TransactionId |
diff --git a/src/Network/Tox/DHT/Transport.hs b/src/Network/Tox/DHT/Transport.hs index 9ff1839c..c6fe121c 100644 --- a/src/Network/Tox/DHT/Transport.hs +++ b/src/Network/Tox/DHT/Transport.hs | |||
@@ -21,7 +21,6 @@ module Network.Tox.DHT.Transport | |||
21 | , DHTPublicKey(..) | 21 | , DHTPublicKey(..) |
22 | , FriendRequest(..) | 22 | , FriendRequest(..) |
23 | , NoSpam(..) | 23 | , NoSpam(..) |
24 | , verifyChecksum | ||
25 | , CookieRequest(..) | 24 | , CookieRequest(..) |
26 | , CookieResponse(..) | 25 | , CookieResponse(..) |
27 | , Cookie(..) | 26 | , Cookie(..) |
@@ -45,7 +44,6 @@ import Control.Arrow | |||
45 | import Control.Concurrent.STM | 44 | import Control.Concurrent.STM |
46 | import Control.Monad | 45 | import Control.Monad |
47 | import Data.Bool | 46 | import Data.Bool |
48 | import qualified Data.ByteString.Char8 as B8 | ||
49 | import qualified Data.ByteString as B | 47 | import qualified Data.ByteString as B |
50 | ;import Data.ByteString (ByteString) | 48 | ;import Data.ByteString (ByteString) |
51 | import Data.Functor.Contravariant | 49 | import Data.Functor.Contravariant |
@@ -54,11 +52,7 @@ import Data.Monoid | |||
54 | import Data.Serialize as S | 52 | import Data.Serialize as S |
55 | import Data.Tuple | 53 | import Data.Tuple |
56 | import Data.Word | 54 | import Data.Word |
57 | import Foreign.C (CTime(..)) | ||
58 | import Network.Socket | 55 | import Network.Socket |
59 | import qualified Data.ByteString.Base64 as Base64 | ||
60 | import qualified Data.ByteString.Base16 as Base16 | ||
61 | import Data.Char (isSpace) | ||
62 | 56 | ||
63 | type DHTTransport = Transport String NodeInfo (DHTMessage Encrypted8) | 57 | type DHTTransport = Transport String NodeInfo (DHTMessage Encrypted8) |
64 | type HandleHi a = Maybe (Either String (DHTMessage Encrypted8, NodeInfo)) -> IO a | 58 | type HandleHi a = Maybe (Either String (DHTMessage Encrypted8, NodeInfo)) -> IO a |
diff --git a/src/Network/Tox/NodeId.hs b/src/Network/Tox/NodeId.hs index 2f836b8e..f9cf22a8 100644 --- a/src/Network/Tox/NodeId.hs +++ b/src/Network/Tox/NodeId.hs | |||
@@ -35,7 +35,6 @@ module Network.Tox.NodeId | |||
35 | , nospam16 | 35 | , nospam16 |
36 | , verifyChecksum) where | 36 | , verifyChecksum) where |
37 | 37 | ||
38 | import Debug.Trace | ||
39 | import Control.Applicative | 38 | import Control.Applicative |
40 | import Control.Arrow | 39 | import Control.Arrow |
41 | import Control.Monad | 40 | import Control.Monad |
@@ -83,7 +82,6 @@ import System.Endian | |||
83 | import qualified Data.Text as Text | 82 | import qualified Data.Text as Text |
84 | ;import Data.Text (Text) | 83 | ;import Data.Text (Text) |
85 | import Util (splitJID) | 84 | import Util (splitJID) |
86 | import Text.Printf | ||
87 | 85 | ||
88 | -- | perform io for hashes that do allocation and ffi. | 86 | -- | perform io for hashes that do allocation and ffi. |
89 | -- unsafeDupablePerformIO is used when possible as the | 87 | -- unsafeDupablePerformIO is used when possible as the |
diff --git a/src/Network/Tox/Onion/Handlers.hs b/src/Network/Tox/Onion/Handlers.hs index f497a1bf..80a6ae3a 100644 --- a/src/Network/Tox/Onion/Handlers.hs +++ b/src/Network/Tox/Onion/Handlers.hs | |||
@@ -12,23 +12,9 @@ import qualified Network.QueryResponse as QR (Client) | |||
12 | import Crypto.Tox | 12 | import Crypto.Tox |
13 | import qualified Data.Wrapper.PSQ as PSQ | 13 | import qualified Data.Wrapper.PSQ as PSQ |
14 | ;import Data.Wrapper.PSQ (PSQ,pattern (:->)) | 14 | ;import Data.Wrapper.PSQ (PSQ,pattern (:->)) |
15 | #ifdef CRYPTONITE_BACKPORT | ||
16 | import Crypto.Error.Types (CryptoFailable (..), | ||
17 | throwCryptoError) | ||
18 | #else | ||
19 | import Crypto.Error | ||
20 | #endif | ||
21 | import Control.Arrow | 15 | import Control.Arrow |
22 | 16 | ||
23 | import System.IO | ||
24 | import qualified Data.ByteArray as BA | ||
25 | import Data.Function | 17 | import Data.Function |
26 | import Data.Serialize as S | ||
27 | import qualified Data.Wrapper.PSQInt as Int | ||
28 | import Network.Kademlia | ||
29 | import Network.Address (WantIP (..), ipFamily, testIdBit) | ||
30 | import qualified Network.Kademlia.Routing as R | ||
31 | import Control.TriadCommittee | ||
32 | import qualified Data.MinMaxPSQ as MinMaxPSQ | 18 | import qualified Data.MinMaxPSQ as MinMaxPSQ |
33 | ;import Data.MinMaxPSQ (MinMaxPSQ') | 19 | ;import Data.MinMaxPSQ (MinMaxPSQ') |
34 | import Network.BitTorrent.DHT.Token as Token | 20 | import Network.BitTorrent.DHT.Token as Token |
@@ -50,8 +36,6 @@ import Data.IP hiding (fromSockAddr) | |||
50 | import Data.IP | 36 | import Data.IP |
51 | #endif | 37 | #endif |
52 | import Data.Maybe | 38 | import Data.Maybe |
53 | import Data.Bits | ||
54 | import Data.Ord | ||
55 | import Data.Functor.Identity | 39 | import Data.Functor.Identity |
56 | import DPut | 40 | import DPut |
57 | 41 | ||
diff --git a/src/Network/Tox/Onion/Transport.hs b/src/Network/Tox/Onion/Transport.hs index 70714465..e2e136ae 100644 --- a/src/Network/Tox/Onion/Transport.hs +++ b/src/Network/Tox/Onion/Transport.hs | |||
@@ -62,7 +62,6 @@ import Control.Concurrent.STM | |||
62 | import Control.Monad | 62 | import Control.Monad |
63 | import qualified Data.ByteString as B | 63 | import qualified Data.ByteString as B |
64 | ;import Data.ByteString (ByteString) | 64 | ;import Data.ByteString (ByteString) |
65 | import Data.Coerce | ||
66 | import Data.Function | 65 | import Data.Function |
67 | import Data.Functor.Contravariant | 66 | import Data.Functor.Contravariant |
68 | import Data.Functor.Identity | 67 | import Data.Functor.Identity |
@@ -77,11 +76,9 @@ import Data.Serialize as S | |||
77 | import Data.Type.Equality | 76 | import Data.Type.Equality |
78 | import Data.Typeable | 77 | import Data.Typeable |
79 | import Data.Word | 78 | import Data.Word |
80 | import Debug.Trace | ||
81 | import GHC.Generics () | 79 | import GHC.Generics () |
82 | import GHC.TypeLits | 80 | import GHC.TypeLits |
83 | import Network.Socket | 81 | import Network.Socket |
84 | import System.IO | ||
85 | import qualified Text.ParserCombinators.ReadP as RP | 82 | import qualified Text.ParserCombinators.ReadP as RP |
86 | import Data.Hashable | 83 | import Data.Hashable |
87 | import DPut | 84 | import DPut |
diff --git a/src/Network/Tox/Transport.hs b/src/Network/Tox/Transport.hs index 57f07aad..0b03ed19 100644 --- a/src/Network/Tox/Transport.hs +++ b/src/Network/Tox/Transport.hs | |||
@@ -8,7 +8,6 @@ | |||
8 | {-# LANGUAGE TypeOperators #-} | 8 | {-# LANGUAGE TypeOperators #-} |
9 | module Network.Tox.Transport (toxTransport, RouteId) where | 9 | module Network.Tox.Transport (toxTransport, RouteId) where |
10 | 10 | ||
11 | import Data.ByteString (ByteString) | ||
12 | import Network.QueryResponse | 11 | import Network.QueryResponse |
13 | import Crypto.Tox | 12 | import Crypto.Tox |
14 | import Network.Tox.DHT.Transport | 13 | import Network.Tox.DHT.Transport |