Merge pull request #1228 from weaveworks/1030-150-connect-forget

Don't init the ring if the address is not in range.

Fixes #1030.
This commit is contained in:
Matthias Radestock committed 2015-07-28 15:29:16 +01:00
commit 820307dd4e
3 files changed
+4 -1

No files matched your search

+2
View File
@@ -35,6 +35,8 @@ func (g *allocate) Try(alloc *Allocator) bool {
return true
}
alloc.establishRing()
if ok, addr := alloc.space.Allocate(g.r); ok {
alloc.debugln("Allocated", addr, "for", g.ident, "in", g.r)
alloc.addOwned(g.ident, addr)
-1
View File
@@ -95,7 +95,6 @@ func (alloc *Allocator) doOperation(op operation, ops *[]operation) {
op.Cancel()
return
}
alloc.establishRing()
if !op.Try(alloc) {
*ops = append(*ops, op)
}
+2
View File
@@ -38,6 +38,8 @@ func (c *claim) Try(alloc *Allocator) bool {
return true
}
alloc.establishRing()
switch owner := alloc.ring.Owner(c.addr); owner {
case alloc.ourName:
// success