Code Review
/
govpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
| inline |
side by side
Fix missing lock in LookupByID
[govpp.git]
/
core
/
request_handler.go
diff --git
a/core/request_handler.go
b/core/request_handler.go
index
7c185cd
..
27ff4fc
100644
(file)
--- a/
core/request_handler.go
+++ b/
core/request_handler.go
@@
-227,6
+227,9
@@
func (c *Connection) LookupByID(ID uint16) (string, error) {
return "", errors.New("nil connection passed in")
}
+ c.msgIDsLock.Lock()
+ defer c.msgIDsLock.Unlock()
+
for key, id := range c.msgIDs {
if id == ID {
return key, nil