mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
http: revised http Handler interface
R=rsc CC=golang-dev https://golang.org/cl/1993043
This commit is contained in:
parent
ffdb855be1
commit
fd9a5d22c6
11 changed files with 338 additions and 308 deletions
|
|
@ -62,7 +62,7 @@ func (m methodArray) Less(i, j int) bool { return m[i].name < m[j].name }
|
|||
func (m methodArray) Swap(i, j int) { m[i], m[j] = m[j], m[i] }
|
||||
|
||||
// Runs at /debug/rpc
|
||||
func debugHTTP(c *http.Conn, req *http.Request) {
|
||||
func debugHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
// Build a sorted version of the data.
|
||||
var services = make(serviceArray, len(server.serviceMap))
|
||||
i := 0
|
||||
|
|
@ -79,8 +79,8 @@ func debugHTTP(c *http.Conn, req *http.Request) {
|
|||
}
|
||||
server.Unlock()
|
||||
sort.Sort(services)
|
||||
err := debug.Execute(services, c)
|
||||
err := debug.Execute(services, w)
|
||||
if err != nil {
|
||||
fmt.Fprintln(c, "rpc: error executing template:", err.String())
|
||||
fmt.Fprintln(w, "rpc: error executing template:", err.String())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue