Skip to content

Commit c4ef855

Browse files
authored
Merge pull request grpc#17751 from muxi/fix-authorizer
Fix authorizer
2 parents 3f8e15e + e8eac7c commit c4ef855

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/objective-c/GRPCClient/GRPCCall.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,14 +889,18 @@ - (void)startWithWriteable:(id<GRXWriteable>)writeable {
889889
[tokenProvider getTokenWithHandler:^(NSString *token) {
890890
__strong typeof(self) strongSelf = weakSelf;
891891
if (strongSelf) {
892+
BOOL startCall = NO;
892893
@synchronized(strongSelf) {
893-
if (strongSelf->_state == GRXWriterStateNotStarted) {
894+
if (strongSelf->_state != GRXWriterStateFinished) {
895+
startCall = YES;
894896
if (token) {
895897
strongSelf->_fetchedOauth2AccessToken = [token copy];
896898
}
897899
}
898900
}
899-
[strongSelf startCallWithWriteable:writeable];
901+
if (startCall) {
902+
[strongSelf startCallWithWriteable:writeable];
903+
}
900904
}
901905
}];
902906
} else {

0 commit comments

Comments
 (0)