pprof does not need to inject middleware
This commit is contained in:
parent
9e9d72655d
commit
14b84ce02b
2 changed files with 3 additions and 18 deletions
|
@ -29,9 +29,5 @@ func PProf(c *Controller) (middleware.Middleware, error) {
|
||||||
c.Startup = append(c.Startup, handler.Start)
|
c.Startup = append(c.Startup, handler.Start)
|
||||||
c.Shutdown = append(c.Shutdown, handler.Shutdown)
|
c.Shutdown = append(c.Shutdown, handler.Shutdown)
|
||||||
})
|
})
|
||||||
|
return nil, nil
|
||||||
return func(next middleware.Handler) middleware.Handler {
|
|
||||||
handler.Next = next
|
|
||||||
return handler
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,22 +5,11 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
pp "net/http/pprof"
|
pp "net/http/pprof"
|
||||||
|
|
||||||
"github.com/miekg/coredns/middleware"
|
|
||||||
|
|
||||||
"github.com/miekg/dns"
|
|
||||||
"golang.org/x/net/context"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
||||||
Next middleware.Handler
|
ln net.Listener
|
||||||
ln net.Listener
|
mux *http.ServeMux
|
||||||
mux *http.ServeMux
|
|
||||||
}
|
|
||||||
|
|
||||||
// ServeDNS passes all other requests up the chain.
|
|
||||||
func (h *Handler) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
|
||||||
return h.Next.ServeDNS(ctx, w, r)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) Start() error {
|
func (h *Handler) Start() error {
|
||||||
|
|
Loading…
Add table
Reference in a new issue