Don't try and init the ring if the IP address is not in our range.

This commit is contained in:
Tom Wilkie committed 2015-07-28 14:12:42 +00:00
1 parent 10dbd9ad4c
commit da7ac78694
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