aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/ext/grpc/rb_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby/ext/grpc/rb_server.c')
-rw-r--r--src/ruby/ext/grpc/rb_server.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/ruby/ext/grpc/rb_server.c b/src/ruby/ext/grpc/rb_server.c
index e96de4f2f9..160c1533ba 100644
--- a/src/ruby/ext/grpc/rb_server.c
+++ b/src/ruby/ext/grpc/rb_server.c
@@ -44,12 +44,12 @@ static VALUE id_insecure_server;
/* grpc_rb_server wraps a grpc_server. */
typedef struct grpc_rb_server {
/* The actual server */
- grpc_server *wrapped;
- grpc_completion_queue *queue;
+ grpc_server* wrapped;
+ grpc_completion_queue* queue;
gpr_atm shutdown_started;
} grpc_rb_server;
-static void destroy_server(grpc_rb_server *server, gpr_timespec deadline) {
+static void destroy_server(grpc_rb_server* server, gpr_timespec deadline) {
grpc_event ev;
// This can be started by app or implicitly by GC. Avoid a race between these.
if (gpr_atm_full_fetch_add(&server->shutdown_started, (gpr_atm)1) == 0) {
@@ -70,13 +70,13 @@ static void destroy_server(grpc_rb_server *server, gpr_timespec deadline) {
}
/* Destroys server instances. */
-static void grpc_rb_server_free(void *p) {
- grpc_rb_server *svr = NULL;
+static void grpc_rb_server_free(void* p) {
+ grpc_rb_server* svr = NULL;
gpr_timespec deadline;
if (p == NULL) {
return;
};
- svr = (grpc_rb_server *)p;
+ svr = (grpc_rb_server*)p;
deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_seconds(2, GPR_TIMESPAN));
@@ -105,7 +105,7 @@ static const rb_data_type_t grpc_rb_server_data_type = {
/* Allocates grpc_rb_server instances. */
static VALUE grpc_rb_server_alloc(VALUE cls) {
- grpc_rb_server *wrapper = ALLOC(grpc_rb_server);
+ grpc_rb_server* wrapper = ALLOC(grpc_rb_server);
wrapper->wrapped = NULL;
wrapper->shutdown_started = (gpr_atm)0;
return TypedData_Wrap_Struct(cls, &grpc_rb_server_data_type, wrapper);
@@ -117,9 +117,9 @@ static VALUE grpc_rb_server_alloc(VALUE cls) {
Initializes server instances. */
static VALUE grpc_rb_server_init(VALUE self, VALUE channel_args) {
- grpc_completion_queue *cq = NULL;
- grpc_rb_server *wrapper = NULL;
- grpc_server *srv = NULL;
+ grpc_completion_queue* cq = NULL;
+ grpc_rb_server* wrapper = NULL;
+ grpc_server* srv = NULL;
grpc_channel_args args;
MEMZERO(&args, grpc_channel_args, 1);
@@ -153,7 +153,7 @@ typedef struct request_call_stack {
/* grpc_request_call_stack_init ensures the request_call_stack is properly
* initialized */
-static void grpc_request_call_stack_init(request_call_stack *st) {
+static void grpc_request_call_stack_init(request_call_stack* st) {
MEMZERO(st, request_call_stack, 1);
grpc_metadata_array_init(&st->md_ary);
grpc_call_details_init(&st->details);
@@ -161,7 +161,7 @@ static void grpc_request_call_stack_init(request_call_stack *st) {
/* grpc_request_call_stack_cleanup ensures the request_call_stack is properly
* cleaned up */
-static void grpc_request_call_stack_cleanup(request_call_stack *st) {
+static void grpc_request_call_stack_cleanup(request_call_stack* st) {
grpc_metadata_array_destroy(&st->md_ary);
grpc_call_details_destroy(&st->details);
}
@@ -171,14 +171,14 @@ static void grpc_request_call_stack_cleanup(request_call_stack *st) {
Requests notification of a new call on a server. */
static VALUE grpc_rb_server_request_call(VALUE self) {
- grpc_rb_server *s = NULL;
- grpc_call *call = NULL;
+ grpc_rb_server* s = NULL;
+ grpc_call* call = NULL;
grpc_event ev;
grpc_call_error err;
request_call_stack st;
VALUE result;
- void *tag = (void *)&st;
- grpc_completion_queue *call_queue =
+ void* tag = (void*)&st;
+ grpc_completion_queue* call_queue =
grpc_completion_queue_create_for_pluck(NULL);
gpr_timespec deadline;
@@ -222,7 +222,7 @@ static VALUE grpc_rb_server_request_call(VALUE self) {
}
static VALUE grpc_rb_server_start(VALUE self) {
- grpc_rb_server *s = NULL;
+ grpc_rb_server* s = NULL;
TypedData_Get_Struct(self, grpc_rb_server, &grpc_rb_server_data_type, s);
if (s->wrapped == NULL) {
rb_raise(rb_eRuntimeError, "destroyed!");
@@ -244,10 +244,10 @@ static VALUE grpc_rb_server_start(VALUE self) {
server.destroy(timeout)
Destroys server instances. */
-static VALUE grpc_rb_server_destroy(int argc, VALUE *argv, VALUE self) {
+static VALUE grpc_rb_server_destroy(int argc, VALUE* argv, VALUE self) {
VALUE timeout = Qnil;
gpr_timespec deadline;
- grpc_rb_server *s = NULL;
+ grpc_rb_server* s = NULL;
/* "01" == 0 mandatory args, 1 (timeout) is optional */
rb_scan_args(argc, argv, "01", &timeout);
@@ -277,8 +277,8 @@ static VALUE grpc_rb_server_destroy(int argc, VALUE *argv, VALUE self) {
Adds a http2 port to server */
static VALUE grpc_rb_server_add_http2_port(VALUE self, VALUE port,
VALUE rb_creds) {
- grpc_rb_server *s = NULL;
- grpc_server_credentials *creds = NULL;
+ grpc_rb_server* s = NULL;
+ grpc_server_credentials* creds = NULL;
int recvd_port = 0;
TypedData_Get_Struct(self, grpc_rb_server, &grpc_rb_server_data_type, s);
@@ -335,8 +335,8 @@ void Init_grpc_server() {
}
/* Gets the wrapped server from the ruby wrapper */
-grpc_server *grpc_rb_get_wrapped_server(VALUE v) {
- grpc_rb_server *wrapper = NULL;
+grpc_server* grpc_rb_get_wrapped_server(VALUE v) {
+ grpc_rb_server* wrapper = NULL;
TypedData_Get_Struct(v, grpc_rb_server, &grpc_rb_server_data_type, wrapper);
return wrapper->wrapped;
}