|
|
|
@ -100,7 +100,8 @@ |
|
|
|
|
- (NSDictionary *)channelArgs { |
|
|
|
|
NSMutableDictionary *args = [NSMutableDictionary new]; |
|
|
|
|
|
|
|
|
|
NSString *userAgent = @"grpc-objc/" GRPC_OBJC_VERSION_STRING; |
|
|
|
|
NSString *userAgent = [NSString |
|
|
|
|
stringWithFormat:@"grpc-objc-%@/%@", [self getTransportTypeString], GRPC_OBJC_VERSION_STRING]; |
|
|
|
|
NSString *userAgentPrefix = _callOptions.userAgentPrefix; |
|
|
|
|
if (userAgentPrefix.length != 0) { |
|
|
|
|
args[@GRPC_ARG_PRIMARY_USER_AGENT_STRING] = |
|
|
|
@ -161,6 +162,18 @@ |
|
|
|
|
return args; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
- (NSString *)getTransportTypeString { |
|
|
|
|
switch (_callOptions.transportType) { |
|
|
|
|
case GRPCTransportTypeCronet: |
|
|
|
|
return @"cronet"; |
|
|
|
|
case GRPCTransportTypeInsecure: |
|
|
|
|
case GRPCTransportTypeChttp2BoringSSL: |
|
|
|
|
return @"cfstream"; |
|
|
|
|
default: |
|
|
|
|
return @"unknown"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
- (id)copyWithZone:(NSZone *)zone { |
|
|
|
|
GRPCChannelConfiguration *newConfig = |
|
|
|
|
[[GRPCChannelConfiguration alloc] initWithHost:_host callOptions:_callOptions]; |
|
|
|
|