From c4440d913ea5635d233139d862e1d49e5afbb2f1 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 8 May 2015 16:52:51 -0700 Subject: [PATCH] Fix ruby server --- src/ruby/ext/grpc/rb_server.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ruby/ext/grpc/rb_server.c b/src/ruby/ext/grpc/rb_server.c index bc0878af05c..a013dbcfc9f 100644 --- a/src/ruby/ext/grpc/rb_server.c +++ b/src/ruby/ext/grpc/rb_server.c @@ -203,7 +203,7 @@ static VALUE grpc_rb_server_request_call(VALUE self, VALUE cqueue, VALUE tag_new, VALUE timeout) { grpc_rb_server *s = NULL; grpc_call *call = NULL; - grpc_event *ev = NULL; + grpc_event ev; grpc_call_error err; request_call_stack st; VALUE result; @@ -227,15 +227,14 @@ static VALUE grpc_rb_server_request_call(VALUE self, VALUE cqueue, return Qnil; } ev = grpc_rb_completion_queue_pluck_event(cqueue, tag_new, timeout); - if (ev == NULL) { + if (ev.type == GRPC_QUEUE_TIMEOUT) { grpc_request_call_stack_cleanup(&st); return Qnil; } - if (ev->data.op_complete != GRPC_OP_OK) { + if (!ev.success) { grpc_request_call_stack_cleanup(&st); grpc_event_finish(ev); - rb_raise(grpc_rb_eCallError, "request_call completion failed: (code=%d)", - ev->data.op_complete); + rb_raise(grpc_rb_eCallError, "request_call completion failed"); return Qnil; } @@ -249,7 +248,6 @@ static VALUE grpc_rb_server_request_call(VALUE self, VALUE cqueue, grpc_rb_md_ary_to_h(&st.md_ary), grpc_rb_wrap_call(call), NULL); - grpc_event_finish(ev); grpc_request_call_stack_cleanup(&st); return result; }