|
|
|
@ -461,11 +461,13 @@ const char *kCFStreamVarName = "grpc_cfstream"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
- (void)cancel { |
|
|
|
|
@synchronized (self) { |
|
|
|
|
if (!self.isWaitingForToken) { |
|
|
|
|
[self cancelCall]; |
|
|
|
|
} else { |
|
|
|
|
self.isWaitingForToken = NO; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
[self |
|
|
|
|
maybeFinishWithError:[NSError |
|
|
|
|
errorWithDomain:kGRPCErrorDomain |
|
|
|
@ -779,8 +781,11 @@ const char *kCFStreamVarName = "grpc_cfstream"; |
|
|
|
|
_callOptions = callOptions; |
|
|
|
|
} |
|
|
|
|
if (_callOptions.authTokenProvider != nil) { |
|
|
|
|
@synchronized (self) { |
|
|
|
|
self.isWaitingForToken = YES; |
|
|
|
|
} |
|
|
|
|
[self.tokenProvider getTokenWithHandler:^(NSString *token) { |
|
|
|
|
@synchronized (self) { |
|
|
|
|
if (self.isWaitingForToken) { |
|
|
|
|
if (token) { |
|
|
|
|
self->_fetchedOauth2AccessToken = [token copy]; |
|
|
|
@ -788,6 +793,7 @@ const char *kCFStreamVarName = "grpc_cfstream"; |
|
|
|
|
[self startCallWithWriteable:writeable]; |
|
|
|
|
self.isWaitingForToken = NO; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}]; |
|
|
|
|
} else { |
|
|
|
|
[self startCallWithWriteable:writeable]; |
|
|
|
|