Commit Graph

48 Commits

Author SHA1 Message Date
Marten Seemann
a872d26b7c use testing.Cleanup to shut down peerstore and revert most test changes 2021-09-08 17:25:49 +01:00
Marten Seemann
782897ea41 stop using goprocess to control teardown 2021-09-08 17:25:48 +01:00
Marten Seemann
048c5ddc49 remove incorrect call to InterceptAddrDial
addConn is called both when we add a dialed and an accepted connection to the
swarm. InterceptAddrDial is only supposed to intercept outgoing connections
though. When dialing, we already call InterceptAddrDial when we compose the
list of dialable addresses.
2021-05-19 09:59:47 -07:00
Marten Seemann
67f91a0be9 run connection gating tests on both TCP and QUIC
Also disables one test that doesn't work with QUIC, as we always
complete the handshake before gating there.
2021-04-23 10:25:57 +07:00
Steven Allen
98d7eef950 fix: avoid returning typed nils 2021-04-20 11:37:38 -07:00
Cory Schwartz
6cc76d55e5 fix staticcheck 2021-04-21 00:40:42 +07:00
vyzo
78037d70cb make IsFdConsumingAddr a standalone utility func 2021-04-01 23:31:29 +03:00
Marten Seemann
96218e227b prevent dialing addresses that we're listening on
It's impossible to run two nodes on the same IP:port, so we know for
sure that any dial to an address that we're listening on will fail (as
the peer IDs won't match).
In practice, this will be most useful for preventing dials to localhost
for nodes that are listening on the default port.
2021-02-09 11:04:55 +08:00
Steven Allen
0526dce9ad fix: handle case where swarm closes before stream
When we close a connection, we set the "stream" set to nil to avoid opening new
stream. Unfortunately, this meant we wouldn't decrement the reference count on
the swarm.
2020-09-02 14:55:26 -07:00
Steven Allen
4bd32948e1 slim down dependencies
Removes secio, quic, and circuit dependencies. We were using them for testing
but we don't actually need them.
2020-06-24 10:38:00 -07:00
Aarsh Shah
499b4d8467 Rank Dial addresses (#212)
* Rank dial addresss.
2020-05-20 14:34:11 +05:30
Aarsh Shah
dc499b7e07 implement connection gating support: intercept peer, address dials, upgraded conns (#201) 2020-05-15 14:26:21 +01:00
Raúl Kripalani
e132f6af3f migrate to consolidated types; remove CircleCI config (#127) 2019-05-26 15:55:50 +01:00
vyzo
fb0dd0ed76 kill stray line 2019-04-10 21:48:47 +03:00
vyzo
b355bce163 update to use NoDial option from go-libp2p-net 2019-04-10 21:46:51 +03:00
vyzo
02d01da08c context option to disable dialing when opening a new stream 2019-04-10 20:24:32 +03:00
Steven Allen
4e39954ac9 refactor for new transports
Removes:

* go-libp2p-conn logic (moved to transports)
* go-libp2p-peerstream (moved here)

Changes:

* New transport interface.
* Explicit over implicit (the implicit automagic now all lives in go-libp2p):
  * No more default transports, muxers, etc.
  * No more fallback dialer. Transports are now *required*.
* Stream opening:
  * Connection picking logic (instead of just picking the first).
  * Tries harder to open a stream of some connections happen to be closed.
* Stream closing:
  * No longer treats half-closed streams as fully closed. Users *must* read the
    an EOF or reset the stream for it to be garbage collected.
* No more polling for dead connections.
* Multiplexers are now *non-optional*. Really, they haven't been optional for a
  while but we still pretended that they were.
* No more Network type alias. It added a bunch of code and didn't really provide
  anything but an alternative set of methods that do the same thing.
* Notifications:
  * New guarantee: connection open notifications will complete before connection
    close notifications begin.
  * Given that, notifications are now delivered in parallel. No more
    notification backlogs blocking connection closing/opening.
2018-06-04 19:19:48 -07:00
Steven Allen
755830ea06 test: connect each peer precisely once.
Otherwise, some tests will get confused by duplicate (temporary, we close
duplicates quickly) connections.

fixes libp2p/go-libp2p#100
2017-08-30 18:19:48 -07:00
Jeromy
9661f5e7ab gx publish 1.6.9 2017-02-03 13:05:16 -08:00
Jeromy
5c58b97791 gx publish 1.6.8 2017-02-03 11:02:21 -08:00
Jeromy
05b9ca6039 update deps 2016-10-04 21:18:07 -07:00
Jeromy
dfae5c7dd6 extract net interface and metrics 2016-10-04 13:56:20 -07:00
Jeromy
7f10dbda8b extract conn, addr-util, and testutil 2016-10-04 13:03:14 -07:00
Jeromy
17194ccda6 switch to using stdlib context package 2016-10-03 11:00:00 -07:00
Jeromy
afe0aa7f2b add note to test failure 2016-08-24 13:03:30 -07:00
Jeromy
a2a399b0ee update local import paths to reflect org change 2016-08-10 09:59:14 -07:00
Jeromy Johnson
d6baa3b164 Merge pull request #38 from ipfs/sketch/dial-redo
refactor swarm dialing logic
2016-06-01 11:41:26 -07:00
Jeromy
4e786eb947 split peerstore from peer package 2016-05-31 16:24:11 -07:00
Jeromy
eebf64993c Refactor the swarm dialer 2016-05-31 09:41:17 -07:00
Jeromy
b58b106ecd rewrite all package paths to dvcs 2016-04-27 12:59:04 -07:00
Jeromy
995f55cbe0 recursive dependency update of utp lib 2016-04-27 10:12:51 -07:00
Jeromy Johnson
c8648d451a Merge pull request #36 from ipfs/filter-ip6
Fix address filtering for /ip6, add tests
2016-04-12 20:46:34 -07:00
Jeromy
c218be3e56 move some deps out as gx packages 2016-04-11 23:24:32 -07:00
Lars Gierth
d4973ee01b Fix address filtering for /ip6, add tests
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2016-04-10 23:50:39 -07:00
Jeromy
01d6273db1 switch to new version of go-stream-muxer 2016-03-07 22:43:13 -08:00
Jeromy
5f0753d75f Add fallback dialer
Previously we were unable to dial on a given transport if there were no
listener addresses defined for that. This meant that most people couldnt
use utp (as they had no utp listener transport to dial from).
2016-03-04 09:27:52 -08:00
Jeromy
55941459a2 update version of go-multiaddr 2016-03-03 13:03:24 -08:00
Jeromy
3cdb2f50f7 path rewrites 2016-01-04 05:45:58 -08:00
Jeromy
2d1b1db0e4 WIP 2015-12-06 23:11:16 -08:00
Jeromy
a478405a42 make new stream calls accept a context 2015-11-19 16:20:59 -08:00
Jeromy
a120be4ee5 migrate to gx namespace 2015-11-18 16:11:24 -08:00
Jeromy
a82cbe7b2f move testutil up 2015-11-15 19:59:59 -08:00
Jeromy
7d2dd014c8 vendor in notifier 2015-11-15 18:42:27 -08:00
Jeromy
21e5c03e68 fixes for sha3 2015-11-15 18:28:35 -08:00
Jeromy
5070870e7b more vendoring 2015-11-15 11:56:01 -08:00
Jeromy
9b779001c2 extract from 0.4.0 2015-11-11 16:19:51 -08:00
Juan Batiz-Benet
9bf24a5968 rewrote imports to p2p 2015-09-30 19:24:00 -04:00
Juan Batiz-Benet
4ab021d79b move to p2p dir 2015-09-30 18:42:55 -04:00