Merge pull request #2888 from tbetbetbe/grpc-ruby-user-null-for-default-host

Use null for default host
pull/2893/head
Jan Tattermusch 9 years ago
commit bc447deaad
  1. 5
      src/ruby/ext/grpc/rb_channel.c
  2. 2
      src/ruby/lib/grpc/generic/client_stub.rb
  3. 2
      src/ruby/spec/call_spec.rb
  4. 4
      src/ruby/spec/channel_spec.rb
  5. 2
      src/ruby/spec/client_server_spec.rb
  6. 2
      src/ruby/spec/generic/active_call_spec.rb

@ -203,7 +203,10 @@ static VALUE grpc_rb_channel_create_call(VALUE self, VALUE cqueue, VALUE method,
grpc_channel *ch = NULL;
grpc_completion_queue *cq = NULL;
char *method_chars = StringValueCStr(method);
char *host_chars = StringValueCStr(host);
char *host_chars = NULL;
if (host != Qnil) {
host_chars = StringValueCStr(host);
}
cq = grpc_rb_get_wrapped_completion_queue(cqueue);
TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper);

@ -410,7 +410,7 @@ module GRPC
# @param timeout [TimeConst]
def new_active_call(method, marshal, unmarshal, timeout = nil)
deadline = from_relative_time(timeout.nil? ? @timeout : timeout)
call = @ch.create_call(@queue, method, @host, deadline)
call = @ch.create_call(@queue, method, nil, deadline)
ActiveCall.new(call, @queue, marshal, unmarshal, deadline, started: false)
end
end

@ -137,7 +137,7 @@ describe GRPC::Core::Call do
end
def make_test_call
@ch.create_call(client_queue, 'dummy_method', 'dummy_host', deadline)
@ch.create_call(client_queue, 'dummy_method', nil, deadline)
end
def deadline

@ -117,7 +117,7 @@ describe GRPC::Core::Channel do
deadline = Time.now + 5
blk = proc do
ch.create_call(cq, 'dummy_method', 'dummy_host', deadline)
ch.create_call(cq, 'dummy_method', nil, deadline)
end
expect(&blk).to_not raise_error
end
@ -128,7 +128,7 @@ describe GRPC::Core::Channel do
deadline = Time.now + 5
blk = proc do
ch.create_call(cq, 'dummy_method', 'dummy_host', deadline)
ch.create_call(cq, 'dummy_method', nil, deadline)
end
expect(&blk).to raise_error(RuntimeError)
end

@ -61,7 +61,7 @@ shared_context 'setup: tags' do
end
def new_client_call
@ch.create_call(@client_queue, '/method', 'foo.test.google.fr', deadline)
@ch.create_call(@client_queue, '/method', nil, deadline)
end
end

@ -338,7 +338,7 @@ describe GRPC::ActiveCall do
end
def make_test_call
@ch.create_call(@client_queue, '/method', 'a.dummy.host', deadline)
@ch.create_call(@client_queue, '/method', nil, deadline)
end
def deadline

Loading…
Cancel
Save