diff options
author | 2016-05-20 15:57:34 -0700 | |
---|---|---|
committer | 2016-05-20 15:57:34 -0700 | |
commit | 9b5f64019e5d9fd631184f37c42d923fe1745096 (patch) | |
tree | b74598cf68b40c554c7eb206529b62cc1c4e6feb /src/objective-c/GRPCClient/private/GRPCHost.m | |
parent | c68eb0609a11db31b81b709a049771908c547110 (diff) |
ObjC interface for using Cronet, and test for Cronet
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCHost.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCHost.m | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index 43166cbb52..06ed56d546 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -37,6 +37,7 @@ #include <grpc/grpc_security.h> #import <GRPCClient/GRPCCall.h> #import <GRPCClient/GRPCCall+ChannelArg.h> +#import <GRPCClient/GRPCCall+Cronet.h> #import "GRPCChannel.h" #import "GRPCCompletionQueue.h" @@ -200,15 +201,21 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCChannel *)newChannel { NSDictionary *args = [self channelArgs]; + BOOL use_cronet = [GRPCCall isUsingCronet]; if (_secure) { GRPCChannel *channel; @synchronized(self) { if (_channelCreds == nil) { [self setTLSPEMRootCerts:nil withPrivateKey:nil withCertChain:nil error:nil]; } - channel = [GRPCChannel secureChannelWithHost:_address - credentials:_channelCreds - channelArgs:args]; + if (use_cronet) { + channel = [GRPCChannel secureCronetChannelWithHost:_address + channelArgs:args]; + } else { + channel = [GRPCChannel secureChannelWithHost:_address + credentials:_channelCreds + channelArgs:args]; + } } return channel; } else { |