diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-09-16 15:47:21 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-09-16 15:47:21 +0000 |
commit | adb0401dac41c81571722312d4586b2693f95aa6 (patch) | |
tree | ea2b52e3c258d6b6d9356977c683c7f72a4a5fd5 /libgo/go/rpc/client.go | |
parent | 5548ca3540bccbc908a45942896d635ea5f1c23f (diff) | |
download | gcc-adb0401dac41c81571722312d4586b2693f95aa6.zip gcc-adb0401dac41c81571722312d4586b2693f95aa6.tar.gz gcc-adb0401dac41c81571722312d4586b2693f95aa6.tar.bz2 |
Update Go library to r60.
From-SVN: r178910
Diffstat (limited to 'libgo/go/rpc/client.go')
-rw-r--r-- | libgo/go/rpc/client.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libgo/go/rpc/client.go b/libgo/go/rpc/client.go index 8af4afc..4acfdf6 100644 --- a/libgo/go/rpc/client.go +++ b/libgo/go/rpc/client.go @@ -23,7 +23,7 @@ func (e ServerError) String() string { return string(e) } -const ErrShutdown = os.ErrorString("connection is shut down") +var ErrShutdown = os.NewError("connection is shut down") // Call represents an active RPC. type Call struct { @@ -110,7 +110,7 @@ func (client *Client) input() { if response.Error == "" { err = client.codec.ReadResponseBody(c.Reply) if err != nil { - c.Error = os.ErrorString("reading body " + err.String()) + c.Error = os.NewError("reading body " + err.String()) } } else { // We've got an error response. Give this to the request; @@ -119,7 +119,7 @@ func (client *Client) input() { c.Error = ServerError(response.Error) err = client.codec.ReadResponseBody(nil) if err != nil { - err = os.ErrorString("reading error body: " + err.String()) + err = os.NewError("reading error body: " + err.String()) } } c.done() @@ -197,7 +197,6 @@ func (c *gobClientCodec) Close() os.Error { return c.rwc.Close() } - // DialHTTP connects to an HTTP RPC server at the specified network address // listening on the default HTTP RPC path. func DialHTTP(network, address string) (*Client, os.Error) { @@ -216,12 +215,12 @@ func DialHTTPPath(network, address, path string) (*Client, os.Error) { // Require successful HTTP response // before switching to RPC protocol. - resp, err := http.ReadResponse(bufio.NewReader(conn), "CONNECT") + resp, err := http.ReadResponse(bufio.NewReader(conn), &http.Request{Method: "CONNECT"}) if err == nil && resp.Status == connected { return NewClient(conn), nil } if err == nil { - err = os.ErrorString("unexpected HTTP response: " + resp.Status) + err = os.NewError("unexpected HTTP response: " + resp.Status) } conn.Close() return nil, &net.OpError{"dial-http", network + " " + address, nil, err} |