Browse Source

rename variables

pull/357/merge
Chris Lu 8 years ago
parent
commit
7ecc0f4b11
  1. 6
      weed/command/filer.go
  2. 10
      weed/server/filer_server.go

6
weed/command/filer.go

@ -83,8 +83,8 @@ func runFiler(cmd *Command, args []string) bool {
glog.Fatalf("Check Meta Folder (-dir) Writable %s : %s", *f.dir, err) glog.Fatalf("Check Meta Folder (-dir) Writable %s : %s", *f.dir, err)
} }
r := http.NewServeMux()
_, nfs_err := weed_server.NewFilerServer(r, *f.ip, *f.port, *f.master, *f.dir, *f.collection,
defaultMux := http.NewServeMux()
_, nfs_err := weed_server.NewFilerServer(defaultMux, *f.ip, *f.port, *f.master, *f.dir, *f.collection,
*f.defaultReplicaPlacement, *f.redirectOnRead, *f.disableDirListing, *f.defaultReplicaPlacement, *f.redirectOnRead, *f.disableDirListing,
*f.confFile, *f.confFile,
*f.maxMB, *f.maxMB,
@ -103,7 +103,7 @@ func runFiler(cmd *Command, args []string) bool {
if e != nil { if e != nil {
glog.Fatalf("Filer listener error: %v", e) glog.Fatalf("Filer listener error: %v", e)
} }
if e := http.Serve(filerListener, r); e != nil {
if e := http.Serve(filerListener, defaultMux); e != nil {
glog.Fatalf("Filer Fail to serve: %v", e) glog.Fatalf("Filer Fail to serve: %v", e)
} }

10
weed/server/filer_server.go

@ -57,7 +57,7 @@ type FilerServer struct {
masterNodes *storage.MasterNodes masterNodes *storage.MasterNodes
} }
func NewFilerServer(r *http.ServeMux, ip string, port int, master string, dir string, collection string,
func NewFilerServer(defaultMux *http.ServeMux, ip string, port int, master string, dir string, collection string,
replication string, redirectOnRead bool, disableDirListing bool, replication string, redirectOnRead bool, disableDirListing bool,
confFile string, confFile string,
maxMB int, maxMB int,
@ -105,12 +105,12 @@ func NewFilerServer(r *http.ServeMux, ip string, port int, master string, dir st
return return
} }
r.HandleFunc("/admin/mv", fs.moveHandler)
r.HandleFunc("/admin/register", fs.registerHandler)
r.HandleFunc("/__api__", fs.apiHandler)
defaultMux.HandleFunc("/admin/mv", fs.moveHandler)
defaultMux.HandleFunc("/admin/register", fs.registerHandler)
defaultMux.HandleFunc("/__api__", fs.apiHandler)
} }
r.HandleFunc("/", fs.filerHandler)
defaultMux.HandleFunc("/", fs.filerHandler)
go func() { go func() {
connected := true connected := true

Loading…
Cancel
Save