aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-10-18 15:22:38 -0700
committerGravatar Muxi Yan <mxyan@google.com>2018-10-18 15:22:38 -0700
commit1084f49c310b62ff5a06fa5f6c262f813dce75a5 (patch)
tree354586b39fa2ff7a091581fddabf3e6e841ecbe5 /src/objective-c/GRPCClient/private
parentd92c62fcde8559393aee346e5518faecb6f1301b (diff)
rename kHostCache->gHostCache
Diffstat (limited to 'src/objective-c/GRPCClient/private')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index 6bb5996a1b..c1992b84e9 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -35,7 +35,7 @@
NS_ASSUME_NONNULL_BEGIN
-static NSMutableDictionary *kHostCache;
+static NSMutableDictionary *gHostCache;
@implementation GRPCHost {
NSString *_PEMRootCertificates;
@@ -65,10 +65,10 @@ static NSMutableDictionary *kHostCache;
// Look up the GRPCHost in the cache.
static dispatch_once_t cacheInitialization;
dispatch_once(&cacheInitialization, ^{
- kHostCache = [NSMutableDictionary dictionary];
+ gHostCache = [NSMutableDictionary dictionary];
});
- @synchronized(kHostCache) {
- GRPCHost *cachedHost = kHostCache[address];
+ @synchronized(gHostCache) {
+ GRPCHost *cachedHost = gHostCache[address];
if (cachedHost) {
return cachedHost;
}
@@ -76,15 +76,15 @@ static NSMutableDictionary *kHostCache;
if ((self = [super init])) {
_address = address;
_retryEnabled = YES;
- kHostCache[address] = self;
+ gHostCache[address] = self;
}
}
return self;
}
+ (void)resetAllHostSettings {
- @synchronized(kHostCache) {
- kHostCache = [NSMutableDictionary dictionary];
+ @synchronized(gHostCache) {
+ gHostCache = [NSMutableDictionary dictionary];
}
}
@@ -140,8 +140,8 @@ static NSMutableDictionary *kHostCache;
address = [hostURL.host stringByAppendingString:@":443"];
}
__block GRPCHost *cachedHost;
- @synchronized (kHostCache) {
- cachedHost = kHostCache[address];
+ @synchronized (gHostCache) {
+ cachedHost = gHostCache[address];
}
return (cachedHost != nil);
}