tRemove announcements to ourselves (localhost). - tordam - A library for peer discovery inside the Tor network (HTM) git clone https://git.parazyd.org/tordam (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 90ec84166a4843ff854ca032abc5c4054679ef2c (DIR) parent 3221352d72e482cfc85c9f1cfb231786f0770419 (HTM) Author: parazyd <parazyd@dyne.org> Date: Fri, 26 Oct 2018 17:53:54 +0200 Remove announcements to ourselves (localhost). There is no need for this, as we'll get the info somehow, most of the ttime through the entrypoint. Diffstat: M cmd/dam-client/main.go | 7 ------- M cmd/dam-dir/main.go | 10 ---------- 2 files changed, 0 insertions(+), 17 deletions(-) --- (DIR) diff --git a/cmd/dam-client/main.go b/cmd/dam-client/main.go t@@ -34,7 +34,6 @@ import ( "math/big" "os" "os/exec" - "strconv" "strings" "sync" "time" t@@ -52,11 +51,6 @@ func announce(dir string, vals map[string]string, privkey *rsa.PrivateKey) (bool return false, err } - if dir == "localhost" || dir == "127.0.0.1" { - // Modify the string if we are authenticating to ourself. - dir += ":" + strconv.Itoa(lib.DirPort) - } - log.Println("Announcing keypair to:", dir) resp, err := lib.HTTPPost("http://"+dir+"/announce", msg) if err != nil { t@@ -200,7 +194,6 @@ func fetchDirlist(locations []string) ([]string, error) { dirSlice = dirSlice[:len(dirSlice)-1] } } - dirlist = append(dirlist, "localhost") return dirlist, nil } (DIR) diff --git a/cmd/dam-dir/main.go b/cmd/dam-dir/main.go t@@ -27,7 +27,6 @@ import ( "net/http" "os" "os/exec" - "strings" "sync" "time" t@@ -149,15 +148,6 @@ func handlePost(rw http.ResponseWriter, request *http.Request) { lib.CheckError(err) us := request.Host // Assume our name is what was requested as the URL. - if strings.HasPrefix(us, "localhost") { - // No need to propagate to ourself. - ret = map[string]string{"secret": lib.WelcomeMsg} - if err := postback(rw, ret, 200); err != nil { - lib.CheckError(err) - } - return - } - nodemap := make(map[string]map[string]string) if hasConsensus == "1" {