blob: 584b5dbc63d1aa7daec5f3c159767524e6e5d6a7 [file] [log] [blame]
nnoble097ef9b2014-12-01 17:06:10 -08001/*
2 *
Craig Tiller6169d5f2016-03-31 07:46:18 -07003 * Copyright 2015, Google Inc.
nnoble097ef9b2014-12-01 17:06:10 -08004 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above
13 * copyright notice, this list of conditions and the following disclaimer
14 * in the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
Nicolas "Pixel" Nobled51d1212016-01-31 11:33:19 +010034#include <ruby/ruby.h>
Nicolas "Pixel" Noble9fcdc872016-05-05 06:15:34 +020035
Craig Tiller5b1c5f22017-04-19 09:52:18 -070036#include "rb_grpc_imports.generated.h"
Alexander Polcynf5521c32017-04-26 14:18:39 -070037#include "rb_grpc.h"
nnoble097ef9b2014-12-01 17:06:10 -080038
39#include <math.h>
Yuki Yugui Sonoda22887912015-04-16 20:57:17 +090040#include <ruby/vm.h>
nnoble097ef9b2014-12-01 17:06:10 -080041#include <sys/time.h>
42
43#include <grpc/grpc.h>
44#include <grpc/support/time.h>
nnoble097ef9b2014-12-01 17:06:10 -080045#include "rb_call.h"
murgatroid999946f2b2015-12-04 14:36:27 -080046#include "rb_call_credentials.h"
nnoble097ef9b2014-12-01 17:06:10 -080047#include "rb_channel.h"
Tim Emiola9332ea62015-10-27 23:48:29 -070048#include "rb_channel_credentials.h"
Nicolas "Pixel" Nobled51d1212016-01-31 11:33:19 +010049#include "rb_loader.h"
nnoble097ef9b2014-12-01 17:06:10 -080050#include "rb_server.h"
nnoble0c475f02014-12-05 15:37:39 -080051#include "rb_server_credentials.h"
Alexander Polcynf5521c32017-04-26 14:18:39 -070052#include "rb_compression_options.h"
53#include "rb_event_thread.h"
54#include "rb_channel.h"
nnoble097ef9b2014-12-01 17:06:10 -080055
Yuki Yugui Sonoda3c88e5d2015-04-16 20:09:00 +090056static VALUE grpc_rb_cTimeVal = Qnil;
nnoble097ef9b2014-12-01 17:06:10 -080057
Yuki Yugui Sonodad441c2e2015-04-11 15:33:58 +090058static rb_data_type_t grpc_rb_timespec_data_type = {
59 "gpr_timespec",
Alexander Polcynf5521c32017-04-26 14:18:39 -070060 {GRPC_RB_GC_NOT_MARKED, GRPC_RB_GC_DONT_FREE, GRPC_RB_MEMSIZE_UNAVAILABLE,
murgatroid9987afb5d2015-07-16 16:01:02 -070061 {NULL, NULL}},
Yuki Yugui Sonodad441c2e2015-04-11 15:33:58 +090062 NULL,
63 NULL,
Tim Emiola9161a822015-11-11 15:58:44 -080064#ifdef RUBY_TYPED_FREE_IMMEDIATELY
65 RUBY_TYPED_FREE_IMMEDIATELY
66#endif
67};
Yuki Yugui Sonodad441c2e2015-04-11 15:33:58 +090068
nnoble097ef9b2014-12-01 17:06:10 -080069/* Alloc func that blocks allocation of a given object by raising an
70 * exception. */
71VALUE grpc_rb_cannot_alloc(VALUE cls) {
72 rb_raise(rb_eTypeError,
73 "allocation of %s only allowed from the gRPC native layer",
74 rb_class2name(cls));
75 return Qnil;
76}
77
78/* Init func that fails by raising an exception. */
79VALUE grpc_rb_cannot_init(VALUE self) {
80 rb_raise(rb_eTypeError,
81 "initialization of %s only allowed from the gRPC native layer",
82 rb_obj_classname(self));
83 return Qnil;
84}
85
86/* Init/Clone func that fails by raising an exception. */
87VALUE grpc_rb_cannot_init_copy(VALUE copy, VALUE self) {
murgatroid9987afb5d2015-07-16 16:01:02 -070088 (void)self;
Alexander Polcynf5521c32017-04-26 14:18:39 -070089 rb_raise(rb_eTypeError,
90 "Copy initialization of %s is not supported",
nnoble097ef9b2014-12-01 17:06:10 -080091 rb_obj_classname(copy));
92 return Qnil;
93}
94
95/* id_tv_{,u}sec are accessor methods on Ruby Time instances. */
96static ID id_tv_sec;
97static ID id_tv_nsec;
98
99/**
Jan Tattermusch88086372015-12-10 10:54:12 -0800100 * grpc_rb_time_timeval creates a timeval from a ruby time object.
nnoble097ef9b2014-12-01 17:06:10 -0800101 *
102 * This func is copied from ruby source, MRI/source/time.c, which is published
103 * under the same license as the ruby.h, on which the entire extensions is
104 * based.
105 */
106gpr_timespec grpc_rb_time_timeval(VALUE time, int interval) {
107 gpr_timespec t;
108 gpr_timespec *time_const;
109 const char *tstr = interval ? "time interval" : "time";
110 const char *want = " want <secs from epoch>|<Time>|<GRPC::TimeConst.*>";
111
Craig Tiller5a1e7fd2015-07-14 07:14:47 -0700112 t.clock_type = GPR_CLOCK_REALTIME;
nnoble097ef9b2014-12-01 17:06:10 -0800113 switch (TYPE(time)) {
nnoble097ef9b2014-12-01 17:06:10 -0800114 case T_DATA:
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900115 if (CLASS_OF(time) == grpc_rb_cTimeVal) {
Yuki Yugui Sonodad441c2e2015-04-11 15:33:58 +0900116 TypedData_Get_Struct(time, gpr_timespec, &grpc_rb_timespec_data_type,
117 time_const);
nnoble097ef9b2014-12-01 17:06:10 -0800118 t = *time_const;
119 } else if (CLASS_OF(time) == rb_cTime) {
Craig Tillerb5dcec52015-01-13 11:13:42 -0800120 t.tv_sec = NUM2INT(rb_funcall(time, id_tv_sec, 0));
nnoble097ef9b2014-12-01 17:06:10 -0800121 t.tv_nsec = NUM2INT(rb_funcall(time, id_tv_nsec, 0));
122 } else {
Craig Tillerb5dcec52015-01-13 11:13:42 -0800123 rb_raise(rb_eTypeError, "bad input: (%s)->c_timeval, got <%s>,%s", tstr,
124 rb_obj_classname(time), want);
nnoble097ef9b2014-12-01 17:06:10 -0800125 }
126 break;
127
128 case T_FIXNUM:
129 t.tv_sec = FIX2LONG(time);
130 if (interval && t.tv_sec < 0)
131 rb_raise(rb_eArgError, "%s must be positive", tstr);
132 t.tv_nsec = 0;
133 break;
134
135 case T_FLOAT:
mattnb9e15632015-02-28 23:45:58 +0900136 if (interval && RFLOAT_VALUE(time) < 0.0)
nnoble097ef9b2014-12-01 17:06:10 -0800137 rb_raise(rb_eArgError, "%s must be positive", tstr);
138 else {
139 double f, d;
140
mattnb9e15632015-02-28 23:45:58 +0900141 d = modf(RFLOAT_VALUE(time), &f);
nnoble097ef9b2014-12-01 17:06:10 -0800142 if (d < 0) {
143 d += 1;
144 f -= 1;
145 }
Craig Tiller7536af02015-12-22 13:49:30 -0800146 t.tv_sec = (int64_t)f;
nnoble097ef9b2014-12-01 17:06:10 -0800147 if (f != t.tv_sec) {
Alexander Polcynf5521c32017-04-26 14:18:39 -0700148 rb_raise(rb_eRangeError, "%f out of Time range",
149 RFLOAT_VALUE(time));
nnoble097ef9b2014-12-01 17:06:10 -0800150 }
Marcin Wyszynski1a2ac332015-07-23 20:12:33 +0200151 t.tv_nsec = (int)(d * 1e9 + 0.5);
nnoble097ef9b2014-12-01 17:06:10 -0800152 }
153 break;
154
155 case T_BIGNUM:
156 t.tv_sec = NUM2LONG(time);
157 if (interval && t.tv_sec < 0)
158 rb_raise(rb_eArgError, "%s must be positive", tstr);
159 t.tv_nsec = 0;
160 break;
161
162 default:
Craig Tillerb5dcec52015-01-13 11:13:42 -0800163 rb_raise(rb_eTypeError, "bad input: (%s)->c_timeval, got <%s>,%s", tstr,
164 rb_obj_classname(time), want);
nnoble097ef9b2014-12-01 17:06:10 -0800165 break;
166 }
167 return t;
168}
169
Yuki Yugui Sonodaf0eee5f2015-04-16 20:25:28 +0900170static void Init_grpc_status_codes() {
temiola58327912014-12-15 17:51:16 -0800171 /* Constants representing the status codes or grpc_status_code in status.h */
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900172 VALUE grpc_rb_mStatusCodes =
173 rb_define_module_under(grpc_rb_mGrpcCore, "StatusCodes");
174 rb_define_const(grpc_rb_mStatusCodes, "OK", INT2NUM(GRPC_STATUS_OK));
175 rb_define_const(grpc_rb_mStatusCodes, "CANCELLED",
176 INT2NUM(GRPC_STATUS_CANCELLED));
177 rb_define_const(grpc_rb_mStatusCodes, "UNKNOWN",
178 INT2NUM(GRPC_STATUS_UNKNOWN));
179 rb_define_const(grpc_rb_mStatusCodes, "INVALID_ARGUMENT",
temiola58327912014-12-15 17:51:16 -0800180 INT2NUM(GRPC_STATUS_INVALID_ARGUMENT));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900181 rb_define_const(grpc_rb_mStatusCodes, "DEADLINE_EXCEEDED",
temiola58327912014-12-15 17:51:16 -0800182 INT2NUM(GRPC_STATUS_DEADLINE_EXCEEDED));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900183 rb_define_const(grpc_rb_mStatusCodes, "NOT_FOUND",
184 INT2NUM(GRPC_STATUS_NOT_FOUND));
185 rb_define_const(grpc_rb_mStatusCodes, "ALREADY_EXISTS",
temiola58327912014-12-15 17:51:16 -0800186 INT2NUM(GRPC_STATUS_ALREADY_EXISTS));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900187 rb_define_const(grpc_rb_mStatusCodes, "PERMISSION_DENIED",
temiola58327912014-12-15 17:51:16 -0800188 INT2NUM(GRPC_STATUS_PERMISSION_DENIED));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900189 rb_define_const(grpc_rb_mStatusCodes, "UNAUTHENTICATED",
temiola58327912014-12-15 17:51:16 -0800190 INT2NUM(GRPC_STATUS_UNAUTHENTICATED));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900191 rb_define_const(grpc_rb_mStatusCodes, "RESOURCE_EXHAUSTED",
temiola58327912014-12-15 17:51:16 -0800192 INT2NUM(GRPC_STATUS_RESOURCE_EXHAUSTED));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900193 rb_define_const(grpc_rb_mStatusCodes, "FAILED_PRECONDITION",
temiola58327912014-12-15 17:51:16 -0800194 INT2NUM(GRPC_STATUS_FAILED_PRECONDITION));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900195 rb_define_const(grpc_rb_mStatusCodes, "ABORTED",
196 INT2NUM(GRPC_STATUS_ABORTED));
197 rb_define_const(grpc_rb_mStatusCodes, "OUT_OF_RANGE",
temiola58327912014-12-15 17:51:16 -0800198 INT2NUM(GRPC_STATUS_OUT_OF_RANGE));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900199 rb_define_const(grpc_rb_mStatusCodes, "UNIMPLEMENTED",
temiola58327912014-12-15 17:51:16 -0800200 INT2NUM(GRPC_STATUS_UNIMPLEMENTED));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900201 rb_define_const(grpc_rb_mStatusCodes, "INTERNAL",
202 INT2NUM(GRPC_STATUS_INTERNAL));
203 rb_define_const(grpc_rb_mStatusCodes, "UNAVAILABLE",
temiola58327912014-12-15 17:51:16 -0800204 INT2NUM(GRPC_STATUS_UNAVAILABLE));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900205 rb_define_const(grpc_rb_mStatusCodes, "DATA_LOSS",
206 INT2NUM(GRPC_STATUS_DATA_LOSS));
temiola58327912014-12-15 17:51:16 -0800207}
208
nnoble097ef9b2014-12-01 17:06:10 -0800209/* id_at is the constructor method of the ruby standard Time class. */
210static ID id_at;
211
212/* id_inspect is the inspect method found on various ruby objects. */
213static ID id_inspect;
214
215/* id_to_s is the to_s method found on various ruby objects. */
216static ID id_to_s;
217
Tim Emiola98a32d32015-03-28 01:48:44 -0700218/* Converts a wrapped time constant to a standard time. */
Yuki Yugui Sonodaf0eee5f2015-04-16 20:25:28 +0900219static VALUE grpc_rb_time_val_to_time(VALUE self) {
nnoble097ef9b2014-12-01 17:06:10 -0800220 gpr_timespec *time_const = NULL;
Craig Tiller94329d02015-07-23 09:52:11 -0700221 gpr_timespec real_time;
Yuki Yugui Sonodad441c2e2015-04-11 15:33:58 +0900222 TypedData_Get_Struct(self, gpr_timespec, &grpc_rb_timespec_data_type,
223 time_const);
Craig Tiller94329d02015-07-23 09:52:11 -0700224 real_time = gpr_convert_clock_type(*time_const, GPR_CLOCK_REALTIME);
225 return rb_funcall(rb_cTime, id_at, 2, INT2NUM(real_time.tv_sec),
Eric Richardson8e769fd2016-07-08 12:36:54 -0400226 INT2NUM(real_time.tv_nsec / 1000));
nnoble097ef9b2014-12-01 17:06:10 -0800227}
228
229/* Invokes inspect on the ctime version of the time val. */
Yuki Yugui Sonodaf0eee5f2015-04-16 20:25:28 +0900230static VALUE grpc_rb_time_val_inspect(VALUE self) {
nnoble097ef9b2014-12-01 17:06:10 -0800231 return rb_funcall(grpc_rb_time_val_to_time(self), id_inspect, 0);
232}
233
234/* Invokes to_s on the ctime version of the time val. */
Yuki Yugui Sonodaf0eee5f2015-04-16 20:25:28 +0900235static VALUE grpc_rb_time_val_to_s(VALUE self) {
nnoble097ef9b2014-12-01 17:06:10 -0800236 return rb_funcall(grpc_rb_time_val_to_time(self), id_to_s, 0);
237}
238
Craig Tiller354398f2015-07-13 09:16:03 -0700239static gpr_timespec zero_realtime;
240static gpr_timespec inf_future_realtime;
241static gpr_timespec inf_past_realtime;
242
nnoble097ef9b2014-12-01 17:06:10 -0800243/* Adds a module with constants that map to gpr's static timeval structs. */
Yuki Yugui Sonodaf0eee5f2015-04-16 20:25:28 +0900244static void Init_grpc_time_consts() {
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900245 VALUE grpc_rb_mTimeConsts =
246 rb_define_module_under(grpc_rb_mGrpcCore, "TimeConsts");
247 grpc_rb_cTimeVal =
248 rb_define_class_under(grpc_rb_mGrpcCore, "TimeSpec", rb_cObject);
Craig Tiller354398f2015-07-13 09:16:03 -0700249 zero_realtime = gpr_time_0(GPR_CLOCK_REALTIME);
250 inf_future_realtime = gpr_inf_future(GPR_CLOCK_REALTIME);
251 inf_past_realtime = gpr_inf_past(GPR_CLOCK_REALTIME);
Yuki Yugui Sonodad441c2e2015-04-11 15:33:58 +0900252 rb_define_const(
253 grpc_rb_mTimeConsts, "ZERO",
254 TypedData_Wrap_Struct(grpc_rb_cTimeVal, &grpc_rb_timespec_data_type,
Craig Tiller354398f2015-07-13 09:16:03 -0700255 (void *)&zero_realtime));
Yuki Yugui Sonodad441c2e2015-04-11 15:33:58 +0900256 rb_define_const(
257 grpc_rb_mTimeConsts, "INFINITE_FUTURE",
258 TypedData_Wrap_Struct(grpc_rb_cTimeVal, &grpc_rb_timespec_data_type,
Craig Tiller354398f2015-07-13 09:16:03 -0700259 (void *)&inf_future_realtime));
Yuki Yugui Sonodad441c2e2015-04-11 15:33:58 +0900260 rb_define_const(
261 grpc_rb_mTimeConsts, "INFINITE_PAST",
262 TypedData_Wrap_Struct(grpc_rb_cTimeVal, &grpc_rb_timespec_data_type,
Craig Tiller354398f2015-07-13 09:16:03 -0700263 (void *)&inf_past_realtime));
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900264 rb_define_method(grpc_rb_cTimeVal, "to_time", grpc_rb_time_val_to_time, 0);
265 rb_define_method(grpc_rb_cTimeVal, "inspect", grpc_rb_time_val_inspect, 0);
266 rb_define_method(grpc_rb_cTimeVal, "to_s", grpc_rb_time_val_to_s, 0);
nnoble097ef9b2014-12-01 17:06:10 -0800267 id_at = rb_intern("at");
268 id_inspect = rb_intern("inspect");
269 id_to_s = rb_intern("to_s");
270 id_tv_sec = rb_intern("tv_sec");
271 id_tv_nsec = rb_intern("tv_nsec");
272}
273
Alexander Polcynf5521c32017-04-26 14:18:39 -0700274static void grpc_rb_shutdown(void) {
275 grpc_shutdown();
276}
nnoble097ef9b2014-12-01 17:06:10 -0800277
Tim Emiola409e6c82015-02-17 17:46:35 -0800278/* Initialize the GRPC module structs */
temiola21bb60c2014-12-18 10:58:22 -0800279
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900280/* grpc_rb_sNewServerRpc is the struct that holds new server rpc details. */
281VALUE grpc_rb_sNewServerRpc = Qnil;
282/* grpc_rb_sStatus is the struct that holds status details. */
283VALUE grpc_rb_sStatus = Qnil;
temiola21bb60c2014-12-18 10:58:22 -0800284
Tim Emiola409e6c82015-02-17 17:46:35 -0800285/* Initialize the GRPC module. */
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900286VALUE grpc_rb_mGRPC = Qnil;
287VALUE grpc_rb_mGrpcCore = Qnil;
temiola21bb60c2014-12-18 10:58:22 -0800288
Yuki Yugui Sonoda99eb9f92015-04-16 20:09:55 +0900289/* cached Symbols for members in Status struct */
290VALUE sym_code = Qundef;
291VALUE sym_details = Qundef;
292VALUE sym_metadata = Qundef;
293
Nicolas "Pixel" Noblecb903972016-02-21 22:58:26 +0100294static gpr_once g_once_init = GPR_ONCE_INIT;
295
Alexander Polcyn2a9b5d72017-04-14 12:10:55 -0700296static void grpc_ruby_once_init_internal() {
Nicolas "Pixel" Noblecb903972016-02-21 22:58:26 +0100297 grpc_init();
Alexander Polcyn2a9b5d72017-04-14 12:10:55 -0700298 grpc_rb_event_queue_thread_start();
299 grpc_rb_channel_polling_thread_start();
Nicolas "Pixel" Noblecb903972016-02-21 22:58:26 +0100300 atexit(grpc_rb_shutdown);
301}
302
Alexander Polcyn2a9b5d72017-04-14 12:10:55 -0700303void grpc_ruby_once_init() {
Nicolas "Pixel" Noble88dc3c52016-02-22 03:21:08 +0100304 /* ruby_vm_at_exit doesn't seem to be working. It would crash once every
305 * blue moon, and some users are getting it repeatedly. See the discussions
306 * - https://github.com/grpc/grpc/pull/5337
307 * - https://bugs.ruby-lang.org/issues/12095
308 *
309 * In order to still be able to handle the (unlikely) situation where the
310 * extension is loaded by a first Ruby VM that is subsequently destroyed,
311 * then loaded again by another VM within the same process, we need to
312 * schedule our initialization and destruction only once.
313 */
Alexander Polcyn2a9b5d72017-04-14 12:10:55 -0700314 gpr_once_init(&g_once_init, grpc_ruby_once_init_internal);
315}
316
317void Init_grpc_c() {
318 if (!grpc_rb_load_core()) {
319 rb_raise(rb_eLoadError, "Couldn't find or load gRPC's dynamic C core");
320 return;
321 }
Tim Emiola9161a822015-11-11 15:58:44 -0800322
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900323 grpc_rb_mGRPC = rb_define_module("GRPC");
324 grpc_rb_mGrpcCore = rb_define_module_under(grpc_rb_mGRPC, "Core");
Alexander Polcynf5521c32017-04-26 14:18:39 -0700325 grpc_rb_sNewServerRpc =
326 rb_struct_define("NewServerRpc", "method", "host",
327 "deadline", "metadata", "call", NULL);
Yuki Yugui Sonodaa7d369e2015-04-11 11:48:36 +0900328 grpc_rb_sStatus =
329 rb_struct_define("Status", "code", "details", "metadata", NULL);
Tim Emiola98a32d32015-03-28 01:48:44 -0700330 sym_code = ID2SYM(rb_intern("code"));
331 sym_details = ID2SYM(rb_intern("details"));
332 sym_metadata = ID2SYM(rb_intern("metadata"));
nnoble097ef9b2014-12-01 17:06:10 -0800333
Tim Emiola409e6c82015-02-17 17:46:35 -0800334 Init_grpc_channel();
Tim Emiola409e6c82015-02-17 17:46:35 -0800335 Init_grpc_call();
murgatroid999946f2b2015-12-04 14:36:27 -0800336 Init_grpc_call_credentials();
Tim Emiola9332ea62015-10-27 23:48:29 -0700337 Init_grpc_channel_credentials();
Tim Emiola409e6c82015-02-17 17:46:35 -0800338 Init_grpc_server();
339 Init_grpc_server_credentials();
340 Init_grpc_status_codes();
341 Init_grpc_time_consts();
Alexander Polcyn0dccf102016-06-27 13:11:07 -0700342 Init_grpc_compression_options();
nnoble097ef9b2014-12-01 17:06:10 -0800343}