author | Alberto Bertogli
<albertito@blitiri.com.ar> 2018-04-07 12:35:26 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2018-04-08 08:34:34 UTC |
parent | 91ae2c03fd2dd7d1c753f8c24acb6926f3ed4dfe |
dnss.go | +3 | -3 |
dnss_test.go | +3 | -3 |
internal/{httpstodns => httpserver}/parser_test.go | +1 | -1 |
internal/{httpstodns => httpserver}/server.go | +3 | -3 |
diff --git a/dnss.go b/dnss.go index 7c484ef..0b5ed7a 100644 --- a/dnss.go +++ b/dnss.go @@ -21,7 +21,7 @@ import ( "blitiri.com.ar/go/dnss/internal/dnsserver" "blitiri.com.ar/go/dnss/internal/dnstohttps" - "blitiri.com.ar/go/dnss/internal/httpstodns" + "blitiri.com.ar/go/dnss/internal/httpserver" "github.com/golang/glog" @@ -98,7 +98,7 @@ func main() { } if *insecureForTesting { - httpstodns.InsecureForTesting = true + httpserver.InsecureForTesting = true } var wg sync.WaitGroup @@ -132,7 +132,7 @@ func main() { // HTTPS to DNS. if *enableHTTPStoDNS { - s := httpstodns.Server{ + s := httpserver.Server{ Addr: *httpsAddr, Upstream: *dnsUpstream, CertFile: *httpsCertFile, diff --git a/dnss_test.go b/dnss_test.go index e1ab69b..44b97a5 100644 --- a/dnss_test.go +++ b/dnss_test.go @@ -12,7 +12,7 @@ import ( "blitiri.com.ar/go/dnss/internal/dnsserver" "blitiri.com.ar/go/dnss/internal/dnstohttps" - "blitiri.com.ar/go/dnss/internal/httpstodns" + "blitiri.com.ar/go/dnss/internal/httpserver" "blitiri.com.ar/go/dnss/internal/testutil" "github.com/golang/glog" "github.com/miekg/dns" @@ -51,11 +51,11 @@ func realMain(m *testing.M) int { go dtoh.ListenAndServe() // HTTPS to DNS server. - htod := httpstodns.Server{ + htod := httpserver.Server{ Addr: HTTPSToDNSAddr, Upstream: DNSServerAddr, } - httpstodns.InsecureForTesting = true + httpserver.InsecureForTesting = true go htod.ListenAndServe() // Fake DNS server. diff --git a/internal/httpstodns/parser_test.go b/internal/httpserver/parser_test.go similarity index 99% rename from internal/httpstodns/parser_test.go rename to internal/httpserver/parser_test.go index 746e774..37b84a1 100644 --- a/internal/httpstodns/parser_test.go +++ b/internal/httpserver/parser_test.go @@ -1,5 +1,5 @@ // Tests for the query parsing. -package httpstodns +package httpserver import ( "net" diff --git a/internal/httpstodns/server.go b/internal/httpserver/server.go similarity index 97% rename from internal/httpstodns/server.go rename to internal/httpserver/server.go index 6c75ae1..d734758 100644 --- a/internal/httpstodns/server.go +++ b/internal/httpserver/server.go @@ -1,6 +1,6 @@ -// Package httpstodns implements an HTTPS server which handles DNS requests +// Package httpserver implements an HTTPS server which handles DNS requests // over HTTPS. -package httpstodns +package httpserver import ( "encoding/json" @@ -55,7 +55,7 @@ func (s *Server) ListenAndServe() { // It implements an http.HandlerFunc so it can be used with any standard Go // HTTP server. func (s *Server) Resolve(w http.ResponseWriter, req *http.Request) { - tr := trace.New("httpstodns", "/resolve") + tr := trace.New("httpserver", "/resolve") defer tr.Finish() tr.LazyPrintf("from:%v", req.RemoteAddr)