From ec8c352d5f8bdc1af1fd09a79b9bbaac9ce348ec Mon Sep 17 00:00:00 2001 From: crusader Date: Sat, 28 Apr 2018 23:58:03 +0900 Subject: [PATCH] ing --- client/client.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/client/client.go b/client/client.go index 848a7f8..ca391da 100644 --- a/client/client.go +++ b/client/client.go @@ -82,19 +82,9 @@ func (c *Client) logHeader() string { } func (c *Client) Send(method string, params ...interface{}) error { - rs, err := c.internalSend(false, nil, method, params...) - if nil != err { - return err - } + _, err := c.internalSend(false, nil, method, params...) - defer releaseRequestState(rs) - select { - case <-rs.doneChan: - if nil != rs.clientError { - return rs.clientError - } - } - return nil + return err } func (c *Client) Call(result interface{}, method string, params ...interface{}) error { @@ -133,10 +123,10 @@ func (c *Client) internalSend(hasResponse bool, result interface{}, method strin rs.method = method rs.params = params - rs.doneChan = make(chan *requestState, 1) if hasResponse { rs.id = c.getRequestID() rs.result = result + rs.doneChan = make(chan *requestState, 1) } select {