URI:
       tUse a const for ddir's listening address - tordam - A library for peer discovery inside the Tor network
  HTML git clone https://git.parazyd.org/tordam
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 7a697d4ef254930b0eb9f9c7da12af1415ede4fd
   DIR parent 03e196797d988717545e5a571aed71e905907f8b
  HTML Author: parazyd <parazyd@dyne.org>
       Date:   Thu,  7 Dec 2017 19:15:27 +0100
       
       Use a const for ddir's listening address
       
       Diffstat:
         M go/ddir/ddir.go                     |      10 +++++++---
       
       1 file changed, 7 insertions(+), 3 deletions(-)
       ---
   DIR diff --git a/go/ddir/ddir.go b/go/ddir/ddir.go
       t@@ -10,6 +10,8 @@ import (
                "../lib"
        )
        
       +const ListenAddress = "127.0.0.1:8080"
       +
        type nodeStruct struct {
                Nodetype  string
                Address   string
       t@@ -17,7 +19,7 @@ type nodeStruct struct {
                Signature string
        }
        
       -func parsePost(rw http.ResponseWriter, request *http.Request) {
       +func handlePost(rw http.ResponseWriter, request *http.Request) {
                decoder := json.NewDecoder(request.Body)
        
                var n nodeStruct
       t@@ -34,9 +36,11 @@ func parsePost(rw http.ResponseWriter, request *http.Request) {
                if lib.ValidateReq(req) != true {
                        log.Fatalln("Request is not valid.")
                }
       +
        }
        
        func main() {
       -        http.HandleFunc("/announce", parsePost)
       -        http.ListenAndServe(":8080", nil)
       +        http.HandleFunc("/announce", handlePost)
       +        http.ListenAndServe(ListenAddress, nil)
       +        log.Println("Listening on", ListenAddress)
        }