rpc: Add RPC client tests. (#2858)

This commit is contained in:
Harshavardhana
2016-10-06 02:30:54 -07:00
committed by GitHub
parent 0fc96fa25c
commit 64f37bbf5b
8 changed files with 221 additions and 15 deletions

View File

@@ -85,8 +85,7 @@ func (rpcClient *RPCClient) dialRPCClient() (*rpc.Client, error) {
}
io.WriteString(conn, "CONNECT "+rpcClient.rpcPath+" HTTP/1.0\n\n")
// Require successful HTTP response
// before switching to RPC protocol.
// Require successful HTTP response before switching to RPC protocol.
resp, err := http.ReadResponse(bufio.NewReader(conn), &http.Request{Method: "CONNECT"})
if err == nil && resp.Status == "200 Connected to Go RPC" {
rpc := rpc.NewClient(conn)