grpc 1.3.4-x64-mingw32 → 1.4.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/grpc_c.32.ruby +0 -0
- data/grpc_c.64.ruby +0 -0
- data/src/ruby/ext/grpc/extconf.rb +2 -1
- data/src/ruby/ext/grpc/rb_byte_buffer.c +8 -6
- data/src/ruby/ext/grpc/rb_call.c +56 -48
- data/src/ruby/ext/grpc/rb_call.h +3 -4
- data/src/ruby/ext/grpc/rb_call_credentials.c +23 -22
- data/src/ruby/ext/grpc/rb_channel.c +2 -3
- data/src/ruby/ext/grpc/rb_channel_args.c +11 -9
- data/src/ruby/ext/grpc/rb_channel_credentials.c +16 -12
- data/src/ruby/ext/grpc/rb_completion_queue.c +7 -9
- data/src/ruby/ext/grpc/rb_compression_options.c +7 -6
- data/src/ruby/ext/grpc/rb_event_thread.c +10 -12
- data/src/ruby/ext/grpc/rb_event_thread.h +1 -2
- data/src/ruby/ext/grpc/rb_grpc.c +11 -15
- data/src/ruby/ext/grpc/rb_grpc.h +2 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +16 -6
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +25 -10
- data/src/ruby/ext/grpc/rb_server.c +26 -28
- data/src/ruby/lib/grpc/2.0/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.1/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.2/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.3/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/2.4/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/grpc.rb +1 -1
- data/src/ruby/lib/grpc/grpc_c.so +0 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- metadata +17 -17
@@ -365,7 +365,6 @@ static void *wait_for_watch_state_op_complete_without_gvl(void *arg) {
|
|
365
365
|
|
366
366
|
return success;
|
367
367
|
}
|
368
|
-
|
369
368
|
static void wait_for_watch_state_op_complete_unblocking_func(void *arg) {
|
370
369
|
bg_watched_channel *bg = (bg_watched_channel *)arg;
|
371
370
|
gpr_mu_lock(&global_connection_polling_mu);
|
@@ -443,7 +442,7 @@ static VALUE grpc_rb_channel_create_call(VALUE self, VALUE parent, VALUE mask,
|
|
443
442
|
parent_call = grpc_rb_get_wrapped_call(parent);
|
444
443
|
}
|
445
444
|
|
446
|
-
cq =
|
445
|
+
cq = grpc_completion_queue_create_for_pluck(NULL);
|
447
446
|
TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper);
|
448
447
|
if (wrapper->bg_wrapped == NULL) {
|
449
448
|
rb_raise(rb_eRuntimeError, "closed!");
|
@@ -756,7 +755,7 @@ void grpc_rb_channel_polling_thread_start() {
|
|
756
755
|
gpr_mu_init(&global_connection_polling_mu);
|
757
756
|
gpr_cv_init(&global_connection_polling_cv);
|
758
757
|
|
759
|
-
channel_polling_cq =
|
758
|
+
channel_polling_cq = grpc_completion_queue_create_for_next(NULL);
|
760
759
|
background_thread = rb_thread_create(run_poll_channels_loop, NULL);
|
761
760
|
|
762
761
|
if (!RTEST(background_thread)) {
|
@@ -33,8 +33,8 @@
|
|
33
33
|
|
34
34
|
#include <ruby/ruby.h>
|
35
35
|
|
36
|
-
#include "rb_grpc_imports.generated.h"
|
37
36
|
#include "rb_channel_args.h"
|
37
|
+
#include "rb_grpc_imports.generated.h"
|
38
38
|
|
39
39
|
#include <grpc/grpc.h>
|
40
40
|
|
@@ -42,9 +42,12 @@
|
|
42
42
|
|
43
43
|
static rb_data_type_t grpc_rb_channel_args_data_type = {
|
44
44
|
"grpc_channel_args",
|
45
|
-
{GRPC_RB_GC_NOT_MARKED,
|
45
|
+
{GRPC_RB_GC_NOT_MARKED,
|
46
|
+
GRPC_RB_GC_DONT_FREE,
|
47
|
+
GRPC_RB_MEMSIZE_UNAVAILABLE,
|
46
48
|
{NULL, NULL}},
|
47
|
-
NULL,
|
49
|
+
NULL,
|
50
|
+
NULL,
|
48
51
|
#ifdef RUBY_TYPED_FREE_IMMEDIATELY
|
49
52
|
RUBY_TYPED_FREE_IMMEDIATELY
|
50
53
|
#endif
|
@@ -137,11 +140,10 @@ static VALUE grpc_rb_hash_convert_to_channel_args0(VALUE as_value) {
|
|
137
140
|
params->dst->num_args = num_args;
|
138
141
|
params->dst->args = ALLOC_N(grpc_arg, num_args);
|
139
142
|
MEMZERO(params->dst->args, grpc_arg, num_args);
|
140
|
-
rb_hash_foreach(
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
params->dst));
|
143
|
+
rb_hash_foreach(
|
144
|
+
params->src_hash, grpc_rb_channel_create_in_process_add_args_hash_cb,
|
145
|
+
TypedData_Wrap_Struct(grpc_rb_cChannelArgs,
|
146
|
+
&grpc_rb_channel_args_data_type, params->dst));
|
145
147
|
/* reset num_args as grpc_rb_channel_create_in_process_add_args_hash_cb
|
146
148
|
* decrements it during has processing */
|
147
149
|
params->dst->num_args = num_args;
|
@@ -157,7 +159,7 @@ void grpc_rb_hash_convert_to_channel_args(VALUE src_hash,
|
|
157
159
|
/* Make a protected call to grpc_rb_hash_convert_channel_args */
|
158
160
|
params.src_hash = src_hash;
|
159
161
|
params.dst = dst;
|
160
|
-
rb_protect(grpc_rb_hash_convert_to_channel_args0, (VALUE)
|
162
|
+
rb_protect(grpc_rb_hash_convert_to_channel_args0, (VALUE)¶ms, &status);
|
161
163
|
if (status != 0) {
|
162
164
|
if (dst->args != NULL) {
|
163
165
|
/* Free any allocated memory before propagating the error */
|
@@ -35,8 +35,8 @@
|
|
35
35
|
|
36
36
|
#include <string.h>
|
37
37
|
|
38
|
-
#include "rb_grpc_imports.generated.h"
|
39
38
|
#include "rb_channel_credentials.h"
|
39
|
+
#include "rb_grpc_imports.generated.h"
|
40
40
|
|
41
41
|
#include <grpc/grpc.h>
|
42
42
|
#include <grpc/grpc_security.h>
|
@@ -91,8 +91,10 @@ static void grpc_rb_channel_credentials_mark(void *p) {
|
|
91
91
|
|
92
92
|
static rb_data_type_t grpc_rb_channel_credentials_data_type = {
|
93
93
|
"grpc_channel_credentials",
|
94
|
-
{grpc_rb_channel_credentials_mark,
|
95
|
-
|
94
|
+
{grpc_rb_channel_credentials_mark,
|
95
|
+
grpc_rb_channel_credentials_free,
|
96
|
+
GRPC_RB_MEMSIZE_UNAVAILABLE,
|
97
|
+
{NULL, NULL}},
|
96
98
|
NULL,
|
97
99
|
NULL,
|
98
100
|
#ifdef RUBY_TYPED_FREE_IMMEDIATELY
|
@@ -106,13 +108,15 @@ static VALUE grpc_rb_channel_credentials_alloc(VALUE cls) {
|
|
106
108
|
grpc_rb_channel_credentials *wrapper = ALLOC(grpc_rb_channel_credentials);
|
107
109
|
wrapper->wrapped = NULL;
|
108
110
|
wrapper->mark = Qnil;
|
109
|
-
return TypedData_Wrap_Struct(cls, &grpc_rb_channel_credentials_data_type,
|
111
|
+
return TypedData_Wrap_Struct(cls, &grpc_rb_channel_credentials_data_type,
|
112
|
+
wrapper);
|
110
113
|
}
|
111
114
|
|
112
115
|
/* Creates a wrapping object for a given channel credentials. This should only
|
113
116
|
* be called with grpc_channel_credentials objects that are not already
|
114
117
|
* associated with any Ruby object. */
|
115
|
-
VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials *c,
|
118
|
+
VALUE grpc_rb_wrap_channel_credentials(grpc_channel_credentials *c,
|
119
|
+
VALUE mark) {
|
116
120
|
VALUE rb_wrapper;
|
117
121
|
grpc_rb_channel_credentials *wrapper;
|
118
122
|
if (c == NULL) {
|
@@ -147,7 +151,8 @@ static ID id_pem_cert_chain;
|
|
147
151
|
pem_private_key: (optional) PEM encoding of the client's private key
|
148
152
|
pem_cert_chain: (optional) PEM encoding of the client's cert chain
|
149
153
|
Initializes Credential instances. */
|
150
|
-
static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv,
|
154
|
+
static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv,
|
155
|
+
VALUE self) {
|
151
156
|
VALUE pem_root_certs = Qnil;
|
152
157
|
VALUE pem_private_key = Qnil;
|
153
158
|
VALUE pem_cert_chain = Qnil;
|
@@ -173,8 +178,8 @@ static VALUE grpc_rb_channel_credentials_init(int argc, VALUE *argv, VALUE self)
|
|
173
178
|
} else {
|
174
179
|
key_cert_pair.private_key = RSTRING_PTR(pem_private_key);
|
175
180
|
key_cert_pair.cert_chain = RSTRING_PTR(pem_cert_chain);
|
176
|
-
creds =
|
177
|
-
|
181
|
+
creds =
|
182
|
+
grpc_ssl_credentials_create(pem_root_certs_cstr, &key_cert_pair, NULL);
|
178
183
|
}
|
179
184
|
if (creds == NULL) {
|
180
185
|
rb_raise(rb_eRuntimeError, "could not create a credentials, not sure why");
|
@@ -233,8 +238,8 @@ static VALUE grpc_rb_set_default_roots_pem(VALUE self, VALUE roots) {
|
|
233
238
|
}
|
234
239
|
|
235
240
|
void Init_grpc_channel_credentials() {
|
236
|
-
grpc_rb_cChannelCredentials =
|
237
|
-
|
241
|
+
grpc_rb_cChannelCredentials = rb_define_class_under(
|
242
|
+
grpc_rb_mGrpcCore, "ChannelCredentials", rb_cObject);
|
238
243
|
|
239
244
|
/* Allocates an object managed by the ruby runtime */
|
240
245
|
rb_define_alloc_func(grpc_rb_cChannelCredentials,
|
@@ -262,7 +267,6 @@ void Init_grpc_channel_credentials() {
|
|
262
267
|
grpc_channel_credentials *grpc_rb_get_wrapped_channel_credentials(VALUE v) {
|
263
268
|
grpc_rb_channel_credentials *wrapper = NULL;
|
264
269
|
TypedData_Get_Struct(v, grpc_rb_channel_credentials,
|
265
|
-
&grpc_rb_channel_credentials_data_type,
|
266
|
-
wrapper);
|
270
|
+
&grpc_rb_channel_credentials_data_type, wrapper);
|
267
271
|
return wrapper->wrapped;
|
268
272
|
}
|
@@ -33,14 +33,14 @@
|
|
33
33
|
|
34
34
|
#include <ruby/ruby.h>
|
35
35
|
|
36
|
-
#include "rb_grpc_imports.generated.h"
|
37
36
|
#include "rb_completion_queue.h"
|
37
|
+
#include "rb_grpc_imports.generated.h"
|
38
38
|
|
39
39
|
#include <ruby/thread.h>
|
40
40
|
|
41
41
|
#include <grpc/grpc.h>
|
42
|
-
#include <grpc/support/time.h>
|
43
42
|
#include <grpc/support/log.h>
|
43
|
+
#include <grpc/support/time.h>
|
44
44
|
#include "rb_grpc.h"
|
45
45
|
|
46
46
|
/* Used to allow grpc_completion_queue_next call to release the GIL */
|
@@ -54,14 +54,13 @@ typedef struct next_call_stack {
|
|
54
54
|
|
55
55
|
/* Calls grpc_completion_queue_pluck without holding the ruby GIL */
|
56
56
|
static void *grpc_rb_completion_queue_pluck_no_gil(void *param) {
|
57
|
-
next_call_stack *const next_call = (next_call_stack*)param;
|
57
|
+
next_call_stack *const next_call = (next_call_stack *)param;
|
58
58
|
gpr_timespec increment = gpr_time_from_millis(20, GPR_TIMESPAN);
|
59
59
|
gpr_timespec deadline;
|
60
60
|
do {
|
61
61
|
deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), increment);
|
62
|
-
next_call->event = grpc_completion_queue_pluck(
|
63
|
-
|
64
|
-
deadline, NULL);
|
62
|
+
next_call->event = grpc_completion_queue_pluck(
|
63
|
+
next_call->cq, next_call->tag, deadline, NULL);
|
65
64
|
if (next_call->event.type != GRPC_QUEUE_TIMEOUT ||
|
66
65
|
gpr_time_cmp(deadline, next_call->timeout) > 0) {
|
67
66
|
break;
|
@@ -81,7 +80,7 @@ void grpc_rb_completion_queue_destroy(grpc_completion_queue *cq) {
|
|
81
80
|
}
|
82
81
|
|
83
82
|
static void unblock_func(void *param) {
|
84
|
-
next_call_stack *const next_call = (next_call_stack*)param;
|
83
|
+
next_call_stack *const next_call = (next_call_stack *)param;
|
85
84
|
next_call->interrupted = 1;
|
86
85
|
}
|
87
86
|
|
@@ -111,7 +110,6 @@ grpc_event rb_completion_queue_pluck(grpc_completion_queue *queue, void *tag,
|
|
111
110
|
(void *)&next_call);
|
112
111
|
/* If an interrupt prevented pluck from returning useful information, then
|
113
112
|
any plucks that did complete must have timed out */
|
114
|
-
} while (next_call.interrupted &&
|
115
|
-
next_call.event.type == GRPC_QUEUE_TIMEOUT);
|
113
|
+
} while (next_call.interrupted && next_call.event.type == GRPC_QUEUE_TIMEOUT);
|
116
114
|
return next_call.event;
|
117
115
|
}
|
@@ -33,15 +33,15 @@
|
|
33
33
|
|
34
34
|
#include <ruby/ruby.h>
|
35
35
|
|
36
|
-
#include "rb_compression_options.h"
|
37
36
|
#include "rb_byte_buffer.h"
|
37
|
+
#include "rb_compression_options.h"
|
38
38
|
#include "rb_grpc_imports.generated.h"
|
39
39
|
|
40
40
|
#include <grpc/compression.h>
|
41
41
|
#include <grpc/grpc.h>
|
42
|
-
#include <grpc/support/alloc.h>
|
43
42
|
#include <grpc/impl/codegen/compression_types.h>
|
44
43
|
#include <grpc/impl/codegen/grpc_types.h>
|
44
|
+
#include <grpc/support/alloc.h>
|
45
45
|
#include <string.h>
|
46
46
|
|
47
47
|
#include "rb_grpc.h"
|
@@ -182,15 +182,16 @@ void grpc_rb_compression_options_algorithm_name_to_value_internal(
|
|
182
182
|
* correct C string out of it. */
|
183
183
|
algorithm_name_as_string = rb_funcall(algorithm_name, rb_intern("to_s"), 0);
|
184
184
|
|
185
|
-
name_slice =
|
185
|
+
name_slice =
|
186
|
+
grpc_slice_from_copied_buffer(RSTRING_PTR(algorithm_name_as_string),
|
187
|
+
RSTRING_LEN(algorithm_name_as_string));
|
186
188
|
|
187
189
|
/* Raise an error if the name isn't recognized as a compression algorithm by
|
188
190
|
* the algorithm parse function
|
189
191
|
* in GRPC core. */
|
190
|
-
if(!grpc_compression_algorithm_parse(name_slice, algorithm_value)) {
|
192
|
+
if (!grpc_compression_algorithm_parse(name_slice, algorithm_value)) {
|
191
193
|
tmp_str = grpc_slice_to_c_string(name_slice);
|
192
|
-
rb_raise(rb_eNameError, "Invalid compression algorithm name: %s",
|
193
|
-
tmp_str);
|
194
|
+
rb_raise(rb_eNameError, "Invalid compression algorithm name: %s", tmp_str);
|
194
195
|
}
|
195
196
|
|
196
197
|
grpc_slice_unref(name_slice);
|
@@ -33,20 +33,20 @@
|
|
33
33
|
|
34
34
|
#include <ruby/ruby.h>
|
35
35
|
|
36
|
-
#include "rb_grpc_imports.generated.h"
|
37
36
|
#include "rb_event_thread.h"
|
37
|
+
#include "rb_grpc_imports.generated.h"
|
38
38
|
|
39
39
|
#include <stdbool.h>
|
40
40
|
|
41
|
-
#include <ruby/thread.h>
|
42
41
|
#include <grpc/support/alloc.h>
|
42
|
+
#include <grpc/support/log.h>
|
43
43
|
#include <grpc/support/sync.h>
|
44
44
|
#include <grpc/support/time.h>
|
45
|
-
#include <
|
45
|
+
#include <ruby/thread.h>
|
46
46
|
|
47
47
|
typedef struct grpc_rb_event {
|
48
48
|
// callback will be called with argument while holding the GVL
|
49
|
-
void (*callback)(void*);
|
49
|
+
void (*callback)(void *);
|
50
50
|
void *argument;
|
51
51
|
|
52
52
|
struct grpc_rb_event *next;
|
@@ -65,8 +65,7 @@ typedef struct grpc_rb_event_queue {
|
|
65
65
|
|
66
66
|
static grpc_rb_event_queue event_queue;
|
67
67
|
|
68
|
-
void grpc_rb_event_queue_enqueue(void (*callback)(void*),
|
69
|
-
void *argument) {
|
68
|
+
void grpc_rb_event_queue_enqueue(void (*callback)(void *), void *argument) {
|
70
69
|
grpc_rb_event *event = gpr_malloc(sizeof(grpc_rb_event));
|
71
70
|
event->callback = callback;
|
72
71
|
event->argument = argument;
|
@@ -111,8 +110,7 @@ static void *grpc_rb_wait_for_event_no_gil(void *param) {
|
|
111
110
|
gpr_mu_unlock(&event_queue.mu);
|
112
111
|
return event;
|
113
112
|
}
|
114
|
-
gpr_cv_wait(&event_queue.cv,
|
115
|
-
&event_queue.mu,
|
113
|
+
gpr_cv_wait(&event_queue.cv, &event_queue.mu,
|
116
114
|
gpr_inf_future(GPR_CLOCK_REALTIME));
|
117
115
|
}
|
118
116
|
gpr_mu_unlock(&event_queue.mu);
|
@@ -132,10 +130,10 @@ static void grpc_rb_event_unblocking_func(void *arg) {
|
|
132
130
|
static VALUE grpc_rb_event_thread(VALUE arg) {
|
133
131
|
grpc_rb_event *event;
|
134
132
|
(void)arg;
|
135
|
-
while(true) {
|
136
|
-
event = (grpc_rb_event*)rb_thread_call_without_gvl(
|
137
|
-
grpc_rb_wait_for_event_no_gil, NULL,
|
138
|
-
|
133
|
+
while (true) {
|
134
|
+
event = (grpc_rb_event *)rb_thread_call_without_gvl(
|
135
|
+
grpc_rb_wait_for_event_no_gil, NULL, grpc_rb_event_unblocking_func,
|
136
|
+
NULL);
|
139
137
|
if (event == NULL) {
|
140
138
|
// Indicates that the thread needs to shut down
|
141
139
|
break;
|
data/src/ruby/ext/grpc/rb_grpc.c
CHANGED
@@ -33,8 +33,8 @@
|
|
33
33
|
|
34
34
|
#include <ruby/ruby.h>
|
35
35
|
|
36
|
-
#include "rb_grpc_imports.generated.h"
|
37
36
|
#include "rb_grpc.h"
|
37
|
+
#include "rb_grpc_imports.generated.h"
|
38
38
|
|
39
39
|
#include <math.h>
|
40
40
|
#include <ruby/vm.h>
|
@@ -46,18 +46,19 @@
|
|
46
46
|
#include "rb_call_credentials.h"
|
47
47
|
#include "rb_channel.h"
|
48
48
|
#include "rb_channel_credentials.h"
|
49
|
+
#include "rb_compression_options.h"
|
50
|
+
#include "rb_event_thread.h"
|
49
51
|
#include "rb_loader.h"
|
50
52
|
#include "rb_server.h"
|
51
53
|
#include "rb_server_credentials.h"
|
52
|
-
#include "rb_compression_options.h"
|
53
|
-
#include "rb_event_thread.h"
|
54
|
-
#include "rb_channel.h"
|
55
54
|
|
56
55
|
static VALUE grpc_rb_cTimeVal = Qnil;
|
57
56
|
|
58
57
|
static rb_data_type_t grpc_rb_timespec_data_type = {
|
59
58
|
"gpr_timespec",
|
60
|
-
{GRPC_RB_GC_NOT_MARKED,
|
59
|
+
{GRPC_RB_GC_NOT_MARKED,
|
60
|
+
GRPC_RB_GC_DONT_FREE,
|
61
|
+
GRPC_RB_MEMSIZE_UNAVAILABLE,
|
61
62
|
{NULL, NULL}},
|
62
63
|
NULL,
|
63
64
|
NULL,
|
@@ -86,8 +87,7 @@ VALUE grpc_rb_cannot_init(VALUE self) {
|
|
86
87
|
/* Init/Clone func that fails by raising an exception. */
|
87
88
|
VALUE grpc_rb_cannot_init_copy(VALUE copy, VALUE self) {
|
88
89
|
(void)self;
|
89
|
-
rb_raise(rb_eTypeError,
|
90
|
-
"Copy initialization of %s is not supported",
|
90
|
+
rb_raise(rb_eTypeError, "Copy initialization of %s is not supported",
|
91
91
|
rb_obj_classname(copy));
|
92
92
|
return Qnil;
|
93
93
|
}
|
@@ -145,8 +145,7 @@ gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) {
|
|
145
145
|
}
|
146
146
|
t.tv_sec = (int64_t)f;
|
147
147
|
if (f != t.tv_sec) {
|
148
|
-
rb_raise(rb_eRangeError, "%f out of Time range",
|
149
|
-
RFLOAT_VALUE(time));
|
148
|
+
rb_raise(rb_eRangeError, "%f out of Time range", RFLOAT_VALUE(time));
|
150
149
|
}
|
151
150
|
t.tv_nsec = (int)(d * 1e9 + 0.5);
|
152
151
|
}
|
@@ -271,9 +270,7 @@ static void Init_grpc_time_consts() {
|
|
271
270
|
id_tv_nsec = rb_intern("tv_nsec");
|
272
271
|
}
|
273
272
|
|
274
|
-
static void grpc_rb_shutdown(void) {
|
275
|
-
grpc_shutdown();
|
276
|
-
}
|
273
|
+
static void grpc_rb_shutdown(void) { grpc_shutdown(); }
|
277
274
|
|
278
275
|
/* Initialize the GRPC module structs */
|
279
276
|
|
@@ -338,9 +335,8 @@ void Init_grpc_c() {
|
|
338
335
|
|
339
336
|
grpc_rb_mGRPC = rb_define_module("GRPC");
|
340
337
|
grpc_rb_mGrpcCore = rb_define_module_under(grpc_rb_mGRPC, "Core");
|
341
|
-
grpc_rb_sNewServerRpc =
|
342
|
-
|
343
|
-
"deadline", "metadata", "call", NULL);
|
338
|
+
grpc_rb_sNewServerRpc = rb_struct_define(
|
339
|
+
"NewServerRpc", "method", "host", "deadline", "metadata", "call", NULL);
|
344
340
|
grpc_rb_sStatus =
|
345
341
|
rb_struct_define("Status", "code", "details", "metadata", NULL);
|
346
342
|
sym_code = ID2SYM(rb_intern("code"));
|
data/src/ruby/ext/grpc/rb_grpc.h
CHANGED
@@ -34,8 +34,8 @@
|
|
34
34
|
#ifndef GRPC_RB_H_
|
35
35
|
#define GRPC_RB_H_
|
36
36
|
|
37
|
-
#include <sys/time.h>
|
38
37
|
#include <ruby/ruby.h>
|
38
|
+
#include <sys/time.h>
|
39
39
|
|
40
40
|
#include <grpc/support/time.h>
|
41
41
|
|
@@ -68,7 +68,7 @@ extern VALUE sym_metadata;
|
|
68
68
|
|
69
69
|
/* GRPC_RB_MEMSIZE_UNAVAILABLE is used in rb_data_type_t to indicate that the
|
70
70
|
* number of bytes used by the wrapped struct is not available. */
|
71
|
-
#define GRPC_RB_MEMSIZE_UNAVAILABLE (size_t
|
71
|
+
#define GRPC_RB_MEMSIZE_UNAVAILABLE (size_t(*)(const void*))(NULL)
|
72
72
|
|
73
73
|
/* A ruby object alloc func that fails by raising an exception. */
|
74
74
|
VALUE grpc_rb_cannot_alloc(VALUE cls);
|
@@ -109,9 +109,9 @@ grpc_channel_create_call_type grpc_channel_create_call_import;
|
|
109
109
|
grpc_channel_ping_type grpc_channel_ping_import;
|
110
110
|
grpc_channel_register_call_type grpc_channel_register_call_import;
|
111
111
|
grpc_channel_create_registered_call_type grpc_channel_create_registered_call_import;
|
112
|
+
grpc_call_arena_alloc_type grpc_call_arena_alloc_import;
|
112
113
|
grpc_call_start_batch_type grpc_call_start_batch_import;
|
113
114
|
grpc_call_get_peer_type grpc_call_get_peer_import;
|
114
|
-
grpc_call_set_load_reporting_cost_context_type grpc_call_set_load_reporting_cost_context_import;
|
115
115
|
grpc_census_call_set_context_type grpc_census_call_set_context_import;
|
116
116
|
grpc_census_call_get_context_type grpc_census_call_get_context_import;
|
117
117
|
grpc_channel_get_target_type grpc_channel_get_target_import;
|
@@ -121,13 +121,13 @@ grpc_lame_client_channel_create_type grpc_lame_client_channel_create_import;
|
|
121
121
|
grpc_channel_destroy_type grpc_channel_destroy_import;
|
122
122
|
grpc_call_cancel_type grpc_call_cancel_import;
|
123
123
|
grpc_call_cancel_with_status_type grpc_call_cancel_with_status_import;
|
124
|
-
|
124
|
+
grpc_call_ref_type grpc_call_ref_import;
|
125
|
+
grpc_call_unref_type grpc_call_unref_import;
|
125
126
|
grpc_server_request_call_type grpc_server_request_call_import;
|
126
127
|
grpc_server_register_method_type grpc_server_register_method_import;
|
127
128
|
grpc_server_request_registered_call_type grpc_server_request_registered_call_import;
|
128
129
|
grpc_server_create_type grpc_server_create_import;
|
129
130
|
grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import;
|
130
|
-
grpc_server_register_non_listening_completion_queue_type grpc_server_register_non_listening_completion_queue_import;
|
131
131
|
grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import;
|
132
132
|
grpc_server_start_type grpc_server_start_import;
|
133
133
|
grpc_server_shutdown_and_notify_type grpc_server_shutdown_and_notify_import;
|
@@ -180,10 +180,12 @@ grpc_call_set_credentials_type grpc_call_set_credentials_import;
|
|
180
180
|
grpc_server_credentials_set_auth_metadata_processor_type grpc_server_credentials_set_auth_metadata_processor_import;
|
181
181
|
grpc_slice_ref_type grpc_slice_ref_import;
|
182
182
|
grpc_slice_unref_type grpc_slice_unref_import;
|
183
|
+
grpc_slice_copy_type grpc_slice_copy_import;
|
183
184
|
grpc_slice_new_type grpc_slice_new_import;
|
184
185
|
grpc_slice_new_with_user_data_type grpc_slice_new_with_user_data_import;
|
185
186
|
grpc_slice_new_with_len_type grpc_slice_new_with_len_import;
|
186
187
|
grpc_slice_malloc_type grpc_slice_malloc_import;
|
188
|
+
grpc_slice_malloc_large_type grpc_slice_malloc_large_import;
|
187
189
|
grpc_slice_intern_type grpc_slice_intern_import;
|
188
190
|
grpc_slice_from_copied_string_type grpc_slice_from_copied_string_import;
|
189
191
|
grpc_slice_from_copied_buffer_type grpc_slice_from_copied_buffer_import;
|
@@ -192,6 +194,7 @@ grpc_slice_from_static_buffer_type grpc_slice_from_static_buffer_import;
|
|
192
194
|
grpc_slice_sub_type grpc_slice_sub_import;
|
193
195
|
grpc_slice_sub_no_ref_type grpc_slice_sub_no_ref_import;
|
194
196
|
grpc_slice_split_tail_type grpc_slice_split_tail_import;
|
197
|
+
grpc_slice_split_tail_maybe_ref_type grpc_slice_split_tail_maybe_ref_import;
|
195
198
|
grpc_slice_split_head_type grpc_slice_split_head_import;
|
196
199
|
grpc_empty_slice_type grpc_empty_slice_import;
|
197
200
|
grpc_slice_default_hash_impl_type grpc_slice_default_hash_impl_import;
|
@@ -220,6 +223,7 @@ grpc_slice_buffer_swap_type grpc_slice_buffer_swap_import;
|
|
220
223
|
grpc_slice_buffer_move_into_type grpc_slice_buffer_move_into_import;
|
221
224
|
grpc_slice_buffer_trim_end_type grpc_slice_buffer_trim_end_import;
|
222
225
|
grpc_slice_buffer_move_first_type grpc_slice_buffer_move_first_import;
|
226
|
+
grpc_slice_buffer_move_first_no_ref_type grpc_slice_buffer_move_first_no_ref_import;
|
223
227
|
grpc_slice_buffer_move_first_into_buffer_type grpc_slice_buffer_move_first_into_buffer_import;
|
224
228
|
grpc_slice_buffer_take_first_type grpc_slice_buffer_take_first_import;
|
225
229
|
grpc_slice_buffer_undo_take_first_type grpc_slice_buffer_undo_take_first_import;
|
@@ -267,6 +271,7 @@ gpr_histogram_get_contents_type gpr_histogram_get_contents_import;
|
|
267
271
|
gpr_histogram_merge_contents_type gpr_histogram_merge_contents_import;
|
268
272
|
gpr_join_host_port_type gpr_join_host_port_import;
|
269
273
|
gpr_split_host_port_type gpr_split_host_port_import;
|
274
|
+
gpr_log_severity_string_type gpr_log_severity_string_import;
|
270
275
|
gpr_log_type gpr_log_import;
|
271
276
|
gpr_log_message_type gpr_log_message_import;
|
272
277
|
gpr_set_log_verbosity_type gpr_set_log_verbosity_import;
|
@@ -407,9 +412,9 @@ void grpc_rb_load_imports(HMODULE library) {
|
|
407
412
|
grpc_channel_ping_import = (grpc_channel_ping_type) GetProcAddress(library, "grpc_channel_ping");
|
408
413
|
grpc_channel_register_call_import = (grpc_channel_register_call_type) GetProcAddress(library, "grpc_channel_register_call");
|
409
414
|
grpc_channel_create_registered_call_import = (grpc_channel_create_registered_call_type) GetProcAddress(library, "grpc_channel_create_registered_call");
|
415
|
+
grpc_call_arena_alloc_import = (grpc_call_arena_alloc_type) GetProcAddress(library, "grpc_call_arena_alloc");
|
410
416
|
grpc_call_start_batch_import = (grpc_call_start_batch_type) GetProcAddress(library, "grpc_call_start_batch");
|
411
417
|
grpc_call_get_peer_import = (grpc_call_get_peer_type) GetProcAddress(library, "grpc_call_get_peer");
|
412
|
-
grpc_call_set_load_reporting_cost_context_import = (grpc_call_set_load_reporting_cost_context_type) GetProcAddress(library, "grpc_call_set_load_reporting_cost_context");
|
413
418
|
grpc_census_call_set_context_import = (grpc_census_call_set_context_type) GetProcAddress(library, "grpc_census_call_set_context");
|
414
419
|
grpc_census_call_get_context_import = (grpc_census_call_get_context_type) GetProcAddress(library, "grpc_census_call_get_context");
|
415
420
|
grpc_channel_get_target_import = (grpc_channel_get_target_type) GetProcAddress(library, "grpc_channel_get_target");
|
@@ -419,13 +424,13 @@ void grpc_rb_load_imports(HMODULE library) {
|
|
419
424
|
grpc_channel_destroy_import = (grpc_channel_destroy_type) GetProcAddress(library, "grpc_channel_destroy");
|
420
425
|
grpc_call_cancel_import = (grpc_call_cancel_type) GetProcAddress(library, "grpc_call_cancel");
|
421
426
|
grpc_call_cancel_with_status_import = (grpc_call_cancel_with_status_type) GetProcAddress(library, "grpc_call_cancel_with_status");
|
422
|
-
|
427
|
+
grpc_call_ref_import = (grpc_call_ref_type) GetProcAddress(library, "grpc_call_ref");
|
428
|
+
grpc_call_unref_import = (grpc_call_unref_type) GetProcAddress(library, "grpc_call_unref");
|
423
429
|
grpc_server_request_call_import = (grpc_server_request_call_type) GetProcAddress(library, "grpc_server_request_call");
|
424
430
|
grpc_server_register_method_import = (grpc_server_register_method_type) GetProcAddress(library, "grpc_server_register_method");
|
425
431
|
grpc_server_request_registered_call_import = (grpc_server_request_registered_call_type) GetProcAddress(library, "grpc_server_request_registered_call");
|
426
432
|
grpc_server_create_import = (grpc_server_create_type) GetProcAddress(library, "grpc_server_create");
|
427
433
|
grpc_server_register_completion_queue_import = (grpc_server_register_completion_queue_type) GetProcAddress(library, "grpc_server_register_completion_queue");
|
428
|
-
grpc_server_register_non_listening_completion_queue_import = (grpc_server_register_non_listening_completion_queue_type) GetProcAddress(library, "grpc_server_register_non_listening_completion_queue");
|
429
434
|
grpc_server_add_insecure_http2_port_import = (grpc_server_add_insecure_http2_port_type) GetProcAddress(library, "grpc_server_add_insecure_http2_port");
|
430
435
|
grpc_server_start_import = (grpc_server_start_type) GetProcAddress(library, "grpc_server_start");
|
431
436
|
grpc_server_shutdown_and_notify_import = (grpc_server_shutdown_and_notify_type) GetProcAddress(library, "grpc_server_shutdown_and_notify");
|
@@ -478,10 +483,12 @@ void grpc_rb_load_imports(HMODULE library) {
|
|
478
483
|
grpc_server_credentials_set_auth_metadata_processor_import = (grpc_server_credentials_set_auth_metadata_processor_type) GetProcAddress(library, "grpc_server_credentials_set_auth_metadata_processor");
|
479
484
|
grpc_slice_ref_import = (grpc_slice_ref_type) GetProcAddress(library, "grpc_slice_ref");
|
480
485
|
grpc_slice_unref_import = (grpc_slice_unref_type) GetProcAddress(library, "grpc_slice_unref");
|
486
|
+
grpc_slice_copy_import = (grpc_slice_copy_type) GetProcAddress(library, "grpc_slice_copy");
|
481
487
|
grpc_slice_new_import = (grpc_slice_new_type) GetProcAddress(library, "grpc_slice_new");
|
482
488
|
grpc_slice_new_with_user_data_import = (grpc_slice_new_with_user_data_type) GetProcAddress(library, "grpc_slice_new_with_user_data");
|
483
489
|
grpc_slice_new_with_len_import = (grpc_slice_new_with_len_type) GetProcAddress(library, "grpc_slice_new_with_len");
|
484
490
|
grpc_slice_malloc_import = (grpc_slice_malloc_type) GetProcAddress(library, "grpc_slice_malloc");
|
491
|
+
grpc_slice_malloc_large_import = (grpc_slice_malloc_large_type) GetProcAddress(library, "grpc_slice_malloc_large");
|
485
492
|
grpc_slice_intern_import = (grpc_slice_intern_type) GetProcAddress(library, "grpc_slice_intern");
|
486
493
|
grpc_slice_from_copied_string_import = (grpc_slice_from_copied_string_type) GetProcAddress(library, "grpc_slice_from_copied_string");
|
487
494
|
grpc_slice_from_copied_buffer_import = (grpc_slice_from_copied_buffer_type) GetProcAddress(library, "grpc_slice_from_copied_buffer");
|
@@ -490,6 +497,7 @@ void grpc_rb_load_imports(HMODULE library) {
|
|
490
497
|
grpc_slice_sub_import = (grpc_slice_sub_type) GetProcAddress(library, "grpc_slice_sub");
|
491
498
|
grpc_slice_sub_no_ref_import = (grpc_slice_sub_no_ref_type) GetProcAddress(library, "grpc_slice_sub_no_ref");
|
492
499
|
grpc_slice_split_tail_import = (grpc_slice_split_tail_type) GetProcAddress(library, "grpc_slice_split_tail");
|
500
|
+
grpc_slice_split_tail_maybe_ref_import = (grpc_slice_split_tail_maybe_ref_type) GetProcAddress(library, "grpc_slice_split_tail_maybe_ref");
|
493
501
|
grpc_slice_split_head_import = (grpc_slice_split_head_type) GetProcAddress(library, "grpc_slice_split_head");
|
494
502
|
grpc_empty_slice_import = (grpc_empty_slice_type) GetProcAddress(library, "grpc_empty_slice");
|
495
503
|
grpc_slice_default_hash_impl_import = (grpc_slice_default_hash_impl_type) GetProcAddress(library, "grpc_slice_default_hash_impl");
|
@@ -518,6 +526,7 @@ void grpc_rb_load_imports(HMODULE library) {
|
|
518
526
|
grpc_slice_buffer_move_into_import = (grpc_slice_buffer_move_into_type) GetProcAddress(library, "grpc_slice_buffer_move_into");
|
519
527
|
grpc_slice_buffer_trim_end_import = (grpc_slice_buffer_trim_end_type) GetProcAddress(library, "grpc_slice_buffer_trim_end");
|
520
528
|
grpc_slice_buffer_move_first_import = (grpc_slice_buffer_move_first_type) GetProcAddress(library, "grpc_slice_buffer_move_first");
|
529
|
+
grpc_slice_buffer_move_first_no_ref_import = (grpc_slice_buffer_move_first_no_ref_type) GetProcAddress(library, "grpc_slice_buffer_move_first_no_ref");
|
521
530
|
grpc_slice_buffer_move_first_into_buffer_import = (grpc_slice_buffer_move_first_into_buffer_type) GetProcAddress(library, "grpc_slice_buffer_move_first_into_buffer");
|
522
531
|
grpc_slice_buffer_take_first_import = (grpc_slice_buffer_take_first_type) GetProcAddress(library, "grpc_slice_buffer_take_first");
|
523
532
|
grpc_slice_buffer_undo_take_first_import = (grpc_slice_buffer_undo_take_first_type) GetProcAddress(library, "grpc_slice_buffer_undo_take_first");
|
@@ -565,6 +574,7 @@ void grpc_rb_load_imports(HMODULE library) {
|
|
565
574
|
gpr_histogram_merge_contents_import = (gpr_histogram_merge_contents_type) GetProcAddress(library, "gpr_histogram_merge_contents");
|
566
575
|
gpr_join_host_port_import = (gpr_join_host_port_type) GetProcAddress(library, "gpr_join_host_port");
|
567
576
|
gpr_split_host_port_import = (gpr_split_host_port_type) GetProcAddress(library, "gpr_split_host_port");
|
577
|
+
gpr_log_severity_string_import = (gpr_log_severity_string_type) GetProcAddress(library, "gpr_log_severity_string");
|
568
578
|
gpr_log_import = (gpr_log_type) GetProcAddress(library, "gpr_log");
|
569
579
|
gpr_log_message_import = (gpr_log_message_type) GetProcAddress(library, "gpr_log_message");
|
570
580
|
gpr_set_log_verbosity_import = (gpr_set_log_verbosity_type) GetProcAddress(library, "gpr_set_log_verbosity");
|