listObjects: Cleanup and naming conventions.

- Marker should be escaped outside in handlers.

- Delimiter should be handled outside in handlers.

- Add missing comments and change the function names.

- Handle case of 'maxKeys' when its set to '0', its a valid

  case and should be treated as such.
This commit is contained in:
Harshavardhana
2016-04-04 19:55:07 -07:00
committed by Anand Babu (AB) Periasamy
parent 85ab1df5a8
commit c69fdf0cf2
12 changed files with 154 additions and 111 deletions

35
fs.go
View File

@@ -58,41 +58,6 @@ type multiparts struct {
ActiveSession map[string]*multipartSession `json:"activeSessions"`
}
func (fs *Filesystem) pushTreeWalker(params listObjectParams, walker *treeWalker) {
fs.listObjectMapMutex.Lock()
defer fs.listObjectMapMutex.Unlock()
walkers, _ := fs.listObjectMap[params]
walkers = append(walkers, walker)
fs.listObjectMap[params] = walkers
}
func (fs *Filesystem) popTreeWalker(params listObjectParams) *treeWalker {
fs.listObjectMapMutex.Lock()
defer fs.listObjectMapMutex.Unlock()
if walkers, ok := fs.listObjectMap[params]; ok {
for i, walker := range walkers {
if !walker.timedOut {
newWalkers := walkers[i+1:]
if len(newWalkers) > 0 {
fs.listObjectMap[params] = newWalkers
} else {
delete(fs.listObjectMap, params)
}
return walker
}
}
// As all channels are timed out, delete the map entry
delete(fs.listObjectMap, params)
}
return nil
}
// newFS instantiate a new filesystem.
func newFS(rootPath string) (ObjectAPI, *probe.Error) {
setFSMultipartsMetadataPath(filepath.Join(rootPath, "$multiparts-session.json"))