Fix ruby server

pull/1472/head
Craig Tiller 10 years ago
parent 9e86dc8938
commit c4440d913e
  1. 10
      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;
}

Loading…
Cancel
Save