Skip to content

Commit 3fa96ef

Browse files
committed
remove determineIdentifier (auto ID)
at least for now, may bring this functionality back ref #19
1 parent 54aab15 commit 3fa96ef

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

session.go

-23
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ type session struct {
6666
st sessionState
6767
stm sync.Mutex
6868

69-
id uint32
70-
idm sync.Mutex
71-
7269
err NotificationResult
7370
}
7471

@@ -79,7 +76,6 @@ func NewSession(conn Conn) Session {
7976
stm: sync.Mutex{},
8077
conn: conn,
8178
connm: sync.Mutex{},
82-
idm: sync.Mutex{},
8379
b: newBuffer(50),
8480
}
8581
}
@@ -124,9 +120,6 @@ func (s *session) Send(n Notification) error {
124120
return errors.New("not connected")
125121
}
126122

127-
// Set identifier if not specified
128-
n.Identifier = s.determineIdentifier(n.Identifier)
129-
130123
// Serialize
131124
b, err := n.ToBinary()
132125
if err != nil {
@@ -195,22 +188,6 @@ func (s *session) transitionState(st sessionState) {
195188
s.st = st
196189
}
197190

198-
func (s *session) determineIdentifier(n uint32) uint32 {
199-
s.idm.Lock()
200-
defer s.idm.Unlock()
201-
202-
// If the id passed in is 0, that means it wasn't
203-
// set so get the next ID. Otherwise, set it to that
204-
// identifier.
205-
if n == 0 {
206-
s.id++
207-
} else {
208-
s.id = n
209-
}
210-
211-
return s.id
212-
}
213-
214191
func (s *session) readErrors() {
215192
p := make([]byte, 6, 6)
216193

0 commit comments

Comments
 (0)