Fixed arguments passed to Ruby auth plugin callback

pull/4412/head
murgatroid99 9 years ago
parent e389b04336
commit 64342dd864
  1. 4
      src/ruby/ext/grpc/rb_call_credentials.c

@ -66,9 +66,8 @@ typedef struct callback_params {
static VALUE grpc_rb_call_credentials_callback(VALUE callback_args) { static VALUE grpc_rb_call_credentials_callback(VALUE callback_args) {
VALUE result = rb_hash_new(); VALUE result = rb_hash_new();
VALUE empty_md = rb_hash_new();
VALUE metadata = rb_funcall(rb_ary_entry(callback_args, 0), rb_intern("call"), VALUE metadata = rb_funcall(rb_ary_entry(callback_args, 0), rb_intern("call"),
2, empty_md, rb_ary_entry(callback_args, 1)); 1, rb_ary_entry(callback_args, 1));
rb_hash_aset(result, rb_str_new2("metadata"), metadata); rb_hash_aset(result, rb_str_new2("metadata"), metadata);
rb_hash_aset(result, rb_str_new2("status"), INT2NUM(GRPC_STATUS_OK)); rb_hash_aset(result, rb_str_new2("status"), INT2NUM(GRPC_STATUS_OK));
rb_hash_aset(result, rb_str_new2("details"), rb_str_new2("")); rb_hash_aset(result, rb_str_new2("details"), rb_str_new2(""));
@ -111,7 +110,6 @@ static void *grpc_rb_call_credentials_callback_with_gil(void *param) {
status = NUM2INT(rb_hash_aref(result, rb_str_new2("status"))); status = NUM2INT(rb_hash_aref(result, rb_str_new2("status")));
details = rb_hash_aref(result, rb_str_new2("details")); details = rb_hash_aref(result, rb_str_new2("details"));
error_details = StringValueCStr(details); error_details = StringValueCStr(details);
params->callback(params->user_data, md_ary.metadata, md_ary.count, status, params->callback(params->user_data, md_ary.metadata, md_ary.count, status,
error_details); error_details);
grpc_metadata_array_destroy(&md_ary); grpc_metadata_array_destroy(&md_ary);

Loading…
Cancel
Save