Commit Graph

119 Commits

Author SHA1 Message Date
Juan Batiz-Benet
cc6a78419b test/mocknet: this test fails on CI sometimes 2015-02-03 08:02:25 -08:00
Juan Batiz-Benet
10cd499a8b cmds/swarm connect had broken 2015-02-03 05:51:31 -08:00
Juan Batiz-Benet
58f39687cf logs: removed all log.Errors unhelpful to users
Let's save log.Error for things the user can take action on.
Moved all our diagnostics to log.Debug. We can ideally reduce them
even further.
2015-02-03 01:06:07 -08:00
Juan Batiz-Benet
9ba450b425 p2p/crypto/secio: dont bother user with mac errs. 2015-02-02 21:05:33 -08:00
Juan Batiz-Benet
37007b9c2b p2p/protocol/id: log version mismatch disconnects 2015-02-02 21:05:33 -08:00
Juan Batiz-Benet
690619145a p2p/protocol/id: break on version mismatch.
TODOs:
- need to consolidate all the versioning stuff into one package
- need to do the version check as a handshake, before further
  communication happens. we used to do this.
2015-02-02 21:05:32 -08:00
Juan Batiz-Benet
6b4664fc8b p2p/net/swarm: permute addrs in rate limited dials
so that we dont get stuck dialing bad addrs first always.
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
793048d310 p2p/net/swarm: rate limit dials. max of 10 addrs at a time.
This will mitigate the fd explosion, but slow down dials majorly
as any peer with more addresses than the rate limit will have
to wait a whole dial timeout (~15s)
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
e908effb4b AddrManager: use addr manager with smarter TTLs
This addr manager should seriously help with the addrsplosion
problem.
2015-02-02 21:04:14 -08:00
Juan Batiz-Benet
8b98c8fbdc p2p/peer/addr: manager with expirations 2015-02-02 21:04:13 -08:00
Juan Batiz-Benet
81e7c2b84e log(secio): session loggable for event 2015-02-01 22:08:48 -08:00
Juan Batiz-Benet
7c7ec14109 p2p/net/conn: log conn lifetime event 2015-02-01 22:08:48 -08:00
Brian Tiger Chow
b47241a762 doc(p2p/mux) rm stale comment 2015-02-01 21:54:20 -08:00
Brian Tiger Chow
ecddbd3a56 fix(mux) hold lock when reading default handler field 2015-02-01 21:49:39 -08:00
Juan Batiz-Benet
fc78f20093 p2p/conn: expose io.Closer interface 2015-02-01 06:35:48 -08:00
Juan Batiz-Benet
763cc945c0 p2p/host: nat manager
this commit moves management of the nat to its own object.
perhaps this can be general enough to work with any host
(not just BasicHost), but for now keeping here.

the nat manager:
- discovers and sets up the nat asynchronously.
- adds any port mappings necessary if/after nat has been found.
- listens to the network Listen() changes, adding/closing mappings
2015-01-30 20:37:53 -08:00
Juan Batiz-Benet
d7c9ae12ac p2p/nat: make nat mappings closable by client
After this commit, client can close individual mappings (without
closing the whole NAT)
2015-01-30 20:37:53 -08:00
Juan Batiz-Benet
98f2b0779f p2p/net: notify on listens
Network now signals when it successfully listens on some address
or when an address shuts down. This will be used to establish and
close nat port mappings. It could also be used to notify peers
of address changes.
2015-01-30 20:37:52 -08:00
Brian Tiger Chow
d98b05497f log(secio) rm handshake console log (still has event log) 2015-01-30 06:57:41 -08:00
Juan Batiz-Benet
df0967d6ee p2p/net: network interface Listen func
network interface now allows setting Listeners after the fact.
This is useful to create the network and start listening as
separate steps. And to keep the network up to date on new
addresses the node might have to listen to.
2015-01-30 06:51:29 -08:00
Jeromy
97e99ca167 fix nil pointer panic on version strings in ID message 2015-01-29 23:07:32 +00:00
Juan Batiz-Benet
1ce3ecf846 swarm: TestSimultOpenMany has problems in CI.
dialing 4000 connections somehow keeps choking both travis and
jenkins. dialing this down to 500
2015-01-29 01:25:54 -08:00
Juan Batiz-Benet
81bb548d23 p2p/net/swarm: fix TestDialBackoff
- attempts set to 1 now.
- timeouts must account for that.
2015-01-28 15:49:54 -08:00
Juan Batiz-Benet
56b14d8e9e Merge pull request #676 from jbenet/dial-events
p2p/net: dial log -> events
2015-01-28 02:25:56 -08:00
Juan Batiz-Benet
eb79770683 p2p/net: cleaned up dial events
+ fixed race
2015-01-28 02:15:32 -08:00
Juan Batiz-Benet
b4af146fc8 p2p/net: better dial log.Event 2015-01-28 00:13:42 -08:00
Brian Tiger Chow
a58f3c3bfe remove message 2015-01-27 16:24:36 -08:00
Juan Batiz-Benet
9dac5bb7d3 p2p/net: dial log -> events
This commit turns all dial logs into log.Events.

Everything's great except for one problem:
The LoggableMap I'm using does not print out things
correctly. I gave it peer.IDs, and Multiaddrs
and both got logged as nothing `{}` (didn't even call
their String() methods!) So, for now, this function
encodes it when called... This is wrong and should be
fixed before being merged in. Otherwise we  will be
constantly encoding peer.IDs and Multiaddrs without
needing to.

@briantigerchow how do you suggest doing this?
I don't know my way around your Loggable.
2015-01-27 01:35:37 -08:00
Juan Batiz-Benet
71f2c4dee0 p2p/peer/peerstore: mu position + comment 2015-01-26 22:47:44 -08:00
Juan Batiz-Benet
d8a63be372 p2p/peer/addr: addrbook RLock fix 2015-01-26 22:01:26 -08:00
Juan Batiz-Benet
983822f335 p2p/peer: addresses expire after an hour 2015-01-26 19:23:42 -08:00
Juan Batiz-Benet
3118777a5e p2p/id: SET listen addrs, clearing old ones. 2015-01-26 19:23:42 -08:00
Juan Batiz-Benet
56d900fa10 p2p/peer: addressbook can now clear addrs 2015-01-26 19:23:42 -08:00
Juan Batiz-Benet
45e4352c9c dropped down log.Errors 2015-01-26 19:13:44 -08:00
Juan Batiz-Benet
76d9d89aff user friendliness in logs + output 2015-01-26 17:01:00 -08:00
Juan Batiz-Benet
2c13280b5e p2p/host: doc options 2015-01-26 15:02:32 -08:00
Juan Batiz-Benet
158f5061e0 p2p: own addresses gotten from host 2015-01-26 14:00:00 -08:00
Juan Batiz-Benet
fda92754cc p2p/net/conn: reuse timeout is real error
should be returning false.
2015-01-26 14:00:00 -08:00
Juan Batiz-Benet
ca757c66ff p2p/nat: managed by host now.
Exposing the NAT to the core is unnecessary. The Host can take
care of it. If a need emerges, we can address it then.
2015-01-26 14:00:00 -08:00
Juan Batiz-Benet
332d350196 p2p/nat: re-factors nat object
- allow retrieving addresses
- allow notifications on mapping changes
- allow lifecycle mgmt (future commit will manage it)
2015-01-26 13:45:02 -08:00
Juan Batiz-Benet
069cff3d25 p2p/nat: upnp + pmp 2015-01-24 12:42:22 -08:00
Juan Batiz-Benet
6c6dcfce2b Merge pull request #640 from jbenet/races
more races 2015-01-24
2015-01-24 10:49:42 -08:00
Juan Batiz-Benet
a7bc7bd0e8 p2p/net/swarm: TestDialBackoffClears CI Timeout
increased the timeout for other CI too
2015-01-24 10:41:13 -08:00
Juan Batiz-Benet
87458f6d6a p2p/net/dial: fixed data race 2015-01-24 10:22:56 -08:00
Juan Batiz-Benet
4ae01e7a5e p2p/net/swarm: notifications 2015-01-24 09:13:44 -08:00
Brian Tiger Chow
6fedf259eb remove prefix logger 2015-01-24 00:30:56 -08:00
Jeromy
ec5276c29c really ugly impl of 'ipfs dht query' command 2015-01-24 03:56:45 +00:00
Juan Batiz-Benet
5c33b75b59 p2p/net/conn: timeouts are real failures. 2015-01-23 05:25:32 -08:00
Juan Batiz-Benet
773ee2e25d p2p/proto/id: more helpful log 2015-01-23 02:08:29 -08:00
Juan Batiz-Benet
8e9413bd57 p2p/proto/mux: make log more useful 2015-01-23 02:08:29 -08:00