aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/ext
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-11 11:12:18 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-11 11:12:18 -0700
commitc7df2b8a56a53669b58dd782fa9cd294f8b24217 (patch)
tree4c04d5e0b010a454d358f638ef319d1df0c8713a /src/ruby/ext
parent7d95470a62ebcf8486b8b1d0806a2483a40f91d6 (diff)
Ruby progress
Diffstat (limited to 'src/ruby/ext')
-rw-r--r--src/ruby/ext/grpc/rb_call.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ruby/ext/grpc/rb_call.c b/src/ruby/ext/grpc/rb_call.c
index e76bb930ee..c46af250cd 100644
--- a/src/ruby/ext/grpc/rb_call.c
+++ b/src/ruby/ext/grpc/rb_call.c
@@ -581,7 +581,7 @@ static VALUE grpc_rb_call_run_batch(VALUE self, VALUE cqueue, VALUE tag,
VALUE timeout, VALUE ops_hash) {
run_batch_stack st;
grpc_call *call = NULL;
- grpc_event *ev = NULL;
+ grpc_event ev;
grpc_call_error err;
VALUE result = Qnil;
TypedData_Get_Struct(self, grpc_call, &grpc_call_data_type, call);
@@ -605,15 +605,14 @@ static VALUE grpc_rb_call_run_batch(VALUE self, VALUE cqueue, VALUE tag,
return Qnil;
}
ev = grpc_rb_completion_queue_pluck_event(cqueue, tag, timeout);
- if (ev == NULL) {
+ if (ev.type == GRPC_QUEUE_TIMEOUT) {
grpc_run_batch_stack_cleanup(&st);
rb_raise(grpc_rb_eOutOfTime, "grpc_call_start_batch timed out");
return Qnil;
}
- if (ev->data.op_complete != GRPC_OP_OK) {
+ if (!ev.success) {
grpc_run_batch_stack_cleanup(&st);
- rb_raise(grpc_rb_eCallError, "start_batch completion failed, (code=%d)",
- ev->data.op_complete);
+ rb_raise(grpc_rb_eCallError, "start_batch completion failed");
return Qnil;
}