Skip to content
Snippets Groups Projects
Commit 9c7e46f5 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

use NULL for default host in grpc_channel_call_create

parent 9d67d8de
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,6 @@ namespace Grpc.Core
readonly GrpcEnvironment environment;
readonly ChannelSafeHandle handle;
readonly List<ChannelOption> options;
readonly string target;
bool disposed;
/// <summary>
......@@ -81,7 +80,6 @@ namespace Grpc.Core
this.handle = ChannelSafeHandle.CreateInsecure(host, nativeChannelArgs);
}
}
this.target = GetOverridenTarget(host, this.options);
}
/// <summary>
......@@ -163,14 +161,6 @@ namespace Grpc.Core
GC.SuppressFinalize(this);
}
internal string Target
{
get
{
return target;
}
}
internal ChannelSafeHandle Handle
{
get
......@@ -225,26 +215,5 @@ namespace Grpc.Core
// TODO(jtattermusch): it would be useful to also provide .NET/mono version.
return string.Format("grpc-csharp/{0}", VersionInfo.CurrentVersion);
}
/// <summary>
/// Look for SslTargetNameOverride option and return its value instead of originalTarget
/// if found.
/// </summary>
private static string GetOverridenTarget(string originalTarget, IEnumerable<ChannelOption> options)
{
if (options == null)
{
return originalTarget;
}
foreach (var option in options)
{
if (option.Type == ChannelOption.OptionType.String
&& option.Name == ChannelOptions.SslTargetNameOverride)
{
return option.StringValue;
}
}
return originalTarget;
}
}
}
......@@ -67,7 +67,7 @@ namespace Grpc.Core.Internal
public void Initialize(Channel channel, CompletionQueueSafeHandle cq, string methodName, Timespec deadline)
{
this.channel = channel;
var call = channel.Handle.CreateCall(channel.CompletionRegistry, cq, methodName, channel.Target, deadline);
var call = channel.Handle.CreateCall(channel.CompletionRegistry, cq, methodName, null, deadline);
channel.Environment.DebugStats.ActiveClientCalls.Increment();
InitializeInternal(call);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment