Don't perform request to proxy if context is already done.

This commit is contained in:
Joachim Bauch 2020-09-16 09:23:36 +02:00
parent 7bd9ee07b8
commit 80194c4e1d
Failed to extract signature

View file

@ -816,6 +816,10 @@ func (c *mcuProxyConnection) performAsyncRequest(ctx context.Context, msg *Proxy
}
func (c *mcuProxyConnection) performSyncRequest(ctx context.Context, msg *ProxyClientMessage) (*ProxyServerMessage, error) {
if err := ctx.Err(); err != nil {
return nil, err
}
errChan := make(chan error, 1)
responseChan := make(chan *ProxyServerMessage, 1)
c.performAsyncRequest(ctx, msg, func(err error, response *ProxyServerMessage) {