Commit Graph

202 Commits

Author SHA1 Message Date
Steven Allen 7d6f9521c2
Merge pull request #380 from libp2p/fix/reset-ping-stream
always reset ping streams when done
2018-08-21 05:22:22 +00:00
Steven Allen 6f0dcfa108
Merge pull request #389 from libp2p/fix/mock-streams
mock stream fixes
2018-08-16 17:44:22 +00:00
Steven Allen f0eba35c6e
Merge pull request #388 from libp2p/fix/id-reset
reset when we fail in identify
2018-08-16 17:43:59 +00:00
Steven Allen c83318bf08 Revert "Merge pull request #386 from libp2p/fix/correct-external-addr"
This reverts commit aca83b9b63, reversing
changes made to 86b8929d4d.

This was is not the correct fix. We already expose these addresses via the
host's AllAddrs method. The real problem is probably that we just don't ever
tell anyone about them (unless we disconnect and reconnect to our nearby DHT
nodes).

We need an address gossip protocol.
2018-08-13 16:52:49 -07:00
Steven Allen f6ad991bb5 update gogo protobuf
and regenerate protobuf files
2018-08-08 18:08:13 -07:00
Steven Allen 784ff9c5a5 fix closing of mock streams in test 2018-08-08 13:37:29 -07:00
Steven Allen f56473fb01 make sure reset works on half-closed streams 2018-08-08 13:36:01 -07:00
Steven Allen 2e13245085 reset when we fail in identify 2018-08-08 11:48:45 -07:00
Steven Allen 7133f4124f when we do a nat port mapping, explicitly remember the mapped address
related to #383

I won't call this *fixed* yet but it should help.
2018-08-02 14:18:47 -07:00
Steven Allen 72df25af76 always reset ping streams when done
Currently, we leak a stream. We could use FullClose but, IMO, it's not worth it.
We might as well just reset and walk away.
2018-07-27 10:54:34 -07:00
Steven Allen b4428fda58 reduce error to warning and log the error
This happens all the time in tests where we intentionally use fake keys for
performance.

Anyways, users probably don't want their logs spammed with errors they can't do
anything about.
2018-06-15 14:27:22 -07:00
Steven Allen 74486ec970
Merge pull request #352 from libp2p/nit/optimize
check for connectedness using Connectedness
2018-06-14 18:44:06 +00:00
Łukasz Kurowski 39791b176c
function cannot be formatted as string 2018-06-12 21:39:29 +02:00
Steven Allen a361bf0394 check for connectedness using Connectedness
(counting open connections requires copying)
2018-06-09 10:23:09 -07:00
Steven Allen 1257b87aab
Merge pull request #346 from libp2p/bugs/mock-stream-latency
Add test which demonstrates how Mocknet latency works
2018-06-07 04:54:40 +00:00
Erin Swenson-Healey 2f001009f2 loosen tolerance in latency test 2018-06-06 07:49:29 -07:00
Erin Swenson-Healey bb9d55ac08 add test which demonstrates how Mocknet latency works 2018-06-05 17:35:18 -07:00
Steven Allen 41c6834850 refactor for transport changes
Also, make the libp2p constructor fully useful. There should now be no need to
manually construct a swarm/host.
2018-06-04 21:22:24 -07:00
Jakub Sztandera b6ae1d152a misc: downgrade a warning to info
It is source of most warning noise in Warning channel and we would like
to enable warning channel some time in future by default
2018-03-27 20:46:27 +02:00
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