commit 90ec84166a4843ff854ca032abc5c4054679ef2c
parent 3221352d72e482cfc85c9f1cfb231786f0770419
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
time through the entrypoint.
Diffstat:
2 files changed, 0 insertions(+), 17 deletions(-)
diff --git a/cmd/dam-client/main.go b/cmd/dam-client/main.go
@@ -34,7 +34,6 @@ import (
"math/big"
"os"
"os/exec"
- "strconv"
"strings"
"sync"
"time"
@@ -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 {
@@ -200,7 +194,6 @@ func fetchDirlist(locations []string) ([]string, error) {
dirSlice = dirSlice[:len(dirSlice)-1]
}
}
- dirlist = append(dirlist, "localhost")
return dirlist, nil
}
diff --git a/cmd/dam-dir/main.go b/cmd/dam-dir/main.go
@@ -27,7 +27,6 @@ import (
"net/http"
"os"
"os/exec"
- "strings"
"sync"
"time"
@@ -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" {