Commit 3747716b authored by Steven Allen's avatar Steven Allen

always cancel the request context when calling reqCancel

Also, fix a nil pointer error.
parent a8212f94
......@@ -168,6 +168,8 @@ func (c *client) Send(req *cmds.Request) (cmds.Response, error) {
return nil, err
}
req.Context, reqCancel = context.WithTimeout(req.Context, timeout)
} else {
req.Context, reqCancel = context.WithCancel(req.Context)
}
httpReq = httpReq.WithContext(req.Context)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment