Commit Graph

183 Commits

Author SHA1 Message Date
Hector Sanjuan cc1c2af4b7 Update go-detect-race to latest packaged version and location
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-02-16 11:26:39 +01:00
Łukasz Magiera 498c841eb9 Skip TestMdnsDiscovery 2018-02-14 16:04:14 +01:00
Steven Allen 5f75373b53 make the identify test less racy 2018-01-27 21:14:08 -08:00
Alexey Kholupko 7c7bd31d3e mDNS discovery starts announcing right away: does not wait for first interval to elapse.
Closes #256
2018-01-27 16:32:58 +07:00
Steven Allen d7c4c0a202 add test for forgetting address records 2018-01-19 22:37:14 -08:00
Steven Allen ea95a94e78 register identify service netNotify
This way, we actually process disconnect notifications (and reduce the lifetime
on peer addr records).
2018-01-19 22:36:33 -08:00
Steven Allen 096a2c8303 fix peerstore apocalypse redux
This commit prevents us from repeatedly extending the lifetimes of all observed
addresses if a peer keeps on reconnecting.

It also fixes two race conditions:

1. We may end up processing a disconnect after a re-connect and may
accidentally give the addresses associated with that peer a
RecentlyConnectedAddrTTL instead of a ConnectedAddrTTL.

2. We may end up processing a connect after the associated disconnect storing
the associated peer addresses indefinitely.
2018-01-19 21:52:22 -08:00
Steven Allen 62f92f7e73 always make the host context cancelable
There's really no reason to *only* do this if we have relays enabled. Doing it
this way makes `go vet` happier and reduces conditional logic.
2017-11-16 17:34:48 -08:00
Kevin Atkinson af895a81d5 Fix most "go vet" errors. 2017-11-16 20:05:22 -05:00
Jeromy 85d0247d16 use connmgr interface instead of connmgr directly 2017-10-06 04:39:17 -07:00
Eric Harris-Braun 9d3b90d67e allow tag to be passed into NewMdnsService 2017-09-24 17:59:28 +02:00
Jakub Sztandera 0bef0c7426 Merge pull request #232 from libp2p/fix/log-message
basic_host: fix warning message
2017-09-21 13:27:35 +02:00
vyzo ecb14089a7 basic_host: fix warning message 2017-09-21 12:10:37 +03:00
Steven Allen 860d278469 make sure to not drop writes on close
Before, on close, we:

1. Weren't completing the write.
2. Flushing the buffer without waiting the latency delay.

This fixes that by using two separate channels for close/reset and ignoring the
close channel in deliverOrWait.
2017-09-13 23:05:17 -07:00
Steven Allen 17354d7768 get rid of debugging code 2017-09-13 16:14:45 -07:00
Steven Allen 34421451f5 reset on error in reconnect test 2017-09-13 15:57:12 -07:00
Steven Allen 925ac42502 Reset on error in ping. 2017-09-13 15:50:23 -07:00
Steven Allen 7cdd4bc984 Reset on error in basic_host 2017-09-13 15:49:53 -07:00
Steven Allen 1b9aa7789c update go-stream-muxer
* Fix the tests to work with separate reset/close methods.
* Ensure we interrupt writes on reset.
* Always delay the proper time even if we're sending short messages.
* Copy buffers as we send them. `Write` is not allowed to hang onto buffers. If
  we run into performance issues, we can always add a buffer pool.
2017-09-13 15:18:38 -07:00
Lars Gierth 3a57e7080d Merge pull request #211 from libp2p/fix/notify-tests
tests: update test cases to act like go-peerstream 1.7.0
2017-08-07 05:19:53 +02:00
Lars Gierth e0c5c22dbc Avoid unneccessary multiaddr resolutions 2017-08-07 05:08:01 +02:00
Lars Gierth 0c23c9684c Resolve /dns4, /dns6, /dnsaddr multiaddrs 2017-08-07 05:07:58 +02:00
Gurinder Singh 8f9170f6e2 Made the image render inline 2017-08-04 16:27:39 +05:30
vyzo 6be81d34c1 basic_host: take base context as parameter in NewHost 2017-08-02 11:04:59 +03:00
vyzo fd23cf6fa5 basic_host: add the relay after the host construction is complete 2017-08-02 10:58:28 +03:00
vyzo 7f1ffcbd4e basic_host: NewHost: don't panic on relay errors, return an error instead
The legacy interface stays unchanged with a panic though.
2017-08-01 19:36:09 +03:00
vyzo 3b6d61122f basic_host: integrate circuit relay as a transport with an option 2017-08-01 19:36:09 +03:00
Steven Allen 112866c35a tests: update test cases to act like go-peerstream 1.7.0 2017-07-27 14:35:29 -07:00
vyzo 3b2f464171 RoutedHost: use Connect directly in NewStream 2017-07-22 11:55:24 +03:00
vyzo daaf97b416 RoutedHost: NewStram ensures we have the means to connect to the peer 2017-07-21 13:22:53 +03:00
Jeromy 665234f694 WIP: add ConnManager interface method 2017-07-11 23:20:27 -07:00
Jeromy dfaa021cd7 gx publish 4.4.1 2017-07-11 16:08:52 -07:00
Enzo Haussecker e9c24fdc2d Create interface for NAT manager 2017-06-04 21:33:27 -07:00
Enzo Haussecker e571f8a3fb Publicize NAT manager struct 2017-06-03 04:32:47 -07:00
Lars Gierth f0453a2458 basichost: refactor BasicHost construction
There were previously 4 different ways of passing various options
into BasicHost construction.

1. Function parameters to New
2. Option parameters to New
3. Global variables, e.g. NegotiateTimeout
4. Options struct, in the calling code in go-ipfs

This changeset deprecated all of these, and introduces the HostOpts
struct to replace them. It also introduces a new constructor called
NewHost, which accepts a *HostOpts.

The old New constructor continues to work the same way,
but is from now on deprecated too.
2017-05-31 02:30:29 +02:00
Lars Gierth 6cbb93905b basichost: allow overriding Addrs() 2017-05-30 20:39:08 +02:00
Jakub Sztandera ed98e37176
Extend time of observation by the factor of ActivationThresh 2017-04-24 20:26:15 +02:00
Jakub Sztandera 955ebe34a7
Fix obsaddr_test compare function 2017-04-24 20:26:15 +02:00
Jakub Sztandera 356f5ab17d
Modify ObservedAddrSet to better detect our active addrs 2017-04-24 20:26:10 +02:00
Lars Gierth 12f881c55a Remove unused and unfit relay protocol 2017-03-12 03:37:01 +01:00
Jeromy 31557da822 fix multistream import paths 2017-01-10 07:22:30 -08:00
Jeromy 104c97ed57 update go-multistream and use negotiateLazy to allow for readonly streams 2017-01-05 08:10:26 -08:00
Jeromy 26adf7395b identify: make agent version mutable 2016-12-26 02:52:49 -08:00
Jeromy f4ea270ccb use set protos in identify protocol knowledge gathering 2016-11-18 15:09:18 -08:00
Jeromy f61f242f69 Extract netutil to its own package 2016-11-17 10:58:15 -08:00
Jeromy Johnson 9183b8afcf Merge pull request #150 from libp2p/feat/negotiate-timeouts
add negotiate timeout option to basichost
2016-11-10 17:05:44 -08:00
Jeromy 6bccc8c1f5 fix dial log 2016-11-10 16:01:42 -08:00
Jeromy 4f17a651d1 add negotiate timeout option to basichost 2016-11-10 12:40:38 -08:00
Jeromy 077aae473b make bandwidth metrics optional 2016-11-09 16:26:19 -08:00
Jeromy 6f804db71e update dependencies and add deadline methods to streams 2016-11-08 13:11:02 -08:00