ttrpc: return correct error on (*Client).Close

Because `shutdownErr` will likely be `nil` in the close select branch,
returning it to waiters will result in the waiting `(*Client).Call`
returning `(nil, nil)`. This should take whatever is set for the client
as the exit condition, which is likely to be `ErrClosed`.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2018-01-12 16:21:27 -08:00
parent d2710463e4
commit 2c96d0a152
No known key found for this signature in database
GPG Key ID: 67B3DED84EDC823F

View File

@ -199,7 +199,7 @@ func (c *Client) run() {
} }
// broadcast the shutdown error to the remaining waiters. // broadcast the shutdown error to the remaining waiters.
for _, waiter := range waiters { for _, waiter := range waiters {
waiter.errs <- shutdownErr waiter.errs <- c.err
} }
return return
} }