summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Chestnykh <dmitry@codingrobots.com>2015-03-26 00:40:48 +0300
committerDmitry Chestnykh <dmitry@codingrobots.com>2015-03-26 00:41:01 +0300
commit9a1a995303506329f3fc682912d3baa7b937a724 (patch)
tree1d2fb3ff265cca400af11545c1a00900be596ccd
parent4b0af472301b1081c4821c65875c9f50824ebd3a (diff)
Add missing fileMutex read locking.
-rw-r--r--store.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/store.go b/store.go
index 24b466f..13cd1db 100644
--- a/store.go
+++ b/store.go
@@ -224,6 +224,8 @@ func (s *FilesystemStore) save(session *Session) error {
// load reads a file and decodes its content into session.Values.
func (s *FilesystemStore) load(session *Session) error {
filename := s.path + "session_" + session.ID
+ fileMutex.RLock()
+ defer fileMutex.RUnlock()
fdata, err := ioutil.ReadFile(filename)
if err != nil {
return err