Skip to content

Commit

Permalink
rootio/cmd/root-srv/server: make sure file is at 0 before scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
sbinet committed Mar 27, 2017
1 parent da57990 commit c58ed3e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rootio/cmd/root-srv/server/plots.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ func (srv *server) plotBranchHandle(w http.ResponseWriter, r *http.Request) erro
tname = fmt.Sprintf("[%d]%s", leaf.Len(), tname)
}

_, err = f.Seek(0, 0) // FIXME(sbinet): factor this into rootio.Scanner
if err != nil {
return fmt.Errorf("error seeking to beginning of file: %v", err)
}

sc, err := rootio.NewScannerVars(tree, rootio.ScanVar{Name: leaf.Name()})
if err != nil {
return fmt.Errorf("error creating scanner for branch %q in tree %q of file %q: %v", bname, tree.Name(), fname, err)
Expand Down

0 comments on commit c58ed3e

Please sign in to comment.