diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-15 19:44:12 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-15 19:44:12 +0400 |
commit | c1e3c9762eb5fea16188a0fb21ad01dd3240ab88 (patch) | |
tree | f65cffdb5156c1140dead382d4a29da845e70e53 /src/Network/BitTorrent/Exchange | |
parent | aee6069785bd552100824e36995e55e72bdbb42e (diff) |
Fix bugs in PeerAddr encoding.
Also:
* PeerAddr.hs internals and export list have been simplified;
* tests added.
Diffstat (limited to 'src/Network/BitTorrent/Exchange')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Wire.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Exchange/Wire.hs b/src/Network/BitTorrent/Exchange/Wire.hs index 27b4be12..2a7d2aeb 100644 --- a/src/Network/BitTorrent/Exchange/Wire.hs +++ b/src/Network/BitTorrent/Exchange/Wire.hs | |||
@@ -505,7 +505,7 @@ initiateHandshake sock hs = do | |||
505 | recvHandshake sock | 505 | recvHandshake sock |
506 | 506 | ||
507 | -- | Tries to connect to peer using reasonable default parameters. | 507 | -- | Tries to connect to peer using reasonable default parameters. |
508 | connectToPeer :: (IPAddress i) => PeerAddr i -> IO Socket | 508 | connectToPeer :: PeerAddr IP -> IO Socket |
509 | connectToPeer p = do | 509 | connectToPeer p = do |
510 | sock <- socket AF_INET Stream Network.Socket.defaultProtocol | 510 | sock <- socket AF_INET Stream Network.Socket.defaultProtocol |
511 | connect sock (peerSockAddr p) | 511 | connect sock (peerSockAddr p) |
@@ -628,7 +628,7 @@ reconnect = undefined | |||
628 | -- | 628 | -- |
629 | -- This function can throw 'WireFailure' exception. | 629 | -- This function can throw 'WireFailure' exception. |
630 | -- | 630 | -- |
631 | connectWire :: (IPAddress i) => Handshake -> PeerAddr i -> ExtendedCaps -> Wire () -> IO () | 631 | connectWire :: Handshake -> PeerAddr IP -> ExtendedCaps -> Wire () -> IO () |
632 | connectWire hs addr extCaps wire = | 632 | connectWire hs addr extCaps wire = |
633 | bracket (connectToPeer addr) close $ \ sock -> do | 633 | bracket (connectToPeer addr) close $ \ sock -> do |
634 | hs' <- initiateHandshake sock hs | 634 | hs' <- initiateHandshake sock hs |