From 7ecc0f4b11ab9dd860f7799881b024c0fbb5994c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 27 May 2017 18:11:18 -0700 Subject: [PATCH] rename variables --- weed/command/filer.go | 6 +++--- weed/server/filer_server.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/weed/command/filer.go b/weed/command/filer.go index 7d90707a6..2e1c9d1dc 100644 --- a/weed/command/filer.go +++ b/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) } - 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.confFile, *f.maxMB, @@ -103,7 +103,7 @@ func runFiler(cmd *Command, args []string) bool { if e != nil { 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) } diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go index 33b3677a5..467545dfd 100644 --- a/weed/server/filer_server.go +++ b/weed/server/filer_server.go @@ -57,7 +57,7 @@ type FilerServer struct { 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, confFile string, maxMB int, @@ -105,12 +105,12 @@ func NewFilerServer(r *http.ServeMux, ip string, port int, master string, dir st 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() { connected := true