Syncbase Discovery: Expose the invites API via JNI / Java.
MultiPart: 2/3
Change-Id: I952e2af96bff0753f33de4048ac9936dca8feac2
diff --git a/services/syncbase/discovery/discovery.go b/services/syncbase/discovery/discovery.go
index baeaff4..2688d27 100644
--- a/services/syncbase/discovery/discovery.go
+++ b/services/syncbase/discovery/discovery.go
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package syncbase
+package discovery
import (
+ "bytes"
"fmt"
"sort"
"strings"
@@ -330,6 +331,15 @@
nextCursorId int
}
+func (q *inviteQueue) debugLocked() string {
+ buf := &bytes.Buffer{}
+ fmt.Fprintf(buf, "*%p", &q.sentinel)
+ for c := q.sentinel.next; c != &q.sentinel; c = c.next {
+ fmt.Fprintf(buf, " %p", c)
+ }
+ return buf.String()
+}
+
type ielement struct {
invite Invite
prev, next *ielement
@@ -398,6 +408,7 @@
delete(q.cursors, cursor)
return Invite{}, false
}
+ c = q.cursors[cursor]
}
c = c.next
q.cursors[cursor] = c
@@ -439,6 +450,6 @@
func (i Invite) copy() Invite {
cp := i
- cp.Addresses = append([]string{}, i.Addresses...)
+ cp.Addresses = append([]string(nil), i.Addresses...)
return cp
}
diff --git a/services/syncbase/discovery/discovery_internal_test.go b/services/syncbase/discovery/discovery_internal_test.go
index 834267d..1ed80e1 100644
--- a/services/syncbase/discovery/discovery_internal_test.go
+++ b/services/syncbase/discovery/discovery_internal_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package syncbase
+package discovery
import (
"bytes"
diff --git a/services/syncbase/discovery/discovery_test.go b/services/syncbase/discovery/discovery_test.go
index 5928c6a..85bbb3a 100644
--- a/services/syncbase/discovery/discovery_test.go
+++ b/services/syncbase/discovery/discovery_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package syncbase_test
+package discovery_test
import (
"fmt"