|
|
@ -461,10 +461,12 @@ const char *kCFStreamVarName = "grpc_cfstream"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
- (void)cancel { |
|
|
|
- (void)cancel { |
|
|
|
if (!self.isWaitingForToken) { |
|
|
|
@synchronized (self) { |
|
|
|
[self cancelCall]; |
|
|
|
if (!self.isWaitingForToken) { |
|
|
|
} else { |
|
|
|
[self cancelCall]; |
|
|
|
self.isWaitingForToken = NO; |
|
|
|
} else { |
|
|
|
|
|
|
|
self.isWaitingForToken = NO; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
[self |
|
|
|
[self |
|
|
|
maybeFinishWithError:[NSError |
|
|
|
maybeFinishWithError:[NSError |
|
|
@ -779,14 +781,18 @@ const char *kCFStreamVarName = "grpc_cfstream"; |
|
|
|
_callOptions = callOptions; |
|
|
|
_callOptions = callOptions; |
|
|
|
} |
|
|
|
} |
|
|
|
if (_callOptions.authTokenProvider != nil) { |
|
|
|
if (_callOptions.authTokenProvider != nil) { |
|
|
|
self.isWaitingForToken = YES; |
|
|
|
@synchronized (self) { |
|
|
|
|
|
|
|
self.isWaitingForToken = YES; |
|
|
|
|
|
|
|
} |
|
|
|
[self.tokenProvider getTokenWithHandler:^(NSString *token) { |
|
|
|
[self.tokenProvider getTokenWithHandler:^(NSString *token) { |
|
|
|
if (self.isWaitingForToken) { |
|
|
|
@synchronized (self) { |
|
|
|
if (token) { |
|
|
|
if (self.isWaitingForToken) { |
|
|
|
self->_fetchedOauth2AccessToken = [token copy]; |
|
|
|
if (token) { |
|
|
|
|
|
|
|
self->_fetchedOauth2AccessToken = [token copy]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[self startCallWithWriteable:writeable]; |
|
|
|
|
|
|
|
self.isWaitingForToken = NO; |
|
|
|
} |
|
|
|
} |
|
|
|
[self startCallWithWriteable:writeable]; |
|
|
|
|
|
|
|
self.isWaitingForToken = NO; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|