Skip to content
Snippets Groups Projects
Commit 1656a823 authored by Jake Taylor's avatar Jake Taylor
Browse files

revert some stuff

parent 8f69fe6e
No related branches found
No related tags found
3 merge requests!510Release,!365attempt to fix mutex segfault in HandleReceivedRequest,!354Channels impl
......@@ -242,8 +242,9 @@ func (s *Store) HandleReceivedRequest(partner *id.ID, handler func(*ReceivedRequ
s.mux.RLock()
rr, ok := s.receivedByID[*partner]
s.mux.RUnlock()
if !ok {
s.mux.RUnlock()
return errors.Errorf("Received request not "+
"found: %s", partner)
}
......@@ -252,8 +253,17 @@ func (s *Store) HandleReceivedRequest(partner *id.ID, handler func(*ReceivedRequ
rr.mux.Lock()
defer rr.mux.Unlock()
// Check that the request still exists; it could have been deleted while the
// lock was taken
s.mux.RLock()
_, ok = s.receivedByID[*partner]
s.mux.RUnlock()
if !ok {
return errors.Errorf("Received request not "+
"found: %s", partner)
}
//run the handler
handleErr := handler(rr)
if handleErr != nil {
......
......@@ -6,7 +6,6 @@ require (
github.com/cloudflare/circl v1.2.0
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
github.com/golang/protobuf v1.5.2
github.com/hack-pad/go-indexeddb v0.2.0
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/pkg/errors v0.9.1
github.com/pkg/profile v1.6.0
......@@ -33,6 +32,7 @@ require (
github.com/badoux/checkmail v1.2.1 // indirect
github.com/elliotchance/orderedmap v1.4.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/hack-pad/go-indexeddb v0.2.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment