Commit Graph

137 Commits

Author SHA1 Message Date
Juan Batiz-Benet a47b897105 added cancel func calls previously ignored 2015-03-07 09:31:46 -08:00
Alex 236dfd1e18 Implemented @jbenet's suggestion to avoid panics if peerID is of length 0. 2015-03-03 09:20:23 -08:00
Alex 4b52be2807 Fixed #780 2015-03-02 23:53:30 -08:00
Henry f71d1733dc godep&x/crypto: updated multihash and moved to x/crypto for blowfish 2015-03-01 00:49:44 +01:00
Henry e73da92c04 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01:00
Jeromy 83ea98ed5e fix weird race condition in goprocess that caused a few panics 2015-02-19 20:01:19 -08:00
Jeromy 1f0bbc476a allow removal of stream handlers 2015-02-18 19:11:37 +00:00
Jeromy 3281065076 keep routing logic out of NewStream on routedHost 2015-02-18 19:11:37 +00:00
Jeromy 90fa929051 make NewStream run FindPeer if no addresses found 2015-02-18 19:11:37 +00:00
Juan Batiz-Benet 01be69d391 routed host stash 2015-02-18 18:56:56 +00:00
Brian Tiger Chow 62d4f17057 misc: suppress logs to Debug (from Info) 2015-02-14 14:13:53 -08:00
Jeromy 9c83bd0959 fix for #757 2015-02-13 07:47:51 +00:00
Juan Batiz-Benet d2544da530 p2p/net/conn: respect context on dialing
We were half-way with this. there's no way for net.Dialers
to respect contexts, so we have to let the dial finish in
the background.
2015-02-11 09:12:15 -08:00
Juan Batiz-Benet 46b21cf5be ctx.Done fixes
thanks @whyrusleeping for finding these.
2015-02-09 23:18:23 -08:00
Juan Batiz-Benet 8a81975ce8 ratelimiter: fixing rate limiter use
Use of the ratelimiter should be conscious of the ratelimiter's
potential closing. any loops that add work to ratelimiter
should (a) only do so if the rate limiter is not closed,
or (b) prevent limiter while work is added
(i.e. use limiter.Go(addWorkHere))
2015-02-06 10:59:03 -08:00
Juan Batiz-Benet 381e99a375 p2p/protocol/identity: smarter tracking observed addrs
- time them out (already was doing that with addrbook)
- keep count to counter symmetric nats
2015-02-05 10:15:16 -08:00
Juan Batiz-Benet e13ad02f04 test/mocknet: this test fails on CI sometimes 2015-02-03 08:02:25 -08:00
Juan Batiz-Benet 72b70417a7 cmds/swarm connect had broken 2015-02-03 05:51:31 -08:00
Juan Batiz-Benet 3afbc9d8d9 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 e3e91a4d24 p2p/crypto/secio: dont bother user with mac errs. 2015-02-02 21:05:33 -08:00
Juan Batiz-Benet 46877f3f44 p2p/protocol/id: log version mismatch disconnects 2015-02-02 21:05:33 -08:00
Juan Batiz-Benet 884699e1e7 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 8b419c5de4 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 51709847e6 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 0f4e8fb460 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 5c3146fd84 p2p/peer/addr: manager with expirations 2015-02-02 21:04:13 -08:00
Juan Batiz-Benet eb99330909 log(secio): session loggable for event 2015-02-01 22:08:48 -08:00
Juan Batiz-Benet 6451bf2067 p2p/net/conn: log conn lifetime event 2015-02-01 22:08:48 -08:00
Brian Tiger Chow 9d4243027a doc(p2p/mux) rm stale comment 2015-02-01 21:54:20 -08:00
Brian Tiger Chow 71877e0142 fix(mux) hold lock when reading default handler field 2015-02-01 21:49:39 -08:00
Juan Batiz-Benet 6b1de9b801 p2p/conn: expose io.Closer interface 2015-02-01 06:35:48 -08:00
Juan Batiz-Benet 6e598fdfbf 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 e16d7d2c37 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 93655b428c 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 320d060948 log(secio) rm handshake console log (still has event log) 2015-01-30 06:57:41 -08:00
Brian Tiger Chow 3d43649d83 Merge pull request #699 from jbenet/net-set-listener
p2p/net: network interface Listen func
2015-01-30 06:52:14 -08:00
Juan Batiz-Benet bfe998f3e1 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
Juan Batiz-Benet f97f60a39c 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 04:13:02 -08:00
Jeromy 704625bceb fix nil pointer panic on version strings in ID message 2015-01-29 23:07:32 +00:00
Juan Batiz-Benet 39e858b0e9 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 bb57cf7795 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 9316957122 Merge pull request #676 from jbenet/dial-events
p2p/net: dial log -> events
2015-01-28 02:25:56 -08:00
Juan Batiz-Benet 837fca7bd4 p2p/net: cleaned up dial events
+ fixed race
2015-01-28 02:15:32 -08:00
Juan Batiz-Benet 96cad1347f p2p/net: better dial log.Event 2015-01-28 00:13:42 -08:00
Brian Tiger Chow 9510082ee2 remove message 2015-01-27 16:24:36 -08:00
Juan Batiz-Benet d53edf1763 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 9316acfaf7 p2p/peer/peerstore: mu position + comment 2015-01-26 22:47:44 -08:00
Juan Batiz-Benet 50c72a6765 p2p/peer/addr: addrbook RLock fix 2015-01-26 22:01:26 -08:00
Juan Batiz-Benet 8ae932da44 p2p/peer: addresses expire after an hour 2015-01-26 19:23:42 -08:00
Juan Batiz-Benet 77a9168a18 p2p/id: SET listen addrs, clearing old ones. 2015-01-26 19:23:42 -08:00