diff options
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCHost.m')
-rw-r--r-- | src/objective-c/GRPCClient/private/GRPCHost.m | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index 862909f238..85b95dee91 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -69,7 +69,7 @@ static NSMutableDictionary *kHostCache; // gRPC library. // TODO(jcanizales): Add unit tests for the types of addresses we want to let pass untouched. NSURL *hostURL = [NSURL URLWithString:[@"https://" stringByAppendingString:address]]; - if (hostURL.host && !hostURL.port) { + if (hostURL.host && hostURL.port == nil) { address = [hostURL.host stringByAppendingString:@":443"]; } @@ -193,6 +193,7 @@ static NSMutableDictionary *kHostCache; if (pemPrivateKey == nil && pemCertChain == nil) { creds = grpc_ssl_credentials_create(rootsASCII.bytes, NULL, NULL, NULL); } else { + assert(pemPrivateKey != nil && pemCertChain != nil); grpc_ssl_pem_key_cert_pair key_cert_pair; NSData *privateKeyASCII = [self nullTerminatedDataWithString:pemPrivateKey]; NSData *certChainASCII = [self nullTerminatedDataWithString:pemCertChain]; @@ -226,7 +227,7 @@ static NSMutableDictionary *kHostCache; args[@GRPC_SSL_TARGET_NAME_OVERRIDE_ARG] = _hostNameOverride; } - if (_responseSizeLimitOverride) { + if (_responseSizeLimitOverride != nil) { args[@GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH] = _responseSizeLimitOverride; } |