From 3d6d0587bdb33f2c5f1d56c8480fb3e41113e575 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 8 Jul 2015 12:47:13 -0700 Subject: Made ruby server return correct error code for unimplemented method --- src/ruby/lib/grpc/generic/rpc_server.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ruby/lib') diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb index a7e20d6b82..b746c0be4e 100644 --- a/src/ruby/lib/grpc/generic/rpc_server.rb +++ b/src/ruby/lib/grpc/generic/rpc_server.rb @@ -398,14 +398,14 @@ module GRPC nil end - # Sends NOT_FOUND if the method can't be found + # Sends UNIMPLEMENTED if the method is not implemented by this server def found?(an_rpc) mth = an_rpc.method.to_sym return an_rpc if rpc_descs.key?(mth) - GRPC.logger.warn("NOT_FOUND: #{an_rpc}") + GRPC.logger.warn("UNIMPLEMENTED: #{an_rpc}") noop = proc { |x| x } c = ActiveCall.new(an_rpc.call, @cq, noop, noop, an_rpc.deadline) - c.send_status(StatusCodes::NOT_FOUND, '') + c.send_status(StatusCodes::UNIMPLEMENTED, '') nil end -- cgit v1.2.3 From f88eecd80d501f91a36922d3514bad94a21b5c22 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 10 Jul 2015 09:58:15 -0700 Subject: Changed found? to implemented? --- src/ruby/lib/grpc/generic/rpc_server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ruby/lib') diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb index b746c0be4e..67bf35ce02 100644 --- a/src/ruby/lib/grpc/generic/rpc_server.rb +++ b/src/ruby/lib/grpc/generic/rpc_server.rb @@ -399,7 +399,7 @@ module GRPC end # Sends UNIMPLEMENTED if the method is not implemented by this server - def found?(an_rpc) + def implemented?(an_rpc) mth = an_rpc.method.to_sym return an_rpc if rpc_descs.key?(mth) GRPC.logger.warn("UNIMPLEMENTED: #{an_rpc}") @@ -446,7 +446,7 @@ module GRPC an_rpc.call.run_batch(@cq, handle_call_tag, INFINITE_FUTURE, SEND_INITIAL_METADATA => connect_md) return nil unless available?(an_rpc) - return nil unless found?(an_rpc) + return nil unless implemented?(an_rpc) # Create the ActiveCall GRPC.logger.info("deadline is #{an_rpc.deadline}; (now=#{Time.now})") -- cgit v1.2.3