mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
fixes for rpc:
- don't log normal EOF - fix ServeConn to block as documented R=rsc, msolo CC=golang-dev https://golang.org/cl/886043
This commit is contained in:
parent
d9254d00f9
commit
c701c38e13
1 changed files with 4 additions and 2 deletions
|
|
@ -313,7 +313,9 @@ func (server *serverType) input(conn io.ReadWriteCloser) {
|
|||
err := dec.Decode(req)
|
||||
if err != nil {
|
||||
if err == os.EOF || err == io.ErrUnexpectedEOF {
|
||||
if err == io.ErrUnexpectedEOF {
|
||||
log.Stderr("rpc: ", err)
|
||||
}
|
||||
break
|
||||
}
|
||||
s := "rpc: server cannot decode request: " + err.String()
|
||||
|
|
@ -377,7 +379,7 @@ func Register(rcvr interface{}) os.Error { return server.register(rcvr) }
|
|||
// ServeConn runs the server on a single connection. When the connection
|
||||
// completes, service terminates. ServeConn blocks; the caller typically
|
||||
// invokes it in a go statement.
|
||||
func ServeConn(conn io.ReadWriteCloser) { go server.input(conn) }
|
||||
func ServeConn(conn io.ReadWriteCloser) { server.input(conn) }
|
||||
|
||||
// Accept accepts connections on the listener and serves requests
|
||||
// for each incoming connection. Accept blocks; the caller typically
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue