From 01c4d995d35958c64e65feb8193c5ce2e0845758 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 7 Jul 2016 20:11:27 -0700 Subject: Added new features to load reporting. - Propagation of (rpc) method name. - Invocation of the hook at (call, channel) x (creation, destruction) - Added enum to identify the source of invocation. - Fixed testing. Went from test fixture to simple test. --- src/core/ext/census/grpc_filter.c | 4 +- src/core/ext/client_config/client_channel.c | 2 +- src/core/ext/load_reporting/load_reporting.h | 19 +- .../ext/load_reporting/load_reporting_filter.c | 92 ++++++++- src/core/lib/channel/channel_stack.c | 4 +- src/core/lib/channel/channel_stack.h | 17 +- src/core/lib/channel/compress_filter.c | 2 +- src/core/lib/channel/connected_channel.c | 2 +- src/core/lib/channel/http_client_filter.c | 2 +- src/core/lib/channel/http_server_filter.c | 2 +- .../lib/security/transport/client_auth_filter.c | 2 +- .../lib/security/transport/server_auth_filter.c | 2 +- src/core/lib/surface/call.c | 52 ++--- src/core/lib/surface/lame_client.c | 2 +- src/core/lib/surface/server.c | 2 +- src/core/lib/transport/static_metadata.c | 219 ++++++++++----------- src/core/lib/transport/static_metadata.h | 176 ++++++++--------- 17 files changed, 343 insertions(+), 258 deletions(-) (limited to 'src') diff --git a/src/core/ext/census/grpc_filter.c b/src/core/ext/census/grpc_filter.c index f51d850e01..3004a1fc97 100644 --- a/src/core/ext/census/grpc_filter.c +++ b/src/core/ext/census/grpc_filter.c @@ -138,7 +138,7 @@ static void client_init_call_elem(grpc_exec_ctx *exec_ctx, static void client_destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, + const grpc_call_final_info *final_info, void *ignored) { call_data *d = elem->call_data; GPR_ASSERT(d != NULL); @@ -158,7 +158,7 @@ static void server_init_call_elem(grpc_exec_ctx *exec_ctx, static void server_destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, + const grpc_call_final_info *final_info, void *ignored) { call_data *d = elem->call_data; GPR_ASSERT(d != NULL); diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index a096435c98..739487a06b 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -444,7 +444,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, + const grpc_call_final_info *final_info, void *and_free_memory) { grpc_subchannel_call_holder_destroy(exec_ctx, elem->call_data); gpr_free(and_free_memory); diff --git a/src/core/ext/load_reporting/load_reporting.h b/src/core/ext/load_reporting/load_reporting.h index 316cd89bd7..4f3ecd3661 100644 --- a/src/core/ext/load_reporting/load_reporting.h +++ b/src/core/ext/load_reporting/load_reporting.h @@ -34,16 +34,27 @@ #ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H #define GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H -#include "src/core/lib/iomgr/closure.h" -#include "src/core/lib/surface/call.h" +#include +#include "src/core/lib/channel/channel_stack.h" typedef struct grpc_load_reporting_config grpc_load_reporting_config; +typedef enum grpc_load_reporting_source { + GRPC_LR_POINT_UNKNOWN = 0, + GRPC_LR_POINT_CHANNEL_CREATION, + GRPC_LR_POINT_CHANNEL_DESTRUCTION, + GRPC_LR_POINT_CALL_CREATION, + GRPC_LR_POINT_CALL_DESTRUCTION +} grpc_load_reporting_source; + /** Call information to be passed to the provided load reporting function upon * completion of the call */ typedef struct grpc_load_reporting_call_data { - const grpc_call_stats *stats; /**< Stats for the call */ - const char *trailing_md_string; /**< LR trailing metadata info */ + const grpc_load_reporting_source source; + const grpc_call_final_info *final_info; + const char *initial_md_string; /**< value string for LR's initial md key */ + const char *trailing_md_string; /**< value string for LR's trailing md key */ + const char *method; /**< Corresponds to :path header */ } grpc_load_reporting_call_data; /** Custom function to be called by the load reporting filter. */ diff --git a/src/core/ext/load_reporting/load_reporting_filter.c b/src/core/ext/load_reporting/load_reporting_filter.c index f372f88c3a..11a39c5b75 100644 --- a/src/core/ext/load_reporting/load_reporting_filter.c +++ b/src/core/ext/load_reporting/load_reporting_filter.c @@ -42,7 +42,19 @@ #include "src/core/lib/profiling/timers.h" #include "src/core/lib/transport/static_metadata.h" -typedef struct call_data { const char *trailing_md_string; } call_data; +typedef struct call_data { + const char *trailing_md_string; + const char *initial_md_string; + const char *service_method; + + grpc_metadata_batch *recv_initial_metadata; + + grpc_closure *ops_recv_initial_metadata_ready; + + grpc_closure on_initial_md_ready; + +} call_data; + typedef struct channel_data { gpr_mu mu; grpc_load_reporting_config *lrc; @@ -55,21 +67,74 @@ static void invoke_lr_fn_locked(grpc_load_reporting_config *lrc, GPR_TIMER_END("load_reporting_config_fn", 0); } +typedef struct { + grpc_call_element *elem; + grpc_exec_ctx *exec_ctx; +} server_filter_args; + +static grpc_mdelem *recv_md_filter(void *user_data, grpc_mdelem *md) { + server_filter_args *a = user_data; + grpc_call_element *elem = a->elem; + call_data *calld = elem->call_data; + + if (md->key == GRPC_MDSTR_PATH) { + calld->service_method = grpc_mdstr_as_c_string(md->value); + } else if (md->key == GRPC_MDSTR_LOAD_REPORTING_INITIAL) { + calld->initial_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value)); + return NULL; + } + + return md; +} + +static void on_initial_md_ready(grpc_exec_ctx *exec_ctx, void *user_data, + grpc_error *err) { + grpc_call_element *elem = user_data; + call_data *calld = elem->call_data; + + if (err == GRPC_ERROR_NONE) { + server_filter_args a; + a.elem = elem; + a.exec_ctx = exec_ctx; + grpc_metadata_batch_filter(calld->recv_initial_metadata, recv_md_filter, &a); + if (calld->service_method == NULL) { + err = + grpc_error_add_child(err, GRPC_ERROR_CREATE("Missing :path header")); + } + } else { + GRPC_ERROR_REF(err); + } + calld->ops_recv_initial_metadata_ready->cb( + exec_ctx, calld->ops_recv_initial_metadata_ready->cb_arg, err); + GRPC_ERROR_UNREF(err); +} + /* Constructor for call_data */ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_call_element_args *args) { + channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; memset(calld, 0, sizeof(call_data)); + + grpc_closure_init(&calld->on_initial_md_ready, on_initial_md_ready, elem); + + grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_CREATION, + NULL, NULL, NULL, NULL}; + gpr_mu_lock(&chand->mu); + invoke_lr_fn_locked(chand->lrc, &lr_call_data); + gpr_mu_unlock(&chand->mu); } /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, void *ignored) { + const grpc_call_final_info *final_info, + void *ignored) { channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; - grpc_load_reporting_call_data lr_call_data = {stats, - calld->trailing_md_string}; + grpc_load_reporting_call_data lr_call_data = { + GRPC_LR_POINT_CALL_DESTRUCTION, final_info, calld->initial_md_string, + calld->trailing_md_string, calld->service_method}; gpr_mu_lock(&chand->mu); invoke_lr_fn_locked(chand->lrc, &lr_call_data); @@ -84,7 +149,6 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx, channel_data *chand = elem->channel_data; memset(chand, 0, sizeof(channel_data)); - gpr_mu_init(&chand->mu); for (size_t i = 0; i < args->channel_args->num_args; i++) { if (0 == strcmp(args->channel_args->args[i].key, @@ -98,8 +162,10 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx, } GPR_ASSERT(chand->lrc != NULL); /* arg actually found */ + grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CHANNEL_CREATION, + NULL, NULL, NULL, NULL}; gpr_mu_lock(&chand->mu); - invoke_lr_fn_locked(chand->lrc, NULL); + invoke_lr_fn_locked(chand->lrc, &lr_call_data); gpr_mu_unlock(&chand->mu); } @@ -107,6 +173,9 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx, static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) { channel_data *chand = elem->channel_data; + grpc_load_reporting_call_data lr_call_data = { + GRPC_LR_POINT_CHANNEL_DESTRUCTION, NULL, NULL, NULL, NULL}; + invoke_lr_fn_locked(chand->lrc, &lr_call_data); gpr_mu_destroy(&chand->mu); grpc_load_reporting_config_destroy(chand->lrc); } @@ -115,7 +184,7 @@ static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) { grpc_call_element *elem = user_data; call_data *calld = elem->call_data; - if (md->key == GRPC_MDSTR_LOAD_REPORTING) { + if (md->key == GRPC_MDSTR_LOAD_REPORTING_TRAILING) { calld->trailing_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value)); return NULL; } @@ -127,8 +196,15 @@ static void lr_start_transport_stream_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_transport_stream_op *op) { GPR_TIMER_BEGIN("lr_start_transport_stream_op", 0); + call_data *calld = elem->call_data; - if (op->send_trailing_metadata) { + if (op->recv_initial_metadata) { + /* substitute our callback for the higher callback */ + calld->recv_initial_metadata = op->recv_initial_metadata; + calld->ops_recv_initial_metadata_ready = + op->recv_initial_metadata_ready; + op->recv_initial_metadata_ready = &calld->on_initial_md_ready; + } else if (op->send_trailing_metadata) { grpc_metadata_batch_filter(op->send_trailing_metadata, lr_trailing_md_filter, elem); } diff --git a/src/core/lib/channel/channel_stack.c b/src/core/lib/channel/channel_stack.c index 87175d7943..f9b7347b89 100644 --- a/src/core/lib/channel/channel_stack.c +++ b/src/core/lib/channel/channel_stack.c @@ -217,7 +217,7 @@ void grpc_call_stack_ignore_set_pollset_or_pollset_set( grpc_polling_entity *pollent) {} void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack, - const grpc_call_stats *call_stats, + const grpc_call_final_info *final_info, void *and_free_memory) { grpc_call_element *elems = CALL_ELEMS_FROM_STACK(stack); size_t count = stack->count; @@ -225,7 +225,7 @@ void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack, /* destroy per-filter data */ for (i = 0; i < count; i++) { - elems[i].filter->destroy_call_elem(exec_ctx, &elems[i], call_stats, + elems[i].filter->destroy_call_elem(exec_ctx, &elems[i], final_info, i == count - 1 ? and_free_memory : NULL); } } diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index d72c015b67..d25917811d 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -75,9 +75,13 @@ typedef struct { typedef struct { grpc_transport_stream_stats transport_stream_stats; gpr_timespec latency; /* From call creating to enqueing of received status */ - grpc_status_code final_status; } grpc_call_stats; +typedef struct { + grpc_call_stats stats; + grpc_status_code final_status; +} grpc_call_final_info; + /* Channel filters specify: 1. the amount of memory needed in the channel & call (via the sizeof_XXX members) @@ -119,16 +123,17 @@ typedef struct { The filter does not need to do any chaining. The bottom filter of a stack will be passed a non-NULL pointer to \a and_free_memory that should be passed to gpr_free when destruction - is complete. */ + is complete. \a final_info contains data about the completed code, mainly + for reporting purposes. */ void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, + const grpc_call_final_info* final_info, void *and_free_memory); /* sizeof(per channel data) */ size_t sizeof_channel_data; /* Initialize per-channel data. - elem is initialized at the start of the call, and elem->channel_data is - what needs initializing. + elem is initialized at the creating of the channel, and elem->channel_data + is what needs initializing. is_first, is_last designate this elements position in the stack, and are useful for asserting correct configuration by upper layer code. The filter does not need to do any chaining */ @@ -243,7 +248,7 @@ void grpc_call_stack_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx, /* Destroy a call stack */ void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack, - const grpc_call_stats *call_stats, + const grpc_call_final_info *final_info, void *and_free_memory); /* Ignore set pollset{_set} - used by filters if they don't care about pollsets diff --git a/src/core/lib/channel/compress_filter.c b/src/core/lib/channel/compress_filter.c index 32ebe53ee6..b06e8fab67 100644 --- a/src/core/lib/channel/compress_filter.c +++ b/src/core/lib/channel/compress_filter.c @@ -270,7 +270,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, void *ignored) { + const grpc_call_final_info *final_info, void *ignored) { /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; gpr_slice_buffer_destroy(&calld->slices); diff --git a/src/core/lib/channel/connected_channel.c b/src/core/lib/channel/connected_channel.c index 0a7d27a1dc..73714369cd 100644 --- a/src/core/lib/channel/connected_channel.c +++ b/src/core/lib/channel/connected_channel.c @@ -104,7 +104,7 @@ static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, + const grpc_call_final_info *final_info, void *and_free_memory) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c index 8057e251f0..3e9e8b0981 100644 --- a/src/core/lib/channel/http_client_filter.c +++ b/src/core/lib/channel/http_client_filter.c @@ -184,7 +184,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, void *ignored) {} + const grpc_call_final_info *final_info, void *ignored) {} static grpc_mdelem *scheme_from_args(const grpc_channel_args *args) { unsigned i; diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c index d0beebd817..01509801d9 100644 --- a/src/core/lib/channel/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -235,7 +235,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, void *ignored) {} + const grpc_call_final_info *final_info, void *ignored) {} /* Constructor for channel_data */ static void init_channel_elem(grpc_exec_ctx *exec_ctx, diff --git a/src/core/lib/security/transport/client_auth_filter.c b/src/core/lib/security/transport/client_auth_filter.c index 14ccf72dc9..3f9bc73367 100644 --- a/src/core/lib/security/transport/client_auth_filter.c +++ b/src/core/lib/security/transport/client_auth_filter.c @@ -282,7 +282,7 @@ static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, void *ignored) { + const grpc_call_final_info *final_info, void *ignored) { call_data *calld = elem->call_data; grpc_call_credentials_unref(calld->creds); if (calld->host != NULL) { diff --git a/src/core/lib/security/transport/server_auth_filter.c b/src/core/lib/security/transport/server_auth_filter.c index 12e789bde9..416b0187a2 100644 --- a/src/core/lib/security/transport/server_auth_filter.c +++ b/src/core/lib/security/transport/server_auth_filter.c @@ -226,7 +226,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, void *ignored) {} + const grpc_call_final_info *final_info, void *ignored) {} /* Constructor for channel_data */ static void init_channel_elem(grpc_exec_ctx *exec_ctx, diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index e5668be47f..6d218112ab 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -154,8 +154,9 @@ struct grpc_call { /* Received call statuses from various sources */ received_status status[STATUS_SOURCE_COUNT]; - /* Call stats: only valid after trailing metadata received */ - grpc_call_stats stats; + /* Call data useful used for reporting. Only valid after the call has + * completed */ + grpc_call_final_info final_info; /* Compression algorithm for *incoming* data */ grpc_compression_algorithm incoming_compression_algorithm; @@ -360,6 +361,25 @@ void grpc_call_internal_unref(grpc_exec_ctx *exec_ctx, grpc_call *c REF_ARG) { GRPC_CALL_STACK_UNREF(exec_ctx, CALL_STACK_FROM_CALL(c), REF_REASON); } +static void get_final_status(grpc_call *call, + void (*set_value)(grpc_status_code code, + void *user_data), + void *set_value_user_data) { + int i; + for (i = 0; i < STATUS_SOURCE_COUNT; i++) { + if (call->status[i].is_set) { + set_value(call->status[i].code, set_value_user_data); + return; + } + } + if (call->is_client) { + set_value(GRPC_STATUS_UNKNOWN, set_value_user_data); + } else { + set_value(GRPC_STATUS_OK, set_value_user_data); + } +} + +static void set_status_value_directly(grpc_status_code status, void *dest); static void destroy_call(grpc_exec_ctx *exec_ctx, void *call, grpc_error *error) { size_t i; @@ -391,7 +411,11 @@ static void destroy_call(grpc_exec_ctx *exec_ctx, void *call, GRPC_CQ_INTERNAL_UNREF(c->cq, "bind"); } grpc_channel *channel = c->channel; - grpc_call_stack_destroy(exec_ctx, CALL_STACK_FROM_CALL(c), &c->stats, c); + + get_final_status(call, set_status_value_directly, + &c->final_info.final_status); + + grpc_call_stack_destroy(exec_ctx, CALL_STACK_FROM_CALL(c), &c->final_info, c); GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, "call"); GPR_TIMER_END("destroy_call", 0); } @@ -413,24 +437,6 @@ static void set_status_details(grpc_call *call, status_source source, } } -static void get_final_status(grpc_call *call, - void (*set_value)(grpc_status_code code, - void *user_data), - void *set_value_user_data) { - int i; - for (i = 0; i < STATUS_SOURCE_COUNT; i++) { - if (call->status[i].is_set) { - set_value(call->status[i].code, set_value_user_data); - return; - } - } - if (call->is_client) { - set_value(GRPC_STATUS_UNKNOWN, set_value_user_data); - } else { - set_value(GRPC_STATUS_OK, set_value_user_data); - } -} - static void set_status_from_error(grpc_call *call, status_source source, grpc_error *error) { intptr_t status; @@ -1607,7 +1613,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, bctl->recv_final_op = 1; stream_op.recv_trailing_metadata = &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */]; - stream_op.collect_stats = &call->stats.transport_stream_stats; + stream_op.collect_stats = &call->final_info.stats.transport_stream_stats; break; case GRPC_OP_RECV_CLOSE_ON_SERVER: /* Flag validation: currently allow no flags */ @@ -1629,7 +1635,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, bctl->recv_final_op = 1; stream_op.recv_trailing_metadata = &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */]; - stream_op.collect_stats = &call->stats.transport_stream_stats; + stream_op.collect_stats = &call->final_info.stats.transport_stream_stats; break; } } diff --git a/src/core/lib/surface/lame_client.c b/src/core/lib/surface/lame_client.c index 5ea4cba5d1..0d3168e56a 100644 --- a/src/core/lib/surface/lame_client.c +++ b/src/core/lib/surface/lame_client.c @@ -111,7 +111,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_call_element_args *args) {} static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, + const grpc_call_final_info *final_info, void *and_free_memory) { gpr_free(and_free_memory); } diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index def6e5068b..4671d6d09e 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -864,7 +864,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, } static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_stats *stats, void *ignored) { + const grpc_call_final_info *final_info, void *ignored) { channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.c index c5f16e530d..cd58857a1d 100644 --- a/src/core/lib/transport/static_metadata.c +++ b/src/core/lib/transport/static_metadata.c @@ -1,11 +1,11 @@ /* * Copyright 2015, Google Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -15,7 +15,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -31,10 +31,10 @@ /* * WARNING: Auto-generated code. - * + * * To make changes to this file, change * tools/codegen/core/gen_static_metadata.py, and then re-run it. - * + * * See metadata.h for an explanation of the interface here, and metadata.c for * an explanation of what's going on. */ @@ -45,114 +45,109 @@ grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT]; uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 8, 6, 2, 4, 8, 6, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,6,2,4,8,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +}; -const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2] = - {11, 35, 10, 35, 12, 35, 12, 49, 13, 35, 14, 35, 15, 35, 16, 35, 17, 35, - 19, 35, 20, 35, 21, 35, 24, 35, 25, 35, 26, 35, 27, 35, 28, 35, 29, 35, - 30, 18, 30, 35, 31, 35, 32, 35, 36, 35, 37, 35, 38, 35, 39, 35, 42, 33, - 42, 34, 42, 48, 42, 53, 42, 54, 42, 55, 42, 56, 43, 33, 43, 48, 43, 53, - 46, 0, 46, 1, 46, 2, 50, 35, 57, 35, 58, 35, 59, 35, 60, 35, 61, 35, - 62, 35, 63, 35, 64, 35, 65, 35, 66, 35, 67, 40, 67, 69, 67, 72, 68, 80, - 68, 81, 70, 35, 71, 35, 73, 35, 74, 35, 75, 35, 76, 35, 77, 41, 77, 51, - 77, 52, 78, 35, 79, 35, 82, 3, 82, 4, 82, 5, 82, 6, 82, 7, 82, 8, - 82, 9, 83, 35, 84, 85, 86, 35, 87, 35, 88, 35, 89, 35, 90, 35}; +const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT*2] = { +11,35,10,35,12,35,12,49,13,35,14,35,15,35,16,35,17,35,19,35,20,35,21,35,24,35,25,35,26,35,27,35,28,35,29,35,30,18,30,35,31,35,32,35,36,35,37,35,38,35,39,35,42,33,42,34,42,48,42,53,42,54,42,55,42,56,43,33,43,48,43,53,46,0,46,1,46,2,50,35,57,35,58,35,59,35,60,35,61,35,62,35,63,35,64,35,65,35,66,35,67,35,68,40,68,70,68,73,69,81,69,82,71,35,72,35,74,35,75,35,76,35,77,35,78,41,78,51,78,52,79,35,80,35,83,3,83,4,83,5,83,6,83,7,83,8,83,9,84,35,85,86,87,35,88,35,89,35,90,35,91,35 +}; const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = { - "0", - "1", - "2", - "200", - "204", - "206", - "304", - "400", - "404", - "500", - "accept", - "accept-charset", - "accept-encoding", - "accept-language", - "accept-ranges", - "access-control-allow-origin", - "age", - "allow", - "application/grpc", - ":authority", - "authorization", - "cache-control", - "census-bin", - "census-binary-bin", - "content-disposition", - "content-encoding", - "content-language", - "content-length", - "content-location", - "content-range", - "content-type", - "cookie", - "date", - "deflate", - "deflate,gzip", - "", - "etag", - "expect", - "expires", - "from", - "GET", - "grpc", - "grpc-accept-encoding", - "grpc-encoding", - "grpc-internal-encoding-request", - "grpc-message", - "grpc-status", - "grpc-timeout", - "gzip", - "gzip, deflate", - "host", - "http", - "https", - "identity", - "identity,deflate", - "identity,deflate,gzip", - "identity,gzip", - "if-match", - "if-modified-since", - "if-none-match", - "if-range", - "if-unmodified-since", - "last-modified", - "link", - "load-reporting", - "location", - "max-forwards", - ":method", - ":path", - "POST", - "proxy-authenticate", - "proxy-authorization", - "PUT", - "range", - "referer", - "refresh", - "retry-after", - ":scheme", - "server", - "set-cookie", - "/", - "/index.html", - ":status", - "strict-transport-security", - "te", - "trailers", - "transfer-encoding", - "user-agent", - "vary", - "via", - "www-authenticate"}; + "0", + "1", + "2", + "200", + "204", + "206", + "304", + "400", + "404", + "500", + "accept", + "accept-charset", + "accept-encoding", + "accept-language", + "accept-ranges", + "access-control-allow-origin", + "age", + "allow", + "application/grpc", + ":authority", + "authorization", + "cache-control", + "census-bin", + "census-binary-bin", + "content-disposition", + "content-encoding", + "content-language", + "content-length", + "content-location", + "content-range", + "content-type", + "cookie", + "date", + "deflate", + "deflate,gzip", + "", + "etag", + "expect", + "expires", + "from", + "GET", + "grpc", + "grpc-accept-encoding", + "grpc-encoding", + "grpc-internal-encoding-request", + "grpc-message", + "grpc-status", + "grpc-timeout", + "gzip", + "gzip, deflate", + "host", + "http", + "https", + "identity", + "identity,deflate", + "identity,deflate,gzip", + "identity,gzip", + "if-match", + "if-modified-since", + "if-none-match", + "if-range", + "if-unmodified-since", + "last-modified", + "link", + "load-reporting-initial", + "load-reporting-trailing", + "location", + "max-forwards", + ":method", + ":path", + "POST", + "proxy-authenticate", + "proxy-authorization", + "PUT", + "range", + "referer", + "refresh", + "retry-after", + ":scheme", + "server", + "set-cookie", + "/", + "/index.html", + ":status", + "strict-transport-security", + "te", + "trailers", + "transfer-encoding", + "user-agent", + "vary", + "via", + "www-authenticate" +}; + +const uint8_t grpc_static_accept_encoding_metadata[8] = { +0,29,26,30,28,32,27,31 +}; -const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 29, 26, 30, - 28, 32, 27, 31}; diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index 5ff0d2f3bc..1b6bfc1018 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -1,11 +1,11 @@ /* * Copyright 2015, Google Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -15,7 +15,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -31,10 +31,10 @@ /* * WARNING: Auto-generated code. - * + * * To make changes to this file, change * tools/codegen/core/gen_static_metadata.py, and then re-run it. - * + * * See metadata.h for an explanation of the interface here, and metadata.c for * an explanation of what's going on. */ @@ -44,7 +44,7 @@ #include "src/core/lib/transport/metadata.h" -#define GRPC_STATIC_MDSTR_COUNT 91 +#define GRPC_STATIC_MDSTR_COUNT 92 extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; /* "0" */ #define GRPC_MDSTR_0 (&grpc_static_mdstr_table[0]) @@ -157,8 +157,7 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; /* "identity,deflate" */ #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (&grpc_static_mdstr_table[54]) /* "identity,deflate,gzip" */ -#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (&grpc_static_mdstr_table[55]) +#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP (&grpc_static_mdstr_table[55]) /* "identity,gzip" */ #define GRPC_MDSTR_IDENTITY_COMMA_GZIP (&grpc_static_mdstr_table[56]) /* "if-match" */ @@ -175,62 +174,64 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_MDSTR_LAST_MODIFIED (&grpc_static_mdstr_table[62]) /* "link" */ #define GRPC_MDSTR_LINK (&grpc_static_mdstr_table[63]) -/* "load-reporting" */ -#define GRPC_MDSTR_LOAD_REPORTING (&grpc_static_mdstr_table[64]) +/* "load-reporting-initial" */ +#define GRPC_MDSTR_LOAD_REPORTING_INITIAL (&grpc_static_mdstr_table[64]) +/* "load-reporting-trailing" */ +#define GRPC_MDSTR_LOAD_REPORTING_TRAILING (&grpc_static_mdstr_table[65]) /* "location" */ -#define GRPC_MDSTR_LOCATION (&grpc_static_mdstr_table[65]) +#define GRPC_MDSTR_LOCATION (&grpc_static_mdstr_table[66]) /* "max-forwards" */ -#define GRPC_MDSTR_MAX_FORWARDS (&grpc_static_mdstr_table[66]) +#define GRPC_MDSTR_MAX_FORWARDS (&grpc_static_mdstr_table[67]) /* ":method" */ -#define GRPC_MDSTR_METHOD (&grpc_static_mdstr_table[67]) +#define GRPC_MDSTR_METHOD (&grpc_static_mdstr_table[68]) /* ":path" */ -#define GRPC_MDSTR_PATH (&grpc_static_mdstr_table[68]) +#define GRPC_MDSTR_PATH (&grpc_static_mdstr_table[69]) /* "POST" */ -#define GRPC_MDSTR_POST (&grpc_static_mdstr_table[69]) +#define GRPC_MDSTR_POST (&grpc_static_mdstr_table[70]) /* "proxy-authenticate" */ -#define GRPC_MDSTR_PROXY_AUTHENTICATE (&grpc_static_mdstr_table[70]) +#define GRPC_MDSTR_PROXY_AUTHENTICATE (&grpc_static_mdstr_table[71]) /* "proxy-authorization" */ -#define GRPC_MDSTR_PROXY_AUTHORIZATION (&grpc_static_mdstr_table[71]) +#define GRPC_MDSTR_PROXY_AUTHORIZATION (&grpc_static_mdstr_table[72]) /* "PUT" */ -#define GRPC_MDSTR_PUT (&grpc_static_mdstr_table[72]) +#define GRPC_MDSTR_PUT (&grpc_static_mdstr_table[73]) /* "range" */ -#define GRPC_MDSTR_RANGE (&grpc_static_mdstr_table[73]) +#define GRPC_MDSTR_RANGE (&grpc_static_mdstr_table[74]) /* "referer" */ -#define GRPC_MDSTR_REFERER (&grpc_static_mdstr_table[74]) +#define GRPC_MDSTR_REFERER (&grpc_static_mdstr_table[75]) /* "refresh" */ -#define GRPC_MDSTR_REFRESH (&grpc_static_mdstr_table[75]) +#define GRPC_MDSTR_REFRESH (&grpc_static_mdstr_table[76]) /* "retry-after" */ -#define GRPC_MDSTR_RETRY_AFTER (&grpc_static_mdstr_table[76]) +#define GRPC_MDSTR_RETRY_AFTER (&grpc_static_mdstr_table[77]) /* ":scheme" */ -#define GRPC_MDSTR_SCHEME (&grpc_static_mdstr_table[77]) +#define GRPC_MDSTR_SCHEME (&grpc_static_mdstr_table[78]) /* "server" */ -#define GRPC_MDSTR_SERVER (&grpc_static_mdstr_table[78]) +#define GRPC_MDSTR_SERVER (&grpc_static_mdstr_table[79]) /* "set-cookie" */ -#define GRPC_MDSTR_SET_COOKIE (&grpc_static_mdstr_table[79]) +#define GRPC_MDSTR_SET_COOKIE (&grpc_static_mdstr_table[80]) /* "/" */ -#define GRPC_MDSTR_SLASH (&grpc_static_mdstr_table[80]) +#define GRPC_MDSTR_SLASH (&grpc_static_mdstr_table[81]) /* "/index.html" */ -#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (&grpc_static_mdstr_table[81]) +#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (&grpc_static_mdstr_table[82]) /* ":status" */ -#define GRPC_MDSTR_STATUS (&grpc_static_mdstr_table[82]) +#define GRPC_MDSTR_STATUS (&grpc_static_mdstr_table[83]) /* "strict-transport-security" */ -#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (&grpc_static_mdstr_table[83]) +#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (&grpc_static_mdstr_table[84]) /* "te" */ -#define GRPC_MDSTR_TE (&grpc_static_mdstr_table[84]) +#define GRPC_MDSTR_TE (&grpc_static_mdstr_table[85]) /* "trailers" */ -#define GRPC_MDSTR_TRAILERS (&grpc_static_mdstr_table[85]) +#define GRPC_MDSTR_TRAILERS (&grpc_static_mdstr_table[86]) /* "transfer-encoding" */ -#define GRPC_MDSTR_TRANSFER_ENCODING (&grpc_static_mdstr_table[86]) +#define GRPC_MDSTR_TRANSFER_ENCODING (&grpc_static_mdstr_table[87]) /* "user-agent" */ -#define GRPC_MDSTR_USER_AGENT (&grpc_static_mdstr_table[87]) +#define GRPC_MDSTR_USER_AGENT (&grpc_static_mdstr_table[88]) /* "vary" */ -#define GRPC_MDSTR_VARY (&grpc_static_mdstr_table[88]) +#define GRPC_MDSTR_VARY (&grpc_static_mdstr_table[89]) /* "via" */ -#define GRPC_MDSTR_VIA (&grpc_static_mdstr_table[89]) +#define GRPC_MDSTR_VIA (&grpc_static_mdstr_table[90]) /* "www-authenticate" */ -#define GRPC_MDSTR_WWW_AUTHENTICATE (&grpc_static_mdstr_table[90]) +#define GRPC_MDSTR_WWW_AUTHENTICATE (&grpc_static_mdstr_table[91]) -#define GRPC_STATIC_MDELEM_COUNT 80 +#define GRPC_STATIC_MDELEM_COUNT 81 extern grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT]; extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "accept-charset": "" */ @@ -240,15 +241,13 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "accept-encoding": "" */ #define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY (&grpc_static_mdelem_table[2]) /* "accept-encoding": "gzip, deflate" */ -#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE \ - (&grpc_static_mdelem_table[3]) +#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE (&grpc_static_mdelem_table[3]) /* "accept-language": "" */ #define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY (&grpc_static_mdelem_table[4]) /* "accept-ranges": "" */ #define GRPC_MDELEM_ACCEPT_RANGES_EMPTY (&grpc_static_mdelem_table[5]) /* "access-control-allow-origin": "" */ -#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY \ - (&grpc_static_mdelem_table[6]) +#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY (&grpc_static_mdelem_table[6]) /* "age": "" */ #define GRPC_MDELEM_AGE_EMPTY (&grpc_static_mdelem_table[7]) /* "allow": "" */ @@ -272,8 +271,7 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "content-range": "" */ #define GRPC_MDELEM_CONTENT_RANGE_EMPTY (&grpc_static_mdelem_table[17]) /* "content-type": "application/grpc" */ -#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \ - (&grpc_static_mdelem_table[18]) +#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC (&grpc_static_mdelem_table[18]) /* "content-type": "" */ #define GRPC_MDELEM_CONTENT_TYPE_EMPTY (&grpc_static_mdelem_table[19]) /* "cookie": "" */ @@ -291,22 +289,17 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "grpc-accept-encoding": "deflate" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE (&grpc_static_mdelem_table[26]) /* "grpc-accept-encoding": "deflate,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \ - (&grpc_static_mdelem_table[27]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP (&grpc_static_mdelem_table[27]) /* "grpc-accept-encoding": "gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP (&grpc_static_mdelem_table[28]) /* "grpc-accept-encoding": "identity" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \ - (&grpc_static_mdelem_table[29]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY (&grpc_static_mdelem_table[29]) /* "grpc-accept-encoding": "identity,deflate" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \ - (&grpc_static_mdelem_table[30]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE (&grpc_static_mdelem_table[30]) /* "grpc-accept-encoding": "identity,deflate,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ - (&grpc_static_mdelem_table[31]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP (&grpc_static_mdelem_table[31]) /* "grpc-accept-encoding": "identity,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \ - (&grpc_static_mdelem_table[32]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP (&grpc_static_mdelem_table[32]) /* "grpc-encoding": "deflate" */ #define GRPC_MDELEM_GRPC_ENCODING_DEFLATE (&grpc_static_mdelem_table[33]) /* "grpc-encoding": "gzip" */ @@ -335,78 +328,77 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; #define GRPC_MDELEM_LAST_MODIFIED_EMPTY (&grpc_static_mdelem_table[45]) /* "link": "" */ #define GRPC_MDELEM_LINK_EMPTY (&grpc_static_mdelem_table[46]) -/* "load-reporting": "" */ -#define GRPC_MDELEM_LOAD_REPORTING_EMPTY (&grpc_static_mdelem_table[47]) +/* "load-reporting-initial": "" */ +#define GRPC_MDELEM_LOAD_REPORTING_INITIAL_EMPTY (&grpc_static_mdelem_table[47]) +/* "load-reporting-trailing": "" */ +#define GRPC_MDELEM_LOAD_REPORTING_TRAILING_EMPTY (&grpc_static_mdelem_table[48]) /* "location": "" */ -#define GRPC_MDELEM_LOCATION_EMPTY (&grpc_static_mdelem_table[48]) +#define GRPC_MDELEM_LOCATION_EMPTY (&grpc_static_mdelem_table[49]) /* "max-forwards": "" */ -#define GRPC_MDELEM_MAX_FORWARDS_EMPTY (&grpc_static_mdelem_table[49]) +#define GRPC_MDELEM_MAX_FORWARDS_EMPTY (&grpc_static_mdelem_table[50]) /* ":method": "GET" */ -#define GRPC_MDELEM_METHOD_GET (&grpc_static_mdelem_table[50]) +#define GRPC_MDELEM_METHOD_GET (&grpc_static_mdelem_table[51]) /* ":method": "POST" */ -#define GRPC_MDELEM_METHOD_POST (&grpc_static_mdelem_table[51]) +#define GRPC_MDELEM_METHOD_POST (&grpc_static_mdelem_table[52]) /* ":method": "PUT" */ -#define GRPC_MDELEM_METHOD_PUT (&grpc_static_mdelem_table[52]) +#define GRPC_MDELEM_METHOD_PUT (&grpc_static_mdelem_table[53]) /* ":path": "/" */ -#define GRPC_MDELEM_PATH_SLASH (&grpc_static_mdelem_table[53]) +#define GRPC_MDELEM_PATH_SLASH (&grpc_static_mdelem_table[54]) /* ":path": "/index.html" */ -#define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML (&grpc_static_mdelem_table[54]) +#define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML (&grpc_static_mdelem_table[55]) /* "proxy-authenticate": "" */ -#define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY (&grpc_static_mdelem_table[55]) +#define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY (&grpc_static_mdelem_table[56]) /* "proxy-authorization": "" */ -#define GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY (&grpc_static_mdelem_table[56]) +#define GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY (&grpc_static_mdelem_table[57]) /* "range": "" */ -#define GRPC_MDELEM_RANGE_EMPTY (&grpc_static_mdelem_table[57]) +#define GRPC_MDELEM_RANGE_EMPTY (&grpc_static_mdelem_table[58]) /* "referer": "" */ -#define GRPC_MDELEM_REFERER_EMPTY (&grpc_static_mdelem_table[58]) +#define GRPC_MDELEM_REFERER_EMPTY (&grpc_static_mdelem_table[59]) /* "refresh": "" */ -#define GRPC_MDELEM_REFRESH_EMPTY (&grpc_static_mdelem_table[59]) +#define GRPC_MDELEM_REFRESH_EMPTY (&grpc_static_mdelem_table[60]) /* "retry-after": "" */ -#define GRPC_MDELEM_RETRY_AFTER_EMPTY (&grpc_static_mdelem_table[60]) +#define GRPC_MDELEM_RETRY_AFTER_EMPTY (&grpc_static_mdelem_table[61]) /* ":scheme": "grpc" */ -#define GRPC_MDELEM_SCHEME_GRPC (&grpc_static_mdelem_table[61]) +#define GRPC_MDELEM_SCHEME_GRPC (&grpc_static_mdelem_table[62]) /* ":scheme": "http" */ -#define GRPC_MDELEM_SCHEME_HTTP (&grpc_static_mdelem_table[62]) +#define GRPC_MDELEM_SCHEME_HTTP (&grpc_static_mdelem_table[63]) /* ":scheme": "https" */ -#define GRPC_MDELEM_SCHEME_HTTPS (&grpc_static_mdelem_table[63]) +#define GRPC_MDELEM_SCHEME_HTTPS (&grpc_static_mdelem_table[64]) /* "server": "" */ -#define GRPC_MDELEM_SERVER_EMPTY (&grpc_static_mdelem_table[64]) +#define GRPC_MDELEM_SERVER_EMPTY (&grpc_static_mdelem_table[65]) /* "set-cookie": "" */ -#define GRPC_MDELEM_SET_COOKIE_EMPTY (&grpc_static_mdelem_table[65]) +#define GRPC_MDELEM_SET_COOKIE_EMPTY (&grpc_static_mdelem_table[66]) /* ":status": "200" */ -#define GRPC_MDELEM_STATUS_200 (&grpc_static_mdelem_table[66]) +#define GRPC_MDELEM_STATUS_200 (&grpc_static_mdelem_table[67]) /* ":status": "204" */ -#define GRPC_MDELEM_STATUS_204 (&grpc_static_mdelem_table[67]) +#define GRPC_MDELEM_STATUS_204 (&grpc_static_mdelem_table[68]) /* ":status": "206" */ -#define GRPC_MDELEM_STATUS_206 (&grpc_static_mdelem_table[68]) +#define GRPC_MDELEM_STATUS_206 (&grpc_static_mdelem_table[69]) /* ":status": "304" */ -#define GRPC_MDELEM_STATUS_304 (&grpc_static_mdelem_table[69]) +#define GRPC_MDELEM_STATUS_304 (&grpc_static_mdelem_table[70]) /* ":status": "400" */ -#define GRPC_MDELEM_STATUS_400 (&grpc_static_mdelem_table[70]) +#define GRPC_MDELEM_STATUS_400 (&grpc_static_mdelem_table[71]) /* ":status": "404" */ -#define GRPC_MDELEM_STATUS_404 (&grpc_static_mdelem_table[71]) +#define GRPC_MDELEM_STATUS_404 (&grpc_static_mdelem_table[72]) /* ":status": "500" */ -#define GRPC_MDELEM_STATUS_500 (&grpc_static_mdelem_table[72]) +#define GRPC_MDELEM_STATUS_500 (&grpc_static_mdelem_table[73]) /* "strict-transport-security": "" */ -#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \ - (&grpc_static_mdelem_table[73]) +#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY (&grpc_static_mdelem_table[74]) /* "te": "trailers" */ -#define GRPC_MDELEM_TE_TRAILERS (&grpc_static_mdelem_table[74]) +#define GRPC_MDELEM_TE_TRAILERS (&grpc_static_mdelem_table[75]) /* "transfer-encoding": "" */ -#define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY (&grpc_static_mdelem_table[75]) +#define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY (&grpc_static_mdelem_table[76]) /* "user-agent": "" */ -#define GRPC_MDELEM_USER_AGENT_EMPTY (&grpc_static_mdelem_table[76]) +#define GRPC_MDELEM_USER_AGENT_EMPTY (&grpc_static_mdelem_table[77]) /* "vary": "" */ -#define GRPC_MDELEM_VARY_EMPTY (&grpc_static_mdelem_table[77]) +#define GRPC_MDELEM_VARY_EMPTY (&grpc_static_mdelem_table[78]) /* "via": "" */ -#define GRPC_MDELEM_VIA_EMPTY (&grpc_static_mdelem_table[78]) +#define GRPC_MDELEM_VIA_EMPTY (&grpc_static_mdelem_table[79]) /* "www-authenticate": "" */ -#define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (&grpc_static_mdelem_table[79]) +#define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (&grpc_static_mdelem_table[80]) -extern const uint8_t - grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2]; +extern const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT*2]; extern const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT]; extern const uint8_t grpc_static_accept_encoding_metadata[8]; -#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) \ - (&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]]) +#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) (&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]]) #endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */ -- cgit v1.2.3 From 6eee24cfaf67c77ba39a55d01876201b6f3a70cd Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 11 Jul 2016 22:56:50 -0700 Subject: fixed failures in h2_proxy --- src/core/ext/load_reporting/load_reporting.c | 20 ++-- src/core/ext/load_reporting/load_reporting.h | 40 +++++--- .../ext/load_reporting/load_reporting_filter.c | 104 ++++++++++++--------- src/core/lib/channel/channel_stack.h | 3 +- test/core/end2end/tests/load_reporting_hook.c | 94 +++++++++++++++---- third_party/protobuf | 2 +- 6 files changed, 178 insertions(+), 85 deletions(-) (limited to 'src') diff --git a/src/core/ext/load_reporting/load_reporting.c b/src/core/ext/load_reporting/load_reporting.c index 9e4d32676f..1a1562d058 100644 --- a/src/core/ext/load_reporting/load_reporting.c +++ b/src/core/ext/load_reporting/load_reporting.c @@ -50,11 +50,11 @@ struct grpc_load_reporting_config { grpc_load_reporting_config *grpc_load_reporting_config_create( grpc_load_reporting_fn fn, void *user_data) { GPR_ASSERT(fn != NULL); - grpc_load_reporting_config *lrc = + grpc_load_reporting_config *lr_config = gpr_malloc(sizeof(grpc_load_reporting_config)); - lrc->fn = fn; - lrc->user_data = user_data; - return lrc; + lr_config->fn = fn; + lr_config->user_data = user_data; + return lr_config; } grpc_load_reporting_config *grpc_load_reporting_config_copy( @@ -62,14 +62,14 @@ grpc_load_reporting_config *grpc_load_reporting_config_copy( return grpc_load_reporting_config_create(src->fn, src->user_data); } -void grpc_load_reporting_config_destroy(grpc_load_reporting_config *lrc) { - gpr_free(lrc); +void grpc_load_reporting_config_destroy(grpc_load_reporting_config *lr_config) { + gpr_free(lr_config); } void grpc_load_reporting_config_call( - grpc_load_reporting_config *lrc, + grpc_load_reporting_config *lr_config, const grpc_load_reporting_call_data *call_data) { - lrc->fn(call_data, lrc->user_data); + lr_config->fn(call_data, lr_config->user_data); } static bool is_load_reporting_enabled(const grpc_channel_args *a) { @@ -110,11 +110,11 @@ static const grpc_arg_pointer_vtable lrd_ptr_vtable = { lrd_arg_copy, lrd_arg_destroy, lrd_arg_cmp}; grpc_arg grpc_load_reporting_config_create_arg( - grpc_load_reporting_config *lrc) { + grpc_load_reporting_config *lr_config) { grpc_arg arg; arg.type = GRPC_ARG_POINTER; arg.key = GRPC_ARG_ENABLE_LOAD_REPORTING; - arg.value.pointer.p = lrc; + arg.value.pointer.p = lr_config; arg.value.pointer.vtable = &lrd_ptr_vtable; return arg; } diff --git a/src/core/ext/load_reporting/load_reporting.h b/src/core/ext/load_reporting/load_reporting.h index 4f3ecd3661..71e5a7c0ab 100644 --- a/src/core/ext/load_reporting/load_reporting.h +++ b/src/core/ext/load_reporting/load_reporting.h @@ -37,8 +37,15 @@ #include #include "src/core/lib/channel/channel_stack.h" +/** Metadata key for initial metadata coming from clients */ +#define GRPC_LOAD_REPORTING_INITIAL_MD_KEY "load-reporting-initial" + +/** Metadata key for trailing metadata from servers */ +#define GRPC_LOAD_REPORTING_TRAILING_MD_KEY "load-reporting-trailing" + typedef struct grpc_load_reporting_config grpc_load_reporting_config; +/** Identifiers for the invocation point of the users LR callback */ typedef enum grpc_load_reporting_source { GRPC_LR_POINT_UNKNOWN = 0, GRPC_LR_POINT_CHANNEL_CREATION, @@ -47,17 +54,31 @@ typedef enum grpc_load_reporting_source { GRPC_LR_POINT_CALL_DESTRUCTION } grpc_load_reporting_source; -/** Call information to be passed to the provided load reporting function upon - * completion of the call */ +/** Call information to be passed to the provided LR callback. */ typedef struct grpc_load_reporting_call_data { - const grpc_load_reporting_source source; + const grpc_load_reporting_source source; /**< point of last data update. */ + + // XXX + intptr_t channel_id; + intptr_t call_id; + + /** Only valid when \a source is \a GRPC_LR_POINT_CALL_DESTRUCTION, that is, + * once the call has completed */ const grpc_call_final_info *final_info; + const char *initial_md_string; /**< value string for LR's initial md key */ const char *trailing_md_string; /**< value string for LR's trailing md key */ - const char *method; /**< Corresponds to :path header */ + const char *method_name; /**< Corresponds to :path header */ } grpc_load_reporting_call_data; -/** Custom function to be called by the load reporting filter. */ +/** Return a \a grpc_arg enabling load reporting */ +grpc_arg grpc_load_reporting_config_create_arg( + grpc_load_reporting_config *lr_config); + +/** Custom function to be called by the load reporting filter. + * + * \a call_data is provided by the runtime. \a user_data is given by the user + * as part of \a grpc_load_reporting_config_create */ typedef void (*grpc_load_reporting_fn)( const grpc_load_reporting_call_data *call_data, void *user_data); @@ -73,14 +94,11 @@ grpc_load_reporting_config *grpc_load_reporting_config_create( grpc_load_reporting_config *grpc_load_reporting_config_copy( grpc_load_reporting_config *src); -void grpc_load_reporting_config_destroy(grpc_load_reporting_config *lrc); +void grpc_load_reporting_config_destroy(grpc_load_reporting_config *lr_config); -/** Invoke the function registered by \a grpc_load_reporting_init. */ +/** Invoke the LR callback from \a lr_config with \a call_data */ void grpc_load_reporting_config_call( - grpc_load_reporting_config *lrc, + grpc_load_reporting_config *lr_config, const grpc_load_reporting_call_data *call_data); -/** Return a \a grpc_arg enabling load reporting */ -grpc_arg grpc_load_reporting_config_create_arg(grpc_load_reporting_config *lrc); - #endif /* GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H */ diff --git a/src/core/ext/load_reporting/load_reporting_filter.c b/src/core/ext/load_reporting/load_reporting_filter.c index 11a39c5b75..55e06f2774 100644 --- a/src/core/ext/load_reporting/load_reporting_filter.c +++ b/src/core/ext/load_reporting/load_reporting_filter.c @@ -31,6 +31,7 @@ * */ +#include #include #include #include @@ -43,37 +44,40 @@ #include "src/core/lib/transport/static_metadata.h" typedef struct call_data { - const char *trailing_md_string; - const char *initial_md_string; + intptr_t id; /**< an id unique to the call */ + char *trailing_md_string; + char *initial_md_string; const char *service_method; - grpc_metadata_batch *recv_initial_metadata; - + /* stores the recv_initial_metadata op's ready closure, which we wrap with our + * own (on_initial_md_ready) in order to capture the incoming initial metadata + * */ grpc_closure *ops_recv_initial_metadata_ready; + /* to get notified of the availability of the incoming initial metadata. */ grpc_closure on_initial_md_ready; - + grpc_metadata_batch *recv_initial_metadata; } call_data; typedef struct channel_data { - gpr_mu mu; - grpc_load_reporting_config *lrc; + intptr_t id; /**< an id unique to the channel */ + grpc_load_reporting_config *lr_config; } channel_data; -static void invoke_lr_fn_locked(grpc_load_reporting_config *lrc, +static void invoke_lr_fn_locked(grpc_load_reporting_config *lr_config, grpc_load_reporting_call_data *lr_call_data) { GPR_TIMER_BEGIN("load_reporting_config_fn", 0); - grpc_load_reporting_config_call(lrc, lr_call_data); + grpc_load_reporting_config_call(lr_config, lr_call_data); GPR_TIMER_END("load_reporting_config_fn", 0); } typedef struct { grpc_call_element *elem; grpc_exec_ctx *exec_ctx; -} server_filter_args; +} recv_md_filter_args; static grpc_mdelem *recv_md_filter(void *user_data, grpc_mdelem *md) { - server_filter_args *a = user_data; + recv_md_filter_args *a = user_data; grpc_call_element *elem = a->elem; call_data *calld = elem->call_data; @@ -81,22 +85,22 @@ static grpc_mdelem *recv_md_filter(void *user_data, grpc_mdelem *md) { calld->service_method = grpc_mdstr_as_c_string(md->value); } else if (md->key == GRPC_MDSTR_LOAD_REPORTING_INITIAL) { calld->initial_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value)); - return NULL; } return md; } static void on_initial_md_ready(grpc_exec_ctx *exec_ctx, void *user_data, - grpc_error *err) { + grpc_error *err) { grpc_call_element *elem = user_data; call_data *calld = elem->call_data; if (err == GRPC_ERROR_NONE) { - server_filter_args a; + recv_md_filter_args a; a.elem = elem; a.exec_ctx = exec_ctx; - grpc_metadata_batch_filter(calld->recv_initial_metadata, recv_md_filter, &a); + grpc_metadata_batch_filter(calld->recv_initial_metadata, recv_md_filter, + &a); if (calld->service_method == NULL) { err = grpc_error_add_child(err, GRPC_ERROR_CREATE("Missing :path header")); @@ -116,13 +120,17 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, call_data *calld = elem->call_data; memset(calld, 0, sizeof(call_data)); + calld->id = (intptr_t)args->call_stack; grpc_closure_init(&calld->on_initial_md_ready, on_initial_md_ready, elem); grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_CREATION, - NULL, NULL, NULL, NULL}; - gpr_mu_lock(&chand->mu); - invoke_lr_fn_locked(chand->lrc, &lr_call_data); - gpr_mu_unlock(&chand->mu); + (intptr_t)chand->id, + (intptr_t)calld->id, + NULL, + NULL, + NULL, + NULL}; + invoke_lr_fn_locked(chand->lr_config, &lr_call_data); } /* Destructor for call_data */ @@ -132,13 +140,18 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; - grpc_load_reporting_call_data lr_call_data = { - GRPC_LR_POINT_CALL_DESTRUCTION, final_info, calld->initial_md_string, - calld->trailing_md_string, calld->service_method}; + grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_DESTRUCTION, + (intptr_t)chand->id, + (intptr_t)calld->id, + final_info, + calld->initial_md_string, + calld->trailing_md_string, + calld->service_method}; - gpr_mu_lock(&chand->mu); - invoke_lr_fn_locked(chand->lrc, &lr_call_data); - gpr_mu_unlock(&chand->mu); + invoke_lr_fn_locked(chand->lr_config, &lr_call_data); + + gpr_free(calld->initial_md_string); + gpr_free(calld->trailing_md_string); } /* Constructor for channel_data */ @@ -149,24 +162,28 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx, channel_data *chand = elem->channel_data; memset(chand, 0, sizeof(channel_data)); - gpr_mu_init(&chand->mu); + + chand->id = (intptr_t)args->channel_stack; for (size_t i = 0; i < args->channel_args->num_args; i++) { if (0 == strcmp(args->channel_args->args[i].key, GRPC_ARG_ENABLE_LOAD_REPORTING)) { - grpc_load_reporting_config *arg_lrc = + grpc_load_reporting_config *arg_lr_config = args->channel_args->args[i].value.pointer.p; - chand->lrc = grpc_load_reporting_config_copy(arg_lrc); - GPR_ASSERT(chand->lrc != NULL); + chand->lr_config = grpc_load_reporting_config_copy(arg_lr_config); + GPR_ASSERT(chand->lr_config != NULL); break; } } - GPR_ASSERT(chand->lrc != NULL); /* arg actually found */ + GPR_ASSERT(chand->lr_config != NULL); /* arg actually found */ grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CHANNEL_CREATION, - NULL, NULL, NULL, NULL}; - gpr_mu_lock(&chand->mu); - invoke_lr_fn_locked(chand->lrc, &lr_call_data); - gpr_mu_unlock(&chand->mu); + (intptr_t)chand, + 0, + NULL, + NULL, + NULL, + NULL}; + invoke_lr_fn_locked(chand->lr_config, &lr_call_data); } /* Destructor for channel data */ @@ -174,10 +191,15 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) { channel_data *chand = elem->channel_data; grpc_load_reporting_call_data lr_call_data = { - GRPC_LR_POINT_CHANNEL_DESTRUCTION, NULL, NULL, NULL, NULL}; - invoke_lr_fn_locked(chand->lrc, &lr_call_data); - gpr_mu_destroy(&chand->mu); - grpc_load_reporting_config_destroy(chand->lrc); + GRPC_LR_POINT_CHANNEL_DESTRUCTION, + (intptr_t)chand->id, + 0, + NULL, + NULL, + NULL, + NULL}; + invoke_lr_fn_locked(chand->lr_config, &lr_call_data); + grpc_load_reporting_config_destroy(chand->lr_config); } static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) { @@ -186,7 +208,6 @@ static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) { if (md->key == GRPC_MDSTR_LOAD_REPORTING_TRAILING) { calld->trailing_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value)); - return NULL; } return md; @@ -199,10 +220,9 @@ static void lr_start_transport_stream_op(grpc_exec_ctx *exec_ctx, call_data *calld = elem->call_data; if (op->recv_initial_metadata) { - /* substitute our callback for the higher callback */ calld->recv_initial_metadata = op->recv_initial_metadata; - calld->ops_recv_initial_metadata_ready = - op->recv_initial_metadata_ready; + /* substitute our callback for the higher callback */ + calld->ops_recv_initial_metadata_ready = op->recv_initial_metadata_ready; op->recv_initial_metadata_ready = &calld->on_initial_md_ready; } else if (op->send_trailing_metadata) { grpc_metadata_batch_filter(op->send_trailing_metadata, diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index d25917811d..6a18c3dc4d 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -77,6 +77,7 @@ typedef struct { gpr_timespec latency; /* From call creating to enqueing of received status */ } grpc_call_stats; +/** Information about the call upon completion. */ typedef struct { grpc_call_stats stats; grpc_status_code final_status; @@ -123,7 +124,7 @@ typedef struct { The filter does not need to do any chaining. The bottom filter of a stack will be passed a non-NULL pointer to \a and_free_memory that should be passed to gpr_free when destruction - is complete. \a final_info contains data about the completed code, mainly + is complete. \a final_info contains data about the completed call, mainly for reporting purposes. */ void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, const grpc_call_final_info* final_info, diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index 51a05a36d7..5ee973a1db 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -45,50 +45,69 @@ #include "src/core/ext/load_reporting/load_reporting.h" #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/transport/static_metadata.h" enum { TIMEOUT = 200000 }; static void *tag(intptr_t t) { return (void *)t; } typedef struct { + gpr_mu mu; + intptr_t channel_id; + intptr_t call_id; + uint32_t call_creation_token; /* expected 0xCAFED00D */ uint32_t call_destruction_token; /* expected 0xDEADD00D */ uint32_t channel_creation_token; /* expected 0xCAFEFACE */ uint32_t channel_destruction_token; /* expected 0xDEADFACE */ + char *initial_md_str; + char *trailing_md_str; char *method_name; - uint64_t total_bytes; + uint64_t incoming_bytes; + uint64_t outgoing_bytes; bool fully_processed; } aggregated_bw_stats; static void sample_fn(const grpc_load_reporting_call_data *call_data, void *user_data) { GPR_ASSERT(user_data != NULL); + aggregated_bw_stats *custom_stats = (aggregated_bw_stats *)user_data; + gpr_mu_lock(&custom_stats->mu); + switch (call_data->source) { case GRPC_LR_POINT_CHANNEL_CREATION: custom_stats->channel_creation_token = 0xCAFEFACE; + custom_stats->channel_id = call_data->channel_id; break; case GRPC_LR_POINT_CHANNEL_DESTRUCTION: custom_stats->channel_destruction_token = 0xDEADFACE; break; case GRPC_LR_POINT_CALL_CREATION: custom_stats->call_creation_token = 0xCAFED00D; + custom_stats->call_id = call_data->call_id; break; case GRPC_LR_POINT_CALL_DESTRUCTION: - custom_stats->method_name = gpr_strdup(call_data->method); + custom_stats->initial_md_str = gpr_strdup(call_data->initial_md_string); + custom_stats->trailing_md_str = gpr_strdup(call_data->trailing_md_string); + + custom_stats->method_name = gpr_strdup(call_data->method_name); + custom_stats->call_destruction_token = 0xDEADD00D; - custom_stats->total_bytes = - call_data->final_info->stats.transport_stream_stats.outgoing - .data_bytes + + custom_stats->incoming_bytes = call_data->final_info->stats.transport_stream_stats.incoming .data_bytes; + custom_stats->outgoing_bytes = + call_data->final_info->stats.transport_stream_stats.outgoing + .data_bytes; custom_stats->fully_processed = true; break; default: abort(); } + gpr_mu_unlock(&custom_stats->mu); } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -146,7 +165,9 @@ static void end_test(grpc_end2end_test_fixture *f) { static void request_response_with_payload(grpc_end2end_test_fixture f, const char *method_name, const char *request_msg, - const char *response_msg) { + const char *response_msg, + grpc_metadata *initial_lr_metadata, + grpc_metadata *trailing_lr_metadata) { gpr_slice request_payload_slice = gpr_slice_from_copied_string(request_msg); gpr_slice response_payload_slice = gpr_slice_from_copied_string(response_msg); grpc_call *c; @@ -184,7 +205,9 @@ static void request_response_with_payload(grpc_end2end_test_fixture f, memset(ops, 0, sizeof(ops)); op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; - op->data.send_initial_metadata.count = 0; + GPR_ASSERT(initial_lr_metadata != NULL); + op->data.send_initial_metadata.count = 1; + op->data.send_initial_metadata.metadata = initial_lr_metadata; op->flags = 0; op->reserved = NULL; op++; @@ -256,7 +279,9 @@ static void request_response_with_payload(grpc_end2end_test_fixture f, op->reserved = NULL; op++; op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; - op->data.send_status_from_server.trailing_metadata_count = 0; + GPR_ASSERT(trailing_lr_metadata != NULL); + op->data.send_status_from_server.trailing_metadata_count = 1; + op->data.send_status_from_server.trailing_metadata = trailing_lr_metadata; op->data.send_status_from_server.status = GRPC_STATUS_OK; op->data.send_status_from_server.status_details = "xyz"; op->flags = 0; @@ -292,6 +317,7 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { aggregated_bw_stats *aggr_stats_server = gpr_malloc(sizeof(aggregated_bw_stats)); memset(aggr_stats_server, 0, sizeof(aggregated_bw_stats)); + gpr_mu_init(&aggr_stats_server->mu); grpc_load_reporting_config *server_lrc = grpc_load_reporting_config_create(sample_fn, aggr_stats_server); @@ -305,27 +331,55 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { begin_test(config, "test_load_reporting_hook", NULL, lr_server_args); const char *method_name = "/gRPCFTW"; - const char *request_msg = "so long!"; - const char *response_msg = "I'm back!"; - request_response_with_payload(f, method_name, request_msg, response_msg); + const char *request_msg = "the msg from the client"; + const char *response_msg = "... and the response from the server"; + + grpc_metadata initial_lr_metadata; + grpc_metadata trailing_lr_metadata; + + initial_lr_metadata.key = GRPC_LOAD_REPORTING_INITIAL_MD_KEY; + initial_lr_metadata.value = "client-token"; + initial_lr_metadata.value_length = strlen(initial_lr_metadata.value); + memset(&initial_lr_metadata.internal_data, 0, + sizeof(initial_lr_metadata.internal_data)); + + trailing_lr_metadata.key = GRPC_LOAD_REPORTING_TRAILING_MD_KEY; + trailing_lr_metadata.value = "server-token"; + trailing_lr_metadata.value_length = strlen(trailing_lr_metadata.value); + memset(&trailing_lr_metadata.internal_data, 0, + sizeof(trailing_lr_metadata.internal_data)); + + request_response_with_payload(f, method_name, request_msg, response_msg, + &initial_lr_metadata, &trailing_lr_metadata); end_test(&f); grpc_channel_args_destroy(lr_server_args); config.tear_down_data(&f); - if (aggr_stats_server->fully_processed) { - GPR_ASSERT(aggr_stats_server->total_bytes == - 5 + strlen(request_msg) + strlen(response_msg)); + GPR_ASSERT(aggr_stats_server->fully_processed); + GPR_ASSERT(aggr_stats_server->incoming_bytes == + /* 5 FIXME */ /* compression bit(1) + msg length(4) */ +strlen( + request_msg)); + GPR_ASSERT(aggr_stats_server->outgoing_bytes == + 5 /* compression bit(1) + msg length(4) */ + strlen(response_msg)); - GPR_ASSERT(aggr_stats_server->channel_creation_token == 0xCAFEFACE); - GPR_ASSERT(aggr_stats_server->channel_destruction_token == 0xDEADFACE); + GPR_ASSERT(aggr_stats_server->call_id > 0); + GPR_ASSERT(aggr_stats_server->channel_id > 0); - GPR_ASSERT(aggr_stats_server->call_creation_token == 0xCAFED00D); - GPR_ASSERT(aggr_stats_server->call_destruction_token == 0xDEADD00D); + GPR_ASSERT(aggr_stats_server->channel_creation_token == 0xCAFEFACE); + GPR_ASSERT(aggr_stats_server->channel_destruction_token == 0xDEADFACE); - GPR_ASSERT(strcmp(aggr_stats_server->method_name, "/gRPCFTW") == 0); - } + GPR_ASSERT(aggr_stats_server->call_creation_token == 0xCAFED00D); + GPR_ASSERT(aggr_stats_server->call_destruction_token == 0xDEADD00D); + + GPR_ASSERT(strcmp(aggr_stats_server->method_name, "/gRPCFTW") == 0); + + GPR_ASSERT(aggr_stats_server->initial_md_str != NULL); + GPR_ASSERT(aggr_stats_server->trailing_md_str != NULL); + GPR_ASSERT(strcmp(aggr_stats_server->initial_md_str, "client-token") == 0); + GPR_ASSERT(strcmp(aggr_stats_server->trailing_md_str, "server-token") == 0); gpr_free(aggr_stats_server->method_name); + gpr_mu_destroy(&aggr_stats_server->mu); gpr_free(aggr_stats_server); grpc_load_reporting_config_destroy(server_lrc); } diff --git a/third_party/protobuf b/third_party/protobuf index bdeb215cab..d4d13a4349 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit bdeb215cab2985195325fcd5e70c3fa751f46e0f +Subproject commit d4d13a4349e4e59d67f311185ddcc1890d956d7a -- cgit v1.2.3 From b5c9334ae660c9166970fb04ef29861ce0595d93 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 11 Jul 2016 23:51:11 -0700 Subject: discount grpc framing bytes --- src/core/ext/transport/chttp2/transport/writing.c | 5 +++++ test/core/end2end/tests/load_reporting_hook.c | 7 ++----- third_party/protobuf | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core/ext/transport/chttp2/transport/writing.c b/src/core/ext/transport/chttp2/transport/writing.c index b19f5f068d..9182177ee8 100644 --- a/src/core/ext/transport/chttp2/transport/writing.c +++ b/src/core/ext/transport/chttp2/transport/writing.c @@ -198,6 +198,7 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx, GPR_TIMER_BEGIN("finalize_outbuf", 0); + bool is_first_data_frame = true; while ( grpc_chttp2_list_pop_writing_stream(transport_writing, &stream_writing)) { uint32_t max_outgoing = @@ -262,6 +263,10 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx, stream_writing->id, &stream_writing->flow_controlled_buffer, send_bytes, is_last_frame, &stream_writing->stats, &transport_writing->outbuf); + if (is_first_data_frame) { + stream_writing->stats.data_bytes -= 5; /* discount grpc framing */ + is_first_data_frame = false; + } GRPC_CHTTP2_FLOW_DEBIT_STREAM("write", transport_writing, stream_writing, outgoing_window, send_bytes); diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index 5ee973a1db..b9cd325c26 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -356,11 +356,8 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { config.tear_down_data(&f); GPR_ASSERT(aggr_stats_server->fully_processed); - GPR_ASSERT(aggr_stats_server->incoming_bytes == - /* 5 FIXME */ /* compression bit(1) + msg length(4) */ +strlen( - request_msg)); - GPR_ASSERT(aggr_stats_server->outgoing_bytes == - 5 /* compression bit(1) + msg length(4) */ + strlen(response_msg)); + GPR_ASSERT(aggr_stats_server->incoming_bytes == strlen(request_msg)); + GPR_ASSERT(aggr_stats_server->outgoing_bytes == strlen(response_msg)); GPR_ASSERT(aggr_stats_server->call_id > 0); GPR_ASSERT(aggr_stats_server->channel_id > 0); diff --git a/third_party/protobuf b/third_party/protobuf index d4d13a4349..bdeb215cab 160000 --- a/third_party/protobuf +++ b/third_party/protobuf @@ -1 +1 @@ -Subproject commit d4d13a4349e4e59d67f311185ddcc1890d956d7a +Subproject commit bdeb215cab2985195325fcd5e70c3fa751f46e0f -- cgit v1.2.3 From c0299df85decd3197c45550f19c874a8d96b8318 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 12 Jul 2016 14:23:43 -0700 Subject: added some more docs --- src/core/ext/load_reporting/load_reporting.h | 5 ++++- src/core/ext/transport/chttp2/transport/writing.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/ext/load_reporting/load_reporting.h b/src/core/ext/load_reporting/load_reporting.h index 71e5a7c0ab..6a9772a2bd 100644 --- a/src/core/ext/load_reporting/load_reporting.h +++ b/src/core/ext/load_reporting/load_reporting.h @@ -58,8 +58,11 @@ typedef enum grpc_load_reporting_source { typedef struct grpc_load_reporting_call_data { const grpc_load_reporting_source source; /**< point of last data update. */ - // XXX + /** Unique identifier for the channel associated with the data */ intptr_t channel_id; + + /** Unique identifier for the call associated with the data. If the call + * hasn't been created yet, it'll have a value of zero. */ intptr_t call_id; /** Only valid when \a source is \a GRPC_LR_POINT_CALL_DESTRUCTION, that is, diff --git a/src/core/ext/transport/chttp2/transport/writing.c b/src/core/ext/transport/chttp2/transport/writing.c index 9182177ee8..a2ac8e8ec9 100644 --- a/src/core/ext/transport/chttp2/transport/writing.c +++ b/src/core/ext/transport/chttp2/transport/writing.c @@ -264,6 +264,7 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx, send_bytes, is_last_frame, &stream_writing->stats, &transport_writing->outbuf); if (is_first_data_frame) { + /* TODO(dgq): this is a hack. It'll be fix in a future refactoring */ stream_writing->stats.data_bytes -= 5; /* discount grpc framing */ is_first_data_frame = false; } -- cgit v1.2.3 From 824363dc2f521d0712ab7d6bc03f15939ea51aa5 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 13 Jul 2016 23:09:34 -0700 Subject: Simplified LR filter --- Makefile | 56 + src/core/ext/load_reporting/load_reporting.c | 59 +- src/core/ext/load_reporting/load_reporting.h | 31 +- .../ext/load_reporting/load_reporting_filter.c | 38 +- .../ext/load_reporting/load_reporting_filter.h | 1 + test/core/end2end/fixtures/h2_load_reporting.c | 125 + test/core/end2end/gen_build_yaml.py | 1 + test/core/end2end/tests/load_reporting_hook.c | 107 +- tools/run_tests/sources_and_headers.json | 34 + tools/run_tests/tests.json | 4338 ++++++++++++++------ vsprojects/buildtests_c.sln | 56 + .../h2_load_reporting_nosec_test.vcxproj | 202 + .../h2_load_reporting_nosec_test.vcxproj.filters | 24 + .../h2_load_reporting_test.vcxproj | 202 + .../h2_load_reporting_test.vcxproj.filters | 24 + 15 files changed, 3852 insertions(+), 1446 deletions(-) create mode 100644 test/core/end2end/fixtures/h2_load_reporting.c create mode 100644 vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj create mode 100644 vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj.filters create mode 100644 vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj create mode 100644 vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj.filters (limited to 'src') diff --git a/Makefile b/Makefile index 933bc9e8ae..b357414c52 100644 --- a/Makefile +++ b/Makefile @@ -1101,6 +1101,7 @@ h2_fd_test: $(BINDIR)/$(CONFIG)/h2_fd_test h2_full_test: $(BINDIR)/$(CONFIG)/h2_full_test h2_full+pipe_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_test h2_full+trace_test: $(BINDIR)/$(CONFIG)/h2_full+trace_test +h2_load_reporting_test: $(BINDIR)/$(CONFIG)/h2_load_reporting_test h2_oauth2_test: $(BINDIR)/$(CONFIG)/h2_oauth2_test h2_proxy_test: $(BINDIR)/$(CONFIG)/h2_proxy_test h2_sockpair_test: $(BINDIR)/$(CONFIG)/h2_sockpair_test @@ -1116,6 +1117,7 @@ h2_fd_nosec_test: $(BINDIR)/$(CONFIG)/h2_fd_nosec_test h2_full_nosec_test: $(BINDIR)/$(CONFIG)/h2_full_nosec_test h2_full+pipe_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test h2_full+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+trace_nosec_test +h2_load_reporting_nosec_test: $(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test h2_proxy_nosec_test: $(BINDIR)/$(CONFIG)/h2_proxy_nosec_test h2_sockpair_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test h2_sockpair+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test @@ -1316,6 +1318,7 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/h2_full_test \ $(BINDIR)/$(CONFIG)/h2_full+pipe_test \ $(BINDIR)/$(CONFIG)/h2_full+trace_test \ + $(BINDIR)/$(CONFIG)/h2_load_reporting_test \ $(BINDIR)/$(CONFIG)/h2_oauth2_test \ $(BINDIR)/$(CONFIG)/h2_proxy_test \ $(BINDIR)/$(CONFIG)/h2_sockpair_test \ @@ -1331,6 +1334,7 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/h2_full_nosec_test \ $(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test \ $(BINDIR)/$(CONFIG)/h2_full+trace_nosec_test \ + $(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test \ $(BINDIR)/$(CONFIG)/h2_proxy_nosec_test \ $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test \ $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test \ @@ -13926,6 +13930,38 @@ endif endif +H2_LOAD_REPORTING_TEST_SRC = \ + test/core/end2end/fixtures/h2_load_reporting.c \ + +H2_LOAD_REPORTING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOAD_REPORTING_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/h2_load_reporting_test: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/h2_load_reporting_test: $(H2_LOAD_REPORTING_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(H2_LOAD_REPORTING_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/h2_load_reporting_test + +endif + +$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_load_reporting.o: $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_h2_load_reporting_test: $(H2_LOAD_REPORTING_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(H2_LOAD_REPORTING_TEST_OBJS:.o=.dep) +endif +endif + + H2_OAUTH2_TEST_SRC = \ test/core/end2end/fixtures/h2_oauth2.c \ @@ -14334,6 +14370,26 @@ ifneq ($(NO_DEPS),true) endif +H2_LOAD_REPORTING_NOSEC_TEST_SRC = \ + test/core/end2end/fixtures/h2_load_reporting.c \ + +H2_LOAD_REPORTING_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOAD_REPORTING_NOSEC_TEST_SRC)))) + + +$(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test: $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LD) $(LDFLAGS) $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) -o $(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test + +$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_load_reporting.o: $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_h2_load_reporting_nosec_test: $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS:.o=.dep) + +ifneq ($(NO_DEPS),true) +-include $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS:.o=.dep) +endif + + H2_PROXY_NOSEC_TEST_SRC = \ test/core/end2end/fixtures/h2_proxy.c \ diff --git a/src/core/ext/load_reporting/load_reporting.c b/src/core/ext/load_reporting/load_reporting.c index 1a1562d058..592625496d 100644 --- a/src/core/ext/load_reporting/load_reporting.c +++ b/src/core/ext/load_reporting/load_reporting.c @@ -42,42 +42,13 @@ #include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/surface/channel_init.h" -struct grpc_load_reporting_config { - grpc_load_reporting_fn fn; - void *user_data; -}; - -grpc_load_reporting_config *grpc_load_reporting_config_create( - grpc_load_reporting_fn fn, void *user_data) { - GPR_ASSERT(fn != NULL); - grpc_load_reporting_config *lr_config = - gpr_malloc(sizeof(grpc_load_reporting_config)); - lr_config->fn = fn; - lr_config->user_data = user_data; - return lr_config; -} - -grpc_load_reporting_config *grpc_load_reporting_config_copy( - grpc_load_reporting_config *src) { - return grpc_load_reporting_config_create(src->fn, src->user_data); -} - -void grpc_load_reporting_config_destroy(grpc_load_reporting_config *lr_config) { - gpr_free(lr_config); -} - -void grpc_load_reporting_config_call( - grpc_load_reporting_config *lr_config, - const grpc_load_reporting_call_data *call_data) { - lr_config->fn(call_data, lr_config->user_data); -} static bool is_load_reporting_enabled(const grpc_channel_args *a) { if (a == NULL) return false; for (size_t i = 0; i < a->num_args; i++) { if (0 == strcmp(a->args[i].key, GRPC_ARG_ENABLE_LOAD_REPORTING)) { - return a->args[i].type == GRPC_ARG_POINTER && - a->args[i].value.pointer.p != NULL; + return a->args[i].type == GRPC_ARG_INTEGER && + a->args[i].value.integer != 0; } } return false; @@ -94,37 +65,17 @@ static bool maybe_add_load_reporting_filter(grpc_channel_stack_builder *builder, return true; } -static void lrd_arg_destroy(void *p) { grpc_load_reporting_config_destroy(p); } - -static void *lrd_arg_copy(void *p) { - return grpc_load_reporting_config_copy(p); -} - -static int lrd_arg_cmp(void *a, void *b) { - grpc_load_reporting_config *lhs = a; - grpc_load_reporting_config *rhs = b; - return !(lhs->fn == rhs->fn && lhs->user_data == rhs->user_data); -} - -static const grpc_arg_pointer_vtable lrd_ptr_vtable = { - lrd_arg_copy, lrd_arg_destroy, lrd_arg_cmp}; - -grpc_arg grpc_load_reporting_config_create_arg( - grpc_load_reporting_config *lr_config) { +grpc_arg grpc_load_reporting_enable_arg() { grpc_arg arg; - arg.type = GRPC_ARG_POINTER; + arg.type = GRPC_ARG_INTEGER; arg.key = GRPC_ARG_ENABLE_LOAD_REPORTING; - arg.value.pointer.p = lr_config; - arg.value.pointer.vtable = &lrd_ptr_vtable; + arg.value.integer = 1; return arg; } /* Plugin registration */ void grpc_load_reporting_plugin_init(void) { - grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX, - maybe_add_load_reporting_filter, - (void *)&grpc_load_reporting_filter); grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX, maybe_add_load_reporting_filter, (void *)&grpc_load_reporting_filter); diff --git a/src/core/ext/load_reporting/load_reporting.h b/src/core/ext/load_reporting/load_reporting.h index 6a9772a2bd..c3161bebb7 100644 --- a/src/core/ext/load_reporting/load_reporting.h +++ b/src/core/ext/load_reporting/load_reporting.h @@ -43,8 +43,6 @@ /** Metadata key for trailing metadata from servers */ #define GRPC_LOAD_REPORTING_TRAILING_MD_KEY "load-reporting-trailing" -typedef struct grpc_load_reporting_config grpc_load_reporting_config; - /** Identifiers for the invocation point of the users LR callback */ typedef enum grpc_load_reporting_source { GRPC_LR_POINT_UNKNOWN = 0, @@ -75,33 +73,6 @@ typedef struct grpc_load_reporting_call_data { } grpc_load_reporting_call_data; /** Return a \a grpc_arg enabling load reporting */ -grpc_arg grpc_load_reporting_config_create_arg( - grpc_load_reporting_config *lr_config); - -/** Custom function to be called by the load reporting filter. - * - * \a call_data is provided by the runtime. \a user_data is given by the user - * as part of \a grpc_load_reporting_config_create */ -typedef void (*grpc_load_reporting_fn)( - const grpc_load_reporting_call_data *call_data, void *user_data); - -/** Register \a fn as the function to be invoked by the load reporting filter. - * \a fn will be invoked at the beginning and at the end of the call. - * - * For the first invocation, \a fn's first argument - * (grpc_load_reporting_call_data*) will be NULL. \a user_data is always passed - * as-is. */ -grpc_load_reporting_config *grpc_load_reporting_config_create( - grpc_load_reporting_fn fn, void *user_data); - -grpc_load_reporting_config *grpc_load_reporting_config_copy( - grpc_load_reporting_config *src); - -void grpc_load_reporting_config_destroy(grpc_load_reporting_config *lr_config); - -/** Invoke the LR callback from \a lr_config with \a call_data */ -void grpc_load_reporting_config_call( - grpc_load_reporting_config *lr_config, - const grpc_load_reporting_call_data *call_data); +grpc_arg grpc_load_reporting_enable_arg(); #endif /* GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H */ diff --git a/src/core/ext/load_reporting/load_reporting_filter.c b/src/core/ext/load_reporting/load_reporting_filter.c index 55e06f2774..65aba2a650 100644 --- a/src/core/ext/load_reporting/load_reporting_filter.c +++ b/src/core/ext/load_reporting/load_reporting_filter.c @@ -43,6 +43,11 @@ #include "src/core/lib/profiling/timers.h" #include "src/core/lib/transport/static_metadata.h" +void (*g_load_reporting_fn)(const grpc_load_reporting_call_data *call_data); + +/* The function to be defined */ +void load_reporting_fn(const grpc_load_reporting_call_data *call_data) {} + typedef struct call_data { intptr_t id; /**< an id unique to the call */ char *trailing_md_string; @@ -61,14 +66,15 @@ typedef struct call_data { typedef struct channel_data { intptr_t id; /**< an id unique to the channel */ - grpc_load_reporting_config *lr_config; } channel_data; -static void invoke_lr_fn_locked(grpc_load_reporting_config *lr_config, - grpc_load_reporting_call_data *lr_call_data) { - GPR_TIMER_BEGIN("load_reporting_config_fn", 0); - grpc_load_reporting_config_call(lr_config, lr_call_data); - GPR_TIMER_END("load_reporting_config_fn", 0); +static void invoke_lr_fn(grpc_load_reporting_call_data *lr_call_data) { + if (g_load_reporting_fn == NULL) { + g_load_reporting_fn = load_reporting_fn; + } + GPR_TIMER_BEGIN("load_reporting_fn", 0); + g_load_reporting_fn(lr_call_data); + GPR_TIMER_END("load_reporting_fn", 0); } typedef struct { @@ -130,7 +136,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, NULL, NULL, NULL}; - invoke_lr_fn_locked(chand->lr_config, &lr_call_data); + invoke_lr_fn(&lr_call_data); } /* Destructor for call_data */ @@ -148,7 +154,7 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, calld->trailing_md_string, calld->service_method}; - invoke_lr_fn_locked(chand->lr_config, &lr_call_data); + invoke_lr_fn(&lr_call_data); gpr_free(calld->initial_md_string); gpr_free(calld->trailing_md_string); @@ -164,17 +170,6 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx, memset(chand, 0, sizeof(channel_data)); chand->id = (intptr_t)args->channel_stack; - for (size_t i = 0; i < args->channel_args->num_args; i++) { - if (0 == strcmp(args->channel_args->args[i].key, - GRPC_ARG_ENABLE_LOAD_REPORTING)) { - grpc_load_reporting_config *arg_lr_config = - args->channel_args->args[i].value.pointer.p; - chand->lr_config = grpc_load_reporting_config_copy(arg_lr_config); - GPR_ASSERT(chand->lr_config != NULL); - break; - } - } - GPR_ASSERT(chand->lr_config != NULL); /* arg actually found */ grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CHANNEL_CREATION, (intptr_t)chand, @@ -183,7 +178,7 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx, NULL, NULL, NULL}; - invoke_lr_fn_locked(chand->lr_config, &lr_call_data); + invoke_lr_fn(&lr_call_data); } /* Destructor for channel data */ @@ -198,8 +193,7 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, NULL, NULL, NULL}; - invoke_lr_fn_locked(chand->lr_config, &lr_call_data); - grpc_load_reporting_config_destroy(chand->lr_config); + invoke_lr_fn(&lr_call_data); } static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) { diff --git a/src/core/ext/load_reporting/load_reporting_filter.h b/src/core/ext/load_reporting/load_reporting_filter.h index f69cd6fdc6..160ed32af9 100644 --- a/src/core/ext/load_reporting/load_reporting_filter.h +++ b/src/core/ext/load_reporting/load_reporting_filter.h @@ -34,6 +34,7 @@ #ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H #define GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H +#include "src/core/ext/load_reporting/load_reporting.h" #include "src/core/lib/channel/channel_stack.h" extern const grpc_channel_filter grpc_load_reporting_filter; diff --git a/test/core/end2end/fixtures/h2_load_reporting.c b/test/core/end2end/fixtures/h2_load_reporting.c new file mode 100644 index 0000000000..f6d3923db9 --- /dev/null +++ b/test/core/end2end/fixtures/h2_load_reporting.c @@ -0,0 +1,125 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include + +#include +#include +#include +#include +#include +#include +#include "src/core/ext/client_config/client_channel.h" +#include "src/core/ext/load_reporting/load_reporting.h" +#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" +#include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/connected_channel.h" +#include "src/core/lib/channel/http_server_filter.h" +#include "src/core/lib/surface/channel.h" +#include "src/core/lib/surface/server.h" +#include "test/core/util/port.h" +#include "test/core/util/test_config.h" + +typedef struct load_reporting_fixture_data { + char *localaddr; +} load_reporting_fixture_data; + +static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting( + grpc_channel_args *client_args, grpc_channel_args *server_args) { + grpc_end2end_test_fixture f; + int port = grpc_pick_unused_port_or_die(); + load_reporting_fixture_data *ffd = + gpr_malloc(sizeof(load_reporting_fixture_data)); + memset(&f, 0, sizeof(f)); + + gpr_join_host_port(&ffd->localaddr, "localhost", port); + + f.fixture_data = ffd; + f.cq = grpc_completion_queue_create(NULL); + + return f; +} + +void chttp2_init_client_load_reporting(grpc_end2end_test_fixture *f, + grpc_channel_args *client_args) { + load_reporting_fixture_data *ffd = f->fixture_data; + f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); + GPR_ASSERT(f->client); +} + +void chttp2_init_server_load_reporting(grpc_end2end_test_fixture *f, + grpc_channel_args *server_args) { + load_reporting_fixture_data *ffd = f->fixture_data; + grpc_arg arg = grpc_load_reporting_enable_arg(); + if (f->server) { + grpc_server_destroy(f->server); + } + server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1); + f->server = grpc_server_create(server_args, NULL); + grpc_channel_args_destroy(server_args); + grpc_server_register_completion_queue(f->server, f->cq, NULL); + GPR_ASSERT(grpc_server_add_insecure_http2_port(f->server, ffd->localaddr)); + grpc_server_start(f->server); +} + +void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture *f) { + load_reporting_fixture_data *ffd = f->fixture_data; + gpr_free(ffd->localaddr); + gpr_free(ffd); +} + +/* All test configurations */ +static grpc_end2end_test_config configs[] = { + {"chttp2/fullstack+load_reporting", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION, + chttp2_create_fixture_load_reporting, chttp2_init_client_load_reporting, + chttp2_init_server_load_reporting, chttp2_tear_down_load_reporting}, +}; + +int main(int argc, char **argv) { + size_t i; + + grpc_test_init(argc, argv); + grpc_end2end_tests_pre_init(); + grpc_init(); + + for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) { + grpc_end2end_tests(argc, argv, configs[i]); + } + + grpc_shutdown(); + + return 0; +} diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py index 2bd028a45a..1c948ba24a 100755 --- a/test/core/end2end/gen_build_yaml.py +++ b/test/core/end2end/gen_build_yaml.py @@ -53,6 +53,7 @@ fd_unsecure_fixture_options = default_unsecure_fixture_options._replace( END2END_FIXTURES = { 'h2_compress': default_unsecure_fixture_options, 'h2_census': default_unsecure_fixture_options, + 'h2_load_reporting': default_unsecure_fixture_options, 'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False), 'h2_fd': fd_unsecure_fixture_options, 'h2_full': default_unsecure_fixture_options, diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index b0f066e6f3..40ffa19c3f 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -44,6 +44,7 @@ #include "test/core/end2end/cq_verifier.h" #include "src/core/ext/load_reporting/load_reporting.h" +#include "src/core/ext/load_reporting/load_reporting_filter.h" #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/transport/static_metadata.h" @@ -56,64 +57,54 @@ typedef struct { intptr_t channel_id; intptr_t call_id; - uint32_t call_creation_token; /* expected 0xCAFED00D */ - uint32_t call_destruction_token; /* expected 0xDEADD00D */ - uint32_t channel_creation_token; /* expected 0xCAFEFACE */ - uint32_t channel_destruction_token; /* expected 0xDEADFACE */ - char *initial_md_str; char *trailing_md_str; char *method_name; uint64_t incoming_bytes; uint64_t outgoing_bytes; - bool fully_processed; -} aggregated_bw_stats; -static void sample_fn(const grpc_load_reporting_call_data *call_data, - void *user_data) { - GPR_ASSERT(user_data != NULL); + grpc_status_code call_final_status; + + bool fully_processed; +} load_reporting_data; - aggregated_bw_stats *custom_stats = (aggregated_bw_stats *)user_data; - gpr_mu_lock(&custom_stats->mu); +static load_reporting_data lr_data; +static void load_reporting_test_fn( + const grpc_load_reporting_call_data *call_data) { + gpr_mu_lock(&lr_data.mu); switch (call_data->source) { case GRPC_LR_POINT_CHANNEL_CREATION: - custom_stats->channel_creation_token = 0xCAFEFACE; - custom_stats->channel_id = call_data->channel_id; + lr_data.channel_id = call_data->channel_id; break; case GRPC_LR_POINT_CHANNEL_DESTRUCTION: - custom_stats->channel_destruction_token = 0xDEADFACE; break; case GRPC_LR_POINT_CALL_CREATION: - custom_stats->call_creation_token = 0xCAFED00D; - custom_stats->call_id = call_data->call_id; + lr_data.call_id = call_data->call_id; break; case GRPC_LR_POINT_CALL_DESTRUCTION: - if (custom_stats->initial_md_str == NULL) { - custom_stats->initial_md_str = gpr_strdup(call_data->initial_md_string); + if (lr_data.initial_md_str == NULL) { + lr_data.initial_md_str = gpr_strdup(call_data->initial_md_string); } - if (custom_stats->trailing_md_str == NULL) { - custom_stats->trailing_md_str = - gpr_strdup(call_data->trailing_md_string); + if (lr_data.trailing_md_str == NULL) { + lr_data.trailing_md_str = gpr_strdup(call_data->trailing_md_string); } - if (custom_stats->method_name == NULL) { - custom_stats->method_name = gpr_strdup(call_data->method_name); + if (lr_data.method_name == NULL) { + lr_data.method_name = gpr_strdup(call_data->method_name); } - custom_stats->call_destruction_token = 0xDEADD00D; - custom_stats->incoming_bytes = - call_data->final_info->stats.transport_stream_stats.incoming - .data_bytes; - custom_stats->outgoing_bytes = - call_data->final_info->stats.transport_stream_stats.outgoing - .data_bytes; - custom_stats->fully_processed = true; + lr_data.incoming_bytes = call_data->final_info->stats + .transport_stream_stats.incoming.data_bytes; + lr_data.outgoing_bytes = call_data->final_info->stats + .transport_stream_stats.outgoing.data_bytes; + lr_data.call_final_status = call_data->final_info->final_status; + lr_data.fully_processed = true; break; default: abort(); } - gpr_mu_unlock(&custom_stats->mu); + gpr_mu_unlock(&lr_data.mu); } static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, @@ -319,17 +310,16 @@ static void request_response_with_payload(grpc_end2end_test_fixture f, grpc_byte_buffer_destroy(response_payload_recv); } -static void test_load_reporting_hook(grpc_end2end_test_config config) { - aggregated_bw_stats *aggr_stats_server = - gpr_malloc(sizeof(aggregated_bw_stats)); - memset(aggr_stats_server, 0, sizeof(aggregated_bw_stats)); - gpr_mu_init(&aggr_stats_server->mu); +/* override the default for testing purposes */ +extern void (*g_load_reporting_fn)( + const grpc_load_reporting_call_data *call_data); - grpc_load_reporting_config *server_lrc = - grpc_load_reporting_config_create(sample_fn, aggr_stats_server); +static void test_load_reporting_hook(grpc_end2end_test_config config) { + gpr_mu_init(&lr_data.mu); + g_load_reporting_fn = load_reporting_test_fn; /* Introduce load reporting for the server through its arguments */ - grpc_arg arg = grpc_load_reporting_config_create_arg(server_lrc); + grpc_arg arg = grpc_load_reporting_enable_arg(); grpc_channel_args *lr_server_args = grpc_channel_args_copy_and_add(NULL, &arg, 1); @@ -361,32 +351,25 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { grpc_channel_args_destroy(lr_server_args); config.tear_down_data(&f); - GPR_ASSERT(aggr_stats_server->fully_processed); - GPR_ASSERT(aggr_stats_server->incoming_bytes == strlen(request_msg)); - GPR_ASSERT(aggr_stats_server->outgoing_bytes == strlen(response_msg)); - - GPR_ASSERT(aggr_stats_server->call_id > 0); - GPR_ASSERT(aggr_stats_server->channel_id > 0); + GPR_ASSERT(lr_data.fully_processed); + GPR_ASSERT(lr_data.incoming_bytes == strlen(request_msg)); + GPR_ASSERT(lr_data.outgoing_bytes == strlen(response_msg)); - GPR_ASSERT(aggr_stats_server->channel_creation_token == 0xCAFEFACE); - GPR_ASSERT(aggr_stats_server->channel_destruction_token == 0xDEADFACE); + GPR_ASSERT(lr_data.call_id > 0); + GPR_ASSERT(lr_data.channel_id > 0); - GPR_ASSERT(aggr_stats_server->call_creation_token == 0xCAFED00D); - GPR_ASSERT(aggr_stats_server->call_destruction_token == 0xDEADD00D); + GPR_ASSERT(strcmp(lr_data.method_name, "/gRPCFTW") == 0); - GPR_ASSERT(strcmp(aggr_stats_server->method_name, "/gRPCFTW") == 0); + GPR_ASSERT(lr_data.initial_md_str != NULL); + GPR_ASSERT(lr_data.trailing_md_str != NULL); + GPR_ASSERT(strcmp(lr_data.initial_md_str, "client-token") == 0); + GPR_ASSERT(strcmp(lr_data.trailing_md_str, "server-token") == 0); - GPR_ASSERT(aggr_stats_server->initial_md_str != NULL); - GPR_ASSERT(aggr_stats_server->trailing_md_str != NULL); - GPR_ASSERT(strcmp(aggr_stats_server->initial_md_str, "client-token") == 0); - GPR_ASSERT(strcmp(aggr_stats_server->trailing_md_str, "server-token") == 0); + GPR_ASSERT(lr_data.call_final_status == GRPC_STATUS_OK); - gpr_free(aggr_stats_server->initial_md_str); - gpr_free(aggr_stats_server->trailing_md_str); - gpr_free(aggr_stats_server->method_name); - gpr_mu_destroy(&aggr_stats_server->mu); - gpr_free(aggr_stats_server); - grpc_load_reporting_config_destroy(server_lrc); + gpr_free(lr_data.initial_md_str); + gpr_free(lr_data.trailing_md_str); + gpr_free(lr_data.method_name); } void load_reporting_hook(grpc_end2end_test_config config) { diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index d8c46755e1..2295371f4a 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -3615,6 +3615,23 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "end2end_tests", + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "h2_load_reporting_test", + "src": [ + "test/core/end2end/fixtures/h2_load_reporting.c" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "end2end_tests", @@ -3870,6 +3887,23 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "end2end_nosec_tests", + "gpr", + "gpr_test_util", + "grpc_test_util_unsecure", + "grpc_unsecure" + ], + "headers": [], + "language": "c", + "name": "h2_load_reporting_nosec_test", + "src": [ + "test/core/end2end/fixtures/h2_load_reporting.c" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "end2end_nosec_tests", diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 0b4b8e1ba5..abd25afa3e 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -10217,13 +10217,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10238,13 +10239,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10259,13 +10261,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10280,13 +10283,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10301,13 +10305,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10322,13 +10327,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10343,13 +10349,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10364,13 +10371,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10385,13 +10393,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10406,13 +10415,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10427,13 +10437,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10448,13 +10459,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10469,13 +10481,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10490,13 +10503,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10511,13 +10525,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10532,13 +10547,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10553,13 +10569,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10574,13 +10591,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10595,13 +10613,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10616,13 +10635,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10637,13 +10657,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10658,13 +10679,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10679,13 +10701,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10700,13 +10723,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10721,13 +10745,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10742,13 +10767,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10763,13 +10789,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10784,13 +10811,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10805,13 +10833,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10826,13 +10855,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10847,13 +10877,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10868,13 +10899,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10889,13 +10921,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10910,13 +10943,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10931,13 +10965,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10952,13 +10987,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10973,13 +11009,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -10994,13 +11031,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -11015,13 +11053,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -11036,13 +11075,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -11057,13 +11097,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_oauth2_test", + "name": "h2_load_reporting_test", "platforms": [ "windows", "linux", @@ -11084,7 +11125,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11105,7 +11146,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11126,7 +11167,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11147,7 +11188,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11168,7 +11209,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11189,7 +11230,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11210,7 +11251,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11231,7 +11272,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11252,7 +11293,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11262,7 +11303,7 @@ }, { "args": [ - "default_host" + "compressed_payload" ], "ci_platforms": [ "windows", @@ -11273,7 +11314,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11283,18 +11324,18 @@ }, { "args": [ - "disappearing_server" + "connectivity" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11304,7 +11345,7 @@ }, { "args": [ - "empty_batch" + "default_host" ], "ci_platforms": [ "windows", @@ -11315,7 +11356,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11325,7 +11366,7 @@ }, { "args": [ - "filter_causes_close" + "disappearing_server" ], "ci_platforms": [ "windows", @@ -11336,7 +11377,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11346,18 +11387,18 @@ }, { "args": [ - "graceful_server_shutdown" + "empty_batch" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11367,7 +11408,7 @@ }, { "args": [ - "high_initial_seqno" + "filter_causes_close" ], "ci_platforms": [ "windows", @@ -11378,7 +11419,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11388,18 +11429,18 @@ }, { "args": [ - "idempotent_request" + "graceful_server_shutdown" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11409,7 +11450,7 @@ }, { "args": [ - "invoke_large_request" + "high_initial_seqno" ], "ci_platforms": [ "windows", @@ -11420,7 +11461,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11430,7 +11471,7 @@ }, { "args": [ - "large_metadata" + "hpack_size" ], "ci_platforms": [ "windows", @@ -11441,7 +11482,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11451,7 +11492,7 @@ }, { "args": [ - "load_reporting_hook" + "idempotent_request" ], "ci_platforms": [ "windows", @@ -11462,7 +11503,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11472,7 +11513,7 @@ }, { "args": [ - "max_message_length" + "invoke_large_request" ], "ci_platforms": [ "windows", @@ -11483,7 +11524,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11493,7 +11534,7 @@ }, { "args": [ - "negative_deadline" + "large_metadata" ], "ci_platforms": [ "windows", @@ -11504,7 +11545,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11514,7 +11555,7 @@ }, { "args": [ - "network_status_change" + "load_reporting_hook" ], "ci_platforms": [ "windows", @@ -11525,7 +11566,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11535,7 +11576,7 @@ }, { "args": [ - "no_op" + "max_concurrent_streams" ], "ci_platforms": [ "windows", @@ -11546,7 +11587,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11556,7 +11597,7 @@ }, { "args": [ - "payload" + "max_message_length" ], "ci_platforms": [ "windows", @@ -11567,7 +11608,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11577,7 +11618,7 @@ }, { "args": [ - "ping_pong_streaming" + "negative_deadline" ], "ci_platforms": [ "windows", @@ -11588,7 +11629,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11598,7 +11639,7 @@ }, { "args": [ - "registered_call" + "network_status_change" ], "ci_platforms": [ "windows", @@ -11609,7 +11650,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11619,7 +11660,7 @@ }, { "args": [ - "request_with_payload" + "no_op" ], "ci_platforms": [ "windows", @@ -11630,7 +11671,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11640,7 +11681,7 @@ }, { "args": [ - "server_finishes_request" + "payload" ], "ci_platforms": [ "windows", @@ -11651,7 +11692,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11661,7 +11702,7 @@ }, { "args": [ - "shutdown_finishes_calls" + "ping" ], "ci_platforms": [ "windows", @@ -11672,7 +11713,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11682,7 +11723,7 @@ }, { "args": [ - "shutdown_finishes_tags" + "ping_pong_streaming" ], "ci_platforms": [ "windows", @@ -11693,7 +11734,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11703,7 +11744,7 @@ }, { "args": [ - "simple_delayed_request" + "registered_call" ], "ci_platforms": [ "windows", @@ -11714,7 +11755,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11724,18 +11765,18 @@ }, { "args": [ - "simple_metadata" + "request_with_flags" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11745,7 +11786,7 @@ }, { "args": [ - "simple_request" + "request_with_payload" ], "ci_platforms": [ "windows", @@ -11756,7 +11797,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11766,7 +11807,7 @@ }, { "args": [ - "streaming_error_response" + "server_finishes_request" ], "ci_platforms": [ "windows", @@ -11777,7 +11818,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11787,7 +11828,7 @@ }, { "args": [ - "trailing_metadata" + "shutdown_finishes_calls" ], "ci_platforms": [ "windows", @@ -11798,7 +11839,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_proxy_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11808,7 +11849,7 @@ }, { "args": [ - "bad_hostname" + "shutdown_finishes_tags" ], "ci_platforms": [ "windows", @@ -11819,7 +11860,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11829,7 +11870,7 @@ }, { "args": [ - "binary_metadata" + "simple_delayed_request" ], "ci_platforms": [ "windows", @@ -11840,7 +11881,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11850,7 +11891,7 @@ }, { "args": [ - "call_creds" + "simple_metadata" ], "ci_platforms": [ "windows", @@ -11861,7 +11902,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11871,18 +11912,18 @@ }, { "args": [ - "cancel_after_accept" + "simple_request" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11892,7 +11933,7 @@ }, { "args": [ - "cancel_after_client_done" + "streaming_error_response" ], "ci_platforms": [ "windows", @@ -11903,7 +11944,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11913,18 +11954,18 @@ }, { "args": [ - "cancel_after_invoke" + "trailing_metadata" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_oauth2_test", "platforms": [ "windows", "linux", @@ -11934,18 +11975,18 @@ }, { "args": [ - "cancel_before_invoke" + "bad_hostname" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -11955,18 +11996,18 @@ }, { "args": [ - "cancel_in_a_vacuum" + "binary_metadata" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -11976,18 +12017,18 @@ }, { "args": [ - "cancel_with_status" + "call_creds" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -11997,18 +12038,18 @@ }, { "args": [ - "compressed_payload" + "cancel_after_accept" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12018,7 +12059,7 @@ }, { "args": [ - "empty_batch" + "cancel_after_client_done" ], "ci_platforms": [ "windows", @@ -12029,7 +12070,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12039,18 +12080,18 @@ }, { "args": [ - "filter_causes_close" + "cancel_after_invoke" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12060,7 +12101,7 @@ }, { "args": [ - "graceful_server_shutdown" + "cancel_before_invoke" ], "ci_platforms": [ "windows", @@ -12071,7 +12112,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12081,18 +12122,18 @@ }, { "args": [ - "high_initial_seqno" + "cancel_in_a_vacuum" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12102,18 +12143,18 @@ }, { "args": [ - "hpack_size" + "cancel_with_status" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12123,7 +12164,7 @@ }, { "args": [ - "idempotent_request" + "default_host" ], "ci_platforms": [ "windows", @@ -12134,7 +12175,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12144,7 +12185,7 @@ }, { "args": [ - "invoke_large_request" + "disappearing_server" ], "ci_platforms": [ "windows", @@ -12155,7 +12196,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12165,7 +12206,7 @@ }, { "args": [ - "large_metadata" + "empty_batch" ], "ci_platforms": [ "windows", @@ -12176,7 +12217,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12186,7 +12227,7 @@ }, { "args": [ - "load_reporting_hook" + "filter_causes_close" ], "ci_platforms": [ "windows", @@ -12197,7 +12238,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12207,18 +12248,18 @@ }, { "args": [ - "max_concurrent_streams" + "graceful_server_shutdown" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12228,7 +12269,7 @@ }, { "args": [ - "max_message_length" + "high_initial_seqno" ], "ci_platforms": [ "windows", @@ -12239,7 +12280,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12249,7 +12290,7 @@ }, { "args": [ - "negative_deadline" + "idempotent_request" ], "ci_platforms": [ "windows", @@ -12260,7 +12301,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12270,7 +12311,7 @@ }, { "args": [ - "network_status_change" + "invoke_large_request" ], "ci_platforms": [ "windows", @@ -12281,7 +12322,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12291,7 +12332,7 @@ }, { "args": [ - "no_op" + "large_metadata" ], "ci_platforms": [ "windows", @@ -12302,7 +12343,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12312,7 +12353,7 @@ }, { "args": [ - "payload" + "load_reporting_hook" ], "ci_platforms": [ "windows", @@ -12323,7 +12364,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12333,7 +12374,7 @@ }, { "args": [ - "ping_pong_streaming" + "max_message_length" ], "ci_platforms": [ "windows", @@ -12344,7 +12385,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12354,7 +12395,7 @@ }, { "args": [ - "registered_call" + "negative_deadline" ], "ci_platforms": [ "windows", @@ -12365,7 +12406,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12375,18 +12416,18 @@ }, { "args": [ - "request_with_flags" + "network_status_change" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12396,7 +12437,7 @@ }, { "args": [ - "request_with_payload" + "no_op" ], "ci_platforms": [ "windows", @@ -12407,7 +12448,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12417,7 +12458,7 @@ }, { "args": [ - "server_finishes_request" + "payload" ], "ci_platforms": [ "windows", @@ -12428,7 +12469,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12438,7 +12479,7 @@ }, { "args": [ - "shutdown_finishes_calls" + "ping_pong_streaming" ], "ci_platforms": [ "windows", @@ -12449,7 +12490,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12459,7 +12500,7 @@ }, { "args": [ - "shutdown_finishes_tags" + "registered_call" ], "ci_platforms": [ "windows", @@ -12470,7 +12511,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12480,7 +12521,7 @@ }, { "args": [ - "simple_metadata" + "request_with_payload" ], "ci_platforms": [ "windows", @@ -12491,7 +12532,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12501,7 +12542,7 @@ }, { "args": [ - "simple_request" + "server_finishes_request" ], "ci_platforms": [ "windows", @@ -12512,7 +12553,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12522,7 +12563,7 @@ }, { "args": [ - "streaming_error_response" + "shutdown_finishes_calls" ], "ci_platforms": [ "windows", @@ -12533,7 +12574,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12543,7 +12584,7 @@ }, { "args": [ - "trailing_metadata" + "shutdown_finishes_tags" ], "ci_platforms": [ "windows", @@ -12554,7 +12595,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12564,7 +12605,7 @@ }, { "args": [ - "bad_hostname" + "simple_delayed_request" ], "ci_platforms": [ "windows", @@ -12575,7 +12616,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12585,7 +12626,7 @@ }, { "args": [ - "binary_metadata" + "simple_metadata" ], "ci_platforms": [ "windows", @@ -12596,7 +12637,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12606,7 +12647,7 @@ }, { "args": [ - "call_creds" + "simple_request" ], "ci_platforms": [ "windows", @@ -12617,7 +12658,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12627,18 +12668,18 @@ }, { "args": [ - "cancel_after_accept" + "streaming_error_response" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12648,7 +12689,7 @@ }, { "args": [ - "cancel_after_client_done" + "trailing_metadata" ], "ci_platforms": [ "windows", @@ -12659,7 +12700,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_proxy_test", "platforms": [ "windows", "linux", @@ -12669,18 +12710,18 @@ }, { "args": [ - "cancel_after_invoke" + "bad_hostname" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12690,18 +12731,18 @@ }, { "args": [ - "cancel_before_invoke" + "binary_metadata" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12711,18 +12752,18 @@ }, { "args": [ - "cancel_in_a_vacuum" + "call_creds" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12732,7 +12773,7 @@ }, { "args": [ - "cancel_with_status" + "cancel_after_accept" ], "ci_platforms": [ "windows", @@ -12743,7 +12784,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12753,7 +12794,7 @@ }, { "args": [ - "compressed_payload" + "cancel_after_client_done" ], "ci_platforms": [ "windows", @@ -12764,7 +12805,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12774,18 +12815,18 @@ }, { "args": [ - "empty_batch" + "cancel_after_invoke" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12795,18 +12836,18 @@ }, { "args": [ - "filter_causes_close" + "cancel_before_invoke" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12816,7 +12857,7 @@ }, { "args": [ - "graceful_server_shutdown" + "cancel_in_a_vacuum" ], "ci_platforms": [ "windows", @@ -12827,7 +12868,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12837,18 +12878,18 @@ }, { "args": [ - "high_initial_seqno" + "cancel_with_status" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12858,7 +12899,7 @@ }, { "args": [ - "idempotent_request" + "compressed_payload" ], "ci_platforms": [ "windows", @@ -12869,7 +12910,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12879,7 +12920,7 @@ }, { "args": [ - "invoke_large_request" + "empty_batch" ], "ci_platforms": [ "windows", @@ -12890,7 +12931,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12900,7 +12941,7 @@ }, { "args": [ - "large_metadata" + "filter_causes_close" ], "ci_platforms": [ "windows", @@ -12911,7 +12952,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12921,18 +12962,18 @@ }, { "args": [ - "load_reporting_hook" + "graceful_server_shutdown" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12942,7 +12983,7 @@ }, { "args": [ - "max_concurrent_streams" + "high_initial_seqno" ], "ci_platforms": [ "windows", @@ -12953,7 +12994,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12963,7 +13004,7 @@ }, { "args": [ - "max_message_length" + "hpack_size" ], "ci_platforms": [ "windows", @@ -12974,7 +13015,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -12984,7 +13025,7 @@ }, { "args": [ - "negative_deadline" + "idempotent_request" ], "ci_platforms": [ "windows", @@ -12995,7 +13036,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13005,7 +13046,7 @@ }, { "args": [ - "network_status_change" + "invoke_large_request" ], "ci_platforms": [ "windows", @@ -13016,7 +13057,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13026,7 +13067,7 @@ }, { "args": [ - "no_op" + "large_metadata" ], "ci_platforms": [ "windows", @@ -13037,7 +13078,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13047,7 +13088,7 @@ }, { "args": [ - "payload" + "load_reporting_hook" ], "ci_platforms": [ "windows", @@ -13058,7 +13099,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13068,7 +13109,7 @@ }, { "args": [ - "ping_pong_streaming" + "max_concurrent_streams" ], "ci_platforms": [ "windows", @@ -13079,7 +13120,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13089,7 +13130,7 @@ }, { "args": [ - "registered_call" + "max_message_length" ], "ci_platforms": [ "windows", @@ -13100,7 +13141,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13110,18 +13151,18 @@ }, { "args": [ - "request_with_flags" + "negative_deadline" ], "ci_platforms": [ "windows", "linux", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13131,7 +13172,7 @@ }, { "args": [ - "request_with_payload" + "network_status_change" ], "ci_platforms": [ "windows", @@ -13142,7 +13183,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13152,7 +13193,7 @@ }, { "args": [ - "server_finishes_request" + "no_op" ], "ci_platforms": [ "windows", @@ -13163,7 +13204,133 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "payload" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_sockpair_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "ping_pong_streaming" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_sockpair_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "registered_call" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_sockpair_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "request_with_flags" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_sockpair_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "request_with_payload" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_sockpair_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "server_finishes_request" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13184,7 +13351,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13205,7 +13372,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13226,7 +13393,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13247,7 +13414,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13268,7 +13435,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13289,7 +13456,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair+trace_test", + "name": "h2_sockpair_test", "platforms": [ "windows", "linux", @@ -13310,7 +13477,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13331,7 +13498,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13352,7 +13519,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13373,7 +13540,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13394,7 +13561,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13415,7 +13582,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13436,7 +13603,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13457,7 +13624,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13478,7 +13645,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13499,7 +13666,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13520,7 +13687,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13541,7 +13708,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13562,7 +13729,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13583,28 +13750,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", - "platforms": [ - "windows", - "linux", - "mac", - "posix" - ] - }, - { - "args": [ - "hpack_size" - ], - "ci_platforms": [ - "windows", - "linux", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "flaky": false, - "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13625,7 +13771,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13646,7 +13792,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13667,7 +13813,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13688,7 +13834,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13709,7 +13855,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13730,7 +13876,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13751,7 +13897,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13772,7 +13918,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13793,7 +13939,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13814,7 +13960,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13835,7 +13981,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13856,7 +14002,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13877,7 +14023,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13898,7 +14044,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13919,7 +14065,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13940,7 +14086,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13961,7 +14107,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -13982,7 +14128,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -14003,7 +14149,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -14024,7 +14170,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -14045,7 +14191,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_sockpair_1byte_test", + "name": "h2_sockpair+trace_test", "platforms": [ "windows", "linux", @@ -14060,14 +14206,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14082,14 +14227,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14104,14 +14248,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14126,14 +14269,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14148,14 +14290,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14170,14 +14311,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14192,14 +14332,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14214,14 +14353,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14236,14 +14374,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14258,80 +14395,13 @@ "ci_platforms": [ "windows", "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "flaky": false, - "language": "c", - "name": "h2_ssl_test", - "platforms": [ - "windows", - "linux", - "mac", - "posix" - ] - }, - { - "args": [ - "connectivity" - ], - "ci_platforms": [ - "windows", - "linux", - "mac", - "posix" - ], - "cpu_cost": 0.1, - "exclude_configs": [], - "flaky": false, - "language": "c", - "name": "h2_ssl_test", - "platforms": [ - "windows", - "linux", - "mac", - "posix" - ] - }, - { - "args": [ - "default_host" - ], - "ci_platforms": [ - "windows", - "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "flaky": false, - "language": "c", - "name": "h2_ssl_test", - "platforms": [ - "windows", - "linux", - "mac", - "posix" - ] - }, - { - "args": [ - "disappearing_server" - ], - "ci_platforms": [ - "windows", - "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14346,14 +14416,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14368,14 +14437,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14390,14 +14458,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14412,14 +14479,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14434,14 +14500,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14456,14 +14521,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14478,14 +14542,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14500,14 +14563,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14522,14 +14584,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14544,14 +14605,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14566,14 +14626,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14588,14 +14647,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14610,14 +14668,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14632,14 +14689,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14654,36 +14710,13 @@ "ci_platforms": [ "windows", "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "flaky": false, - "language": "c", - "name": "h2_ssl_test", - "platforms": [ - "windows", - "linux", - "mac", - "posix" - ] - }, - { - "args": [ - "ping" - ], - "ci_platforms": [ - "windows", - "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14698,14 +14731,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14720,14 +14752,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14742,14 +14773,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14764,14 +14794,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14786,14 +14815,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14808,14 +14836,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14830,36 +14857,13 @@ "ci_platforms": [ "windows", "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "flaky": false, - "language": "c", - "name": "h2_ssl_test", - "platforms": [ - "windows", - "linux", - "mac", - "posix" - ] - }, - { - "args": [ - "simple_delayed_request" - ], - "ci_platforms": [ - "windows", - "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14874,14 +14878,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14896,14 +14899,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14918,14 +14920,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14940,14 +14941,13 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_test", + "name": "h2_sockpair_1byte_test", "platforms": [ "windows", "linux", @@ -14969,7 +14969,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -14991,7 +14991,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15013,7 +15013,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15035,7 +15035,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15057,7 +15057,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15079,7 +15079,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15101,7 +15101,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15123,7 +15123,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15145,7 +15145,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15167,7 +15167,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15189,7 +15189,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15211,7 +15211,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15233,7 +15233,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15255,7 +15255,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15277,7 +15277,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15299,7 +15299,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15321,7 +15321,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15343,7 +15343,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15365,7 +15365,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15387,7 +15387,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15409,7 +15409,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15431,7 +15431,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15453,7 +15453,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15475,7 +15475,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15497,7 +15497,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15519,7 +15519,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15541,7 +15541,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15563,7 +15563,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15585,7 +15585,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15607,7 +15607,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15629,7 +15629,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15651,7 +15651,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15673,7 +15673,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15695,7 +15695,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15717,7 +15717,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15739,7 +15739,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15761,7 +15761,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15783,7 +15783,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15805,7 +15805,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15827,7 +15827,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15849,7 +15849,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_cert_test", + "name": "h2_ssl_test", "platforms": [ "windows", "linux", @@ -15864,13 +15864,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -15885,13 +15886,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -15906,13 +15908,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -15927,13 +15930,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -15948,13 +15952,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -15969,13 +15974,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -15990,13 +15996,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16011,13 +16018,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16032,13 +16040,14 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16048,18 +16057,19 @@ }, { "args": [ - "default_host" + "compressed_payload" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16069,18 +16079,19 @@ }, { "args": [ - "disappearing_server" + "connectivity" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16090,18 +16101,19 @@ }, { "args": [ - "empty_batch" + "default_host" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16111,18 +16123,19 @@ }, { "args": [ - "filter_causes_close" + "disappearing_server" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16132,18 +16145,19 @@ }, { "args": [ - "graceful_server_shutdown" + "empty_batch" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16153,18 +16167,19 @@ }, { "args": [ - "high_initial_seqno" + "filter_causes_close" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16174,18 +16189,19 @@ }, { "args": [ - "idempotent_request" + "graceful_server_shutdown" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16195,18 +16211,19 @@ }, { "args": [ - "invoke_large_request" + "high_initial_seqno" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16216,18 +16233,19 @@ }, { "args": [ - "large_metadata" + "hpack_size" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16237,18 +16255,19 @@ }, { "args": [ - "load_reporting_hook" + "idempotent_request" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16258,18 +16277,19 @@ }, { "args": [ - "max_message_length" + "invoke_large_request" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16279,18 +16299,19 @@ }, { "args": [ - "negative_deadline" + "large_metadata" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16300,18 +16321,19 @@ }, { "args": [ - "network_status_change" + "load_reporting_hook" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16321,18 +16343,19 @@ }, { "args": [ - "no_op" + "max_concurrent_streams" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16342,18 +16365,19 @@ }, { "args": [ - "payload" + "max_message_length" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16363,18 +16387,19 @@ }, { "args": [ - "ping_pong_streaming" + "negative_deadline" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16384,18 +16409,19 @@ }, { "args": [ - "registered_call" + "network_status_change" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16405,18 +16431,19 @@ }, { "args": [ - "request_with_payload" + "no_op" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16426,18 +16453,19 @@ }, { "args": [ - "server_finishes_request" + "payload" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16447,18 +16475,19 @@ }, { "args": [ - "shutdown_finishes_calls" + "ping" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16468,18 +16497,19 @@ }, { "args": [ - "shutdown_finishes_tags" + "ping_pong_streaming" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16489,18 +16519,19 @@ }, { "args": [ - "simple_delayed_request" + "registered_call" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16510,18 +16541,19 @@ }, { "args": [ - "simple_metadata" + "request_with_flags" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16531,18 +16563,19 @@ }, { "args": [ - "simple_request" + "request_with_payload" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16552,18 +16585,19 @@ }, { "args": [ - "streaming_error_response" + "server_finishes_request" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16573,18 +16607,19 @@ }, { "args": [ - "trailing_metadata" + "shutdown_finishes_calls" ], "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_ssl_proxy_test", + "name": "h2_ssl_cert_test", "platforms": [ "windows", "linux", @@ -16594,9 +16629,10 @@ }, { "args": [ - "bad_hostname" + "shutdown_finishes_tags" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -16605,8 +16641,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_cert_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16614,9 +16651,10 @@ }, { "args": [ - "binary_metadata" + "simple_delayed_request" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -16625,8 +16663,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_cert_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16634,9 +16673,10 @@ }, { "args": [ - "call_creds" + "simple_metadata" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -16645,8 +16685,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_cert_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16654,19 +16695,21 @@ }, { "args": [ - "cancel_after_accept" + "simple_request" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_cert_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16674,9 +16717,10 @@ }, { "args": [ - "cancel_after_client_done" + "streaming_error_response" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -16685,8 +16729,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_cert_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16694,19 +16739,21 @@ }, { "args": [ - "cancel_after_invoke" + "trailing_metadata" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_cert_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16714,19 +16761,20 @@ }, { "args": [ - "cancel_before_invoke" + "bad_hostname" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16734,19 +16782,20 @@ }, { "args": [ - "cancel_in_a_vacuum" + "binary_metadata" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16754,19 +16803,20 @@ }, { "args": [ - "cancel_with_status" + "call_creds" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16774,19 +16824,20 @@ }, { "args": [ - "compressed_payload" + "cancel_after_accept" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16794,19 +16845,20 @@ }, { "args": [ - "connectivity" + "cancel_after_client_done" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16814,19 +16866,20 @@ }, { "args": [ - "disappearing_server" + "cancel_after_invoke" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16834,19 +16887,20 @@ }, { "args": [ - "empty_batch" + "cancel_before_invoke" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16854,19 +16908,20 @@ }, { "args": [ - "filter_causes_close" + "cancel_in_a_vacuum" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16874,19 +16929,20 @@ }, { "args": [ - "graceful_server_shutdown" + "cancel_with_status" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16894,19 +16950,20 @@ }, { "args": [ - "high_initial_seqno" + "default_host" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16914,19 +16971,20 @@ }, { "args": [ - "hpack_size" + "disappearing_server" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16934,19 +16992,20 @@ }, { "args": [ - "idempotent_request" + "empty_batch" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16954,19 +17013,20 @@ }, { "args": [ - "invoke_large_request" + "filter_causes_close" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16974,19 +17034,41 @@ }, { "args": [ - "large_metadata" + "graceful_server_shutdown" ], "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_ssl_proxy_test", + "platforms": [ + "windows", "linux", "mac", "posix" + ] + }, + { + "args": [ + "high_initial_seqno" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -16994,19 +17076,20 @@ }, { "args": [ - "load_reporting_hook" + "idempotent_request" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17014,19 +17097,20 @@ }, { "args": [ - "max_concurrent_streams" + "invoke_large_request" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17034,19 +17118,20 @@ }, { "args": [ - "max_message_length" + "large_metadata" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17054,19 +17139,20 @@ }, { "args": [ - "negative_deadline" + "load_reporting_hook" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17074,19 +17160,20 @@ }, { "args": [ - "network_status_change" + "max_message_length" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17094,19 +17181,20 @@ }, { "args": [ - "no_op" + "negative_deadline" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17114,19 +17202,20 @@ }, { "args": [ - "payload" + "network_status_change" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17134,19 +17223,20 @@ }, { "args": [ - "ping" + "no_op" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17154,19 +17244,20 @@ }, { "args": [ - "ping_pong_streaming" + "payload" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17174,19 +17265,20 @@ }, { "args": [ - "registered_call" + "ping_pong_streaming" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17194,19 +17286,20 @@ }, { "args": [ - "request_with_flags" + "registered_call" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17217,16 +17310,17 @@ "request_with_payload" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17237,16 +17331,17 @@ "server_finishes_request" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17257,16 +17352,17 @@ "shutdown_finishes_calls" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17277,16 +17373,17 @@ "shutdown_finishes_tags" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17297,16 +17394,17 @@ "simple_delayed_request" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17317,16 +17415,17 @@ "simple_metadata" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17337,16 +17436,17 @@ "simple_request" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17357,16 +17457,17 @@ "streaming_error_response" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17377,16 +17478,17 @@ "trailing_metadata" ], "ci_platforms": [ + "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_uds_test", + "name": "h2_ssl_proxy_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -17397,7 +17499,6 @@ "bad_hostname" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17406,9 +17507,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17419,7 +17519,6 @@ "binary_metadata" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17428,9 +17527,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17438,21 +17536,19 @@ }, { "args": [ - "cancel_after_accept" + "call_creds" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17460,21 +17556,19 @@ }, { "args": [ - "cancel_after_client_done" + "cancel_after_accept" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17482,21 +17576,19 @@ }, { "args": [ - "cancel_after_invoke" + "cancel_after_client_done" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17504,10 +17596,9 @@ }, { "args": [ - "cancel_before_invoke" + "cancel_after_invoke" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17516,9 +17607,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17526,10 +17616,9 @@ }, { "args": [ - "cancel_in_a_vacuum" + "cancel_before_invoke" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17538,9 +17627,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17548,10 +17636,9 @@ }, { "args": [ - "cancel_with_status" + "cancel_in_a_vacuum" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17560,9 +17647,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17570,21 +17656,19 @@ }, { "args": [ - "compressed_payload" + "cancel_with_status" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17592,21 +17676,19 @@ }, { "args": [ - "connectivity" + "compressed_payload" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17614,21 +17696,19 @@ }, { "args": [ - "default_host" + "connectivity" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17639,7 +17719,6 @@ "disappearing_server" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17648,9 +17727,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17661,7 +17739,6 @@ "empty_batch" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17670,9 +17747,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17683,7 +17759,6 @@ "filter_causes_close" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17692,9 +17767,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17705,7 +17779,6 @@ "graceful_server_shutdown" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17714,9 +17787,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17727,7 +17799,6 @@ "high_initial_seqno" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17736,9 +17807,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17749,7 +17819,6 @@ "hpack_size" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17758,9 +17827,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17771,7 +17839,6 @@ "idempotent_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17780,9 +17847,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17793,7 +17859,6 @@ "invoke_large_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17802,9 +17867,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17815,7 +17879,6 @@ "large_metadata" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17824,9 +17887,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17837,7 +17899,6 @@ "load_reporting_hook" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17846,9 +17907,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17859,7 +17919,6 @@ "max_concurrent_streams" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17868,9 +17927,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17881,7 +17939,6 @@ "max_message_length" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17890,9 +17947,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17903,7 +17959,6 @@ "negative_deadline" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17912,9 +17967,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17925,7 +17979,6 @@ "network_status_change" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17934,9 +17987,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17947,7 +17999,6 @@ "no_op" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17956,9 +18007,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17969,7 +18019,6 @@ "payload" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -17978,9 +18027,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -17991,7 +18039,6 @@ "ping" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18000,9 +18047,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18013,7 +18059,6 @@ "ping_pong_streaming" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18022,9 +18067,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18035,7 +18079,6 @@ "registered_call" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18044,9 +18087,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18057,7 +18099,6 @@ "request_with_flags" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18066,9 +18107,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18079,7 +18119,6 @@ "request_with_payload" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18088,9 +18127,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18101,7 +18139,6 @@ "server_finishes_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18110,9 +18147,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18123,7 +18159,6 @@ "shutdown_finishes_calls" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18132,9 +18167,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18145,7 +18179,6 @@ "shutdown_finishes_tags" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18154,9 +18187,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18167,7 +18199,6 @@ "simple_delayed_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18176,9 +18207,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18189,7 +18219,6 @@ "simple_metadata" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18198,9 +18227,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18211,7 +18239,6 @@ "simple_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18220,9 +18247,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18233,7 +18259,6 @@ "streaming_error_response" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18242,9 +18267,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18255,7 +18279,6 @@ "trailing_metadata" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -18264,9 +18287,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -18286,7 +18308,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18308,7 +18330,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18330,7 +18352,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18352,7 +18374,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18374,7 +18396,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18396,7 +18418,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18418,7 +18440,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18440,7 +18462,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18462,7 +18484,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18484,7 +18506,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18506,7 +18528,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18528,7 +18550,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18550,7 +18572,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18572,7 +18594,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18594,7 +18616,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18616,7 +18638,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18638,7 +18660,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18660,7 +18682,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18682,7 +18704,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18704,7 +18726,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18726,7 +18748,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18748,7 +18770,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18770,7 +18792,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18792,7 +18814,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18814,7 +18836,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18836,7 +18858,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18858,7 +18880,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18880,7 +18902,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18902,7 +18924,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18924,7 +18946,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18946,7 +18968,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18968,7 +18990,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -18990,7 +19012,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -19012,7 +19034,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -19034,7 +19056,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -19056,7 +19078,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -19078,7 +19100,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -19100,7 +19122,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -19122,7 +19144,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -19144,7 +19166,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -19157,6 +19179,7 @@ "bad_hostname" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19165,8 +19188,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19177,6 +19201,7 @@ "binary_metadata" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19185,8 +19210,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19197,6 +19223,7 @@ "cancel_after_accept" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19205,8 +19232,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19217,6 +19245,7 @@ "cancel_after_client_done" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19225,8 +19254,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19237,6 +19267,7 @@ "cancel_after_invoke" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19245,8 +19276,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19257,6 +19289,7 @@ "cancel_before_invoke" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19265,8 +19298,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19277,6 +19311,7 @@ "cancel_in_a_vacuum" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19285,8 +19320,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19297,6 +19333,7 @@ "cancel_with_status" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19305,8 +19342,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19317,6 +19355,7 @@ "compressed_payload" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19325,8 +19364,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19334,19 +19374,21 @@ }, { "args": [ - "empty_batch" + "connectivity" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19354,9 +19396,10 @@ }, { "args": [ - "filter_causes_close" + "default_host" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19365,8 +19408,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19374,19 +19418,21 @@ }, { "args": [ - "graceful_server_shutdown" + "disappearing_server" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19394,9 +19440,10 @@ }, { "args": [ - "high_initial_seqno" + "empty_batch" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19405,8 +19452,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19414,9 +19462,10 @@ }, { "args": [ - "hpack_size" + "filter_causes_close" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19425,8 +19474,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19434,19 +19484,21 @@ }, { "args": [ - "idempotent_request" + "graceful_server_shutdown" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19454,9 +19506,10 @@ }, { "args": [ - "invoke_large_request" + "high_initial_seqno" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19465,8 +19518,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19474,9 +19528,10 @@ }, { "args": [ - "large_metadata" + "hpack_size" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19485,8 +19540,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19494,9 +19550,10 @@ }, { "args": [ - "load_reporting_hook" + "idempotent_request" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19505,8 +19562,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19514,9 +19572,10 @@ }, { "args": [ - "max_concurrent_streams" + "invoke_large_request" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19525,8 +19584,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19534,9 +19594,10 @@ }, { "args": [ - "max_message_length" + "large_metadata" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19545,8 +19606,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19554,9 +19616,10 @@ }, { "args": [ - "negative_deadline" + "load_reporting_hook" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19565,8 +19628,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19574,9 +19638,10 @@ }, { "args": [ - "network_status_change" + "max_concurrent_streams" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19585,8 +19650,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19594,9 +19660,10 @@ }, { "args": [ - "no_op" + "max_message_length" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19605,8 +19672,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19614,9 +19682,10 @@ }, { "args": [ - "payload" + "negative_deadline" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19625,8 +19694,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19634,9 +19704,10 @@ }, { "args": [ - "ping_pong_streaming" + "network_status_change" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19645,8 +19716,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19654,9 +19726,10 @@ }, { "args": [ - "registered_call" + "no_op" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19665,8 +19738,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19674,19 +19748,21 @@ }, { "args": [ - "request_with_flags" + "payload" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19694,9 +19770,10 @@ }, { "args": [ - "request_with_payload" + "ping" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19705,8 +19782,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19714,9 +19792,10 @@ }, { "args": [ - "server_finishes_request" + "ping_pong_streaming" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19725,8 +19804,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19734,9 +19814,10 @@ }, { "args": [ - "shutdown_finishes_calls" + "registered_call" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19745,8 +19826,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19754,19 +19836,21 @@ }, { "args": [ - "shutdown_finishes_tags" + "request_with_flags" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19774,9 +19858,10 @@ }, { "args": [ - "simple_metadata" + "request_with_payload" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19785,8 +19870,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19794,9 +19880,10 @@ }, { "args": [ - "simple_request" + "server_finishes_request" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19805,8 +19892,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19814,9 +19902,10 @@ }, { "args": [ - "streaming_error_response" + "shutdown_finishes_calls" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19825,8 +19914,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19834,9 +19924,10 @@ }, { "args": [ - "trailing_metadata" + "shutdown_finishes_tags" ], "ci_platforms": [ + "windows", "linux", "mac", "posix" @@ -19845,8 +19936,9 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_fd_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ + "windows", "linux", "mac", "posix" @@ -19854,7 +19946,7 @@ }, { "args": [ - "bad_hostname" + "simple_delayed_request" ], "ci_platforms": [ "windows", @@ -19866,7 +19958,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ "windows", "linux", @@ -19876,7 +19968,7 @@ }, { "args": [ - "binary_metadata" + "simple_metadata" ], "ci_platforms": [ "windows", @@ -19888,7 +19980,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ "windows", "linux", @@ -19898,7 +19990,7 @@ }, { "args": [ - "cancel_after_accept" + "simple_request" ], "ci_platforms": [ "windows", @@ -19906,11 +19998,11 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ "windows", "linux", @@ -19920,7 +20012,7 @@ }, { "args": [ - "cancel_after_client_done" + "streaming_error_response" ], "ci_platforms": [ "windows", @@ -19932,7 +20024,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ "windows", "linux", @@ -19942,7 +20034,7 @@ }, { "args": [ - "cancel_after_invoke" + "trailing_metadata" ], "ci_platforms": [ "windows", @@ -19950,11 +20042,11 @@ "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_compress_nosec_test", "platforms": [ "windows", "linux", @@ -19964,21 +20056,19 @@ }, { "args": [ - "cancel_before_invoke" + "bad_hostname" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -19986,21 +20076,19 @@ }, { "args": [ - "cancel_in_a_vacuum" + "binary_metadata" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20008,10 +20096,9 @@ }, { "args": [ - "cancel_with_status" + "cancel_after_accept" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20020,9 +20107,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20030,10 +20116,9 @@ }, { "args": [ - "compressed_payload" + "cancel_after_client_done" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20042,9 +20127,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20052,10 +20136,9 @@ }, { "args": [ - "connectivity" + "cancel_after_invoke" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20064,9 +20147,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20074,21 +20156,19 @@ }, { "args": [ - "default_host" + "cancel_before_invoke" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20096,21 +20176,19 @@ }, { "args": [ - "disappearing_server" + "cancel_in_a_vacuum" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20118,21 +20196,19 @@ }, { "args": [ - "empty_batch" + "cancel_with_status" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20140,10 +20216,9 @@ }, { "args": [ - "filter_causes_close" + "compressed_payload" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20152,9 +20227,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20162,21 +20236,19 @@ }, { "args": [ - "graceful_server_shutdown" + "empty_batch" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20184,10 +20256,9 @@ }, { "args": [ - "high_initial_seqno" + "filter_causes_close" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20196,9 +20267,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20206,21 +20276,19 @@ }, { "args": [ - "hpack_size" + "graceful_server_shutdown" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20228,10 +20296,9 @@ }, { "args": [ - "idempotent_request" + "high_initial_seqno" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20240,9 +20307,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20250,10 +20316,9 @@ }, { "args": [ - "invoke_large_request" + "hpack_size" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20262,9 +20327,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20272,10 +20336,9 @@ }, { "args": [ - "large_metadata" + "idempotent_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20284,9 +20347,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20294,10 +20356,9 @@ }, { "args": [ - "load_reporting_hook" + "invoke_large_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20306,9 +20367,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20316,10 +20376,9 @@ }, { "args": [ - "max_concurrent_streams" + "large_metadata" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20328,9 +20387,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20338,10 +20396,9 @@ }, { "args": [ - "max_message_length" + "load_reporting_hook" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20350,9 +20407,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20360,10 +20416,9 @@ }, { "args": [ - "negative_deadline" + "max_concurrent_streams" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20372,9 +20427,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20382,10 +20436,9 @@ }, { "args": [ - "network_status_change" + "max_message_length" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20394,9 +20447,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20404,10 +20456,9 @@ }, { "args": [ - "no_op" + "negative_deadline" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20416,9 +20467,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20426,10 +20476,9 @@ }, { "args": [ - "payload" + "network_status_change" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20438,9 +20487,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20448,10 +20496,9 @@ }, { "args": [ - "ping" + "no_op" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20460,9 +20507,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20470,10 +20516,9 @@ }, { "args": [ - "ping_pong_streaming" + "payload" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20482,9 +20527,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20492,10 +20536,9 @@ }, { "args": [ - "registered_call" + "ping_pong_streaming" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20504,9 +20547,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20514,21 +20556,19 @@ }, { "args": [ - "request_with_flags" + "registered_call" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 0.1, + "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20536,21 +20576,19 @@ }, { "args": [ - "request_with_payload" + "request_with_flags" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], - "cpu_cost": 1.0, + "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20558,10 +20596,9 @@ }, { "args": [ - "server_finishes_request" + "request_with_payload" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20570,9 +20607,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20580,10 +20616,9 @@ }, { "args": [ - "shutdown_finishes_calls" + "server_finishes_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20592,9 +20627,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20602,10 +20636,9 @@ }, { "args": [ - "shutdown_finishes_tags" + "shutdown_finishes_calls" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20614,9 +20647,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20624,10 +20656,9 @@ }, { "args": [ - "simple_delayed_request" + "shutdown_finishes_tags" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20636,9 +20667,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20649,7 +20679,6 @@ "simple_metadata" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20658,9 +20687,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20671,7 +20699,6 @@ "simple_request" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20680,9 +20707,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20693,7 +20719,6 @@ "streaming_error_response" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20702,9 +20727,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20715,7 +20739,6 @@ "trailing_metadata" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" @@ -20724,9 +20747,8 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full_nosec_test", + "name": "h2_fd_nosec_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -20737,15 +20759,21 @@ "bad_hostname" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20753,15 +20781,21 @@ "binary_metadata" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20769,15 +20803,21 @@ "cancel_after_accept" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20785,15 +20825,21 @@ "cancel_after_client_done" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20801,15 +20847,21 @@ "cancel_after_invoke" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20817,15 +20869,21 @@ "cancel_before_invoke" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20833,15 +20891,21 @@ "cancel_in_a_vacuum" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20849,15 +20913,21 @@ "cancel_with_status" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20865,15 +20935,21 @@ "compressed_payload" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20881,15 +20957,21 @@ "connectivity" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20897,15 +20979,21 @@ "default_host" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20913,15 +21001,21 @@ "disappearing_server" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20929,15 +21023,21 @@ "empty_batch" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20945,15 +21045,21 @@ "filter_causes_close" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20961,15 +21067,21 @@ "graceful_server_shutdown" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20977,15 +21089,21 @@ "high_initial_seqno" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -20993,15 +21111,21 @@ "hpack_size" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21009,15 +21133,21 @@ "idempotent_request" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21025,15 +21155,21 @@ "invoke_large_request" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21041,15 +21177,21 @@ "large_metadata" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21057,15 +21199,21 @@ "load_reporting_hook" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21073,15 +21221,21 @@ "max_concurrent_streams" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21089,15 +21243,21 @@ "max_message_length" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21105,15 +21265,1519 @@ "negative_deadline" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "network_status_change" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "no_op" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "payload" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "ping_pong_streaming" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "registered_call" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "request_with_flags" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "request_with_payload" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "server_finishes_request" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "shutdown_finishes_calls" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "shutdown_finishes_tags" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "simple_delayed_request" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "simple_metadata" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "simple_request" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "streaming_error_response" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "trailing_metadata" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "bad_hostname" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "binary_metadata" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "cancel_after_accept" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "cancel_after_client_done" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "cancel_after_invoke" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "cancel_before_invoke" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "cancel_in_a_vacuum" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "cancel_with_status" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "compressed_payload" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "connectivity" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "default_host" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "disappearing_server" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "empty_batch" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "filter_causes_close" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "graceful_server_shutdown" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "high_initial_seqno" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "hpack_size" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "idempotent_request" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "invoke_large_request" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "large_metadata" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "load_reporting_hook" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "max_concurrent_streams" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "max_message_length" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "negative_deadline" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "network_status_change" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "no_op" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "payload" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "ping" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "ping_pong_streaming" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "registered_call" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "request_with_flags" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "request_with_payload" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "server_finishes_request" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "shutdown_finishes_calls" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "shutdown_finishes_tags" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "simple_delayed_request" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "simple_metadata" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "simple_request" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "streaming_error_response" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "trailing_metadata" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, + { + "args": [ + "bad_hostname" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "binary_metadata" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "cancel_after_accept" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "cancel_after_client_done" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "cancel_after_invoke" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "cancel_before_invoke" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "cancel_in_a_vacuum" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "cancel_with_status" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "compressed_payload" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "connectivity" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "default_host" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "disappearing_server" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "empty_batch" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "filter_causes_close" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "graceful_server_shutdown" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 0.1, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "high_initial_seqno" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "idempotent_request" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "invoke_large_request" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "large_metadata" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "load_reporting_hook" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "max_concurrent_streams" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "max_message_length" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "negative_deadline" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21121,15 +22785,21 @@ "network_status_change" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21137,15 +22807,21 @@ "no_op" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21153,15 +22829,21 @@ "payload" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21169,15 +22851,21 @@ "ping" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21185,15 +22873,21 @@ "ping_pong_streaming" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21201,15 +22895,21 @@ "registered_call" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21217,15 +22917,21 @@ "request_with_flags" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 0.1, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21233,15 +22939,21 @@ "request_with_payload" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21249,15 +22961,21 @@ "server_finishes_request" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21265,15 +22983,21 @@ "shutdown_finishes_calls" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21281,15 +23005,21 @@ "shutdown_finishes_tags" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21297,15 +23027,21 @@ "simple_delayed_request" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21313,15 +23049,21 @@ "simple_metadata" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21329,15 +23071,21 @@ "simple_request" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21345,15 +23093,21 @@ "streaming_error_response" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21361,15 +23115,21 @@ "trailing_metadata" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -21386,7 +23146,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21408,7 +23168,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21430,7 +23190,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21452,7 +23212,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21474,7 +23234,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21496,7 +23256,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21518,7 +23278,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21540,7 +23300,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21562,7 +23322,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21584,7 +23344,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21606,7 +23366,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21628,7 +23388,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21650,7 +23410,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21672,7 +23432,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21694,7 +23454,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21716,7 +23476,29 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, + { + "args": [ + "hpack_size" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "flaky": false, + "language": "c", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21738,7 +23520,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21760,7 +23542,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21782,7 +23564,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21804,7 +23586,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21826,7 +23608,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21848,7 +23630,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21870,7 +23652,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21892,7 +23674,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21914,7 +23696,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21936,7 +23718,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21958,7 +23740,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -21980,7 +23762,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22002,7 +23784,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22024,7 +23806,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22046,7 +23828,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22068,7 +23850,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22090,7 +23872,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22112,7 +23894,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22134,7 +23916,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22156,7 +23938,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22178,7 +23960,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22200,7 +23982,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", @@ -22222,7 +24004,7 @@ "exclude_configs": [], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_load_reporting_nosec_test", "platforms": [ "windows", "linux", diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln index 8a422f3532..6c92e7743b 100644 --- a/vsprojects/buildtests_c.sln +++ b/vsprojects/buildtests_c.sln @@ -748,6 +748,30 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "h2_full_test", "vcxproj\tes {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "h2_load_reporting_nosec_test", "vcxproj\test/end2end/fixtures\h2_load_reporting_nosec_test\h2_load_reporting_nosec_test.vcxproj", "{4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}" + ProjectSection(myProperties) = preProject + lib = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {47C2CB41-4E9F-58B6-F606-F6FAED5D00ED} = {47C2CB41-4E9F-58B6-F606-F6FAED5D00ED} + {0A7E7F92-FDEA-40F1-A9EC-3BA484F98BBF} = {0A7E7F92-FDEA-40F1-A9EC-3BA484F98BBF} + {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5} = {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5} + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "h2_load_reporting_test", "vcxproj\test/end2end/fixtures\h2_load_reporting_test\h2_load_reporting_test.vcxproj", "{F0A06723-2E3E-FE97-34B7-A2BA26D98B83}" + ProjectSection(myProperties) = preProject + lib = "False" + EndProjectSection + ProjectSection(ProjectDependencies) = postProject + {1F1F9084-2A93-B80E-364F-5754894AFAB4} = {1F1F9084-2A93-B80E-364F-5754894AFAB4} + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9} + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "h2_oauth2_test", "vcxproj\test/end2end/fixtures\h2_oauth2_test\h2_oauth2_test.vcxproj", "{0F761FF3-342A-C429-711F-F76181BAA52D}" ProjectSection(myProperties) = preProject lib = "False" @@ -2583,6 +2607,38 @@ Global {EEBEFA75-C625-C823-FE96-9AD64887B57D}.Release-DLL|Win32.Build.0 = Release|Win32 {EEBEFA75-C625-C823-FE96-9AD64887B57D}.Release-DLL|x64.ActiveCfg = Release|x64 {EEBEFA75-C625-C823-FE96-9AD64887B57D}.Release-DLL|x64.Build.0 = Release|x64 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug|Win32.ActiveCfg = Debug|Win32 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug|x64.ActiveCfg = Debug|x64 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release|Win32.ActiveCfg = Release|Win32 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release|x64.ActiveCfg = Release|x64 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug|Win32.Build.0 = Debug|Win32 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug|x64.Build.0 = Debug|x64 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release|Win32.Build.0 = Release|Win32 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release|x64.Build.0 = Release|x64 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug-DLL|Win32.Build.0 = Debug|Win32 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug-DLL|x64.ActiveCfg = Debug|x64 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug-DLL|x64.Build.0 = Debug|x64 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release-DLL|Win32.ActiveCfg = Release|Win32 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release-DLL|Win32.Build.0 = Release|Win32 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release-DLL|x64.ActiveCfg = Release|x64 + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release-DLL|x64.Build.0 = Release|x64 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug|Win32.ActiveCfg = Debug|Win32 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug|x64.ActiveCfg = Debug|x64 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release|Win32.ActiveCfg = Release|Win32 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release|x64.ActiveCfg = Release|x64 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug|Win32.Build.0 = Debug|Win32 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug|x64.Build.0 = Debug|x64 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release|Win32.Build.0 = Release|Win32 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release|x64.Build.0 = Release|x64 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug-DLL|Win32.Build.0 = Debug|Win32 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug-DLL|x64.ActiveCfg = Debug|x64 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug-DLL|x64.Build.0 = Debug|x64 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release-DLL|Win32.ActiveCfg = Release|Win32 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release-DLL|Win32.Build.0 = Release|Win32 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release-DLL|x64.ActiveCfg = Release|x64 + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release-DLL|x64.Build.0 = Release|x64 {0F761FF3-342A-C429-711F-F76181BAA52D}.Debug|Win32.ActiveCfg = Debug|Win32 {0F761FF3-342A-C429-711F-F76181BAA52D}.Debug|x64.ActiveCfg = Debug|x64 {0F761FF3-342A-C429-711F-F76181BAA52D}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj b/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj new file mode 100644 index 0000000000..1ccc6bb8dc --- /dev/null +++ b/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj @@ -0,0 +1,202 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF} + true + $(SolutionDir)IntDir\$(MSBuildProjectName)\ + + + + v100 + + + v110 + + + v120 + + + v140 + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + h2_load_reporting_nosec_test + static + Debug + static + Debug + + + h2_load_reporting_nosec_test + static + Release + static + Release + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + + + + + {47C2CB41-4E9F-58B6-F606-F6FAED5D00ED} + + + {0A7E7F92-FDEA-40F1-A9EC-3BA484F98BBF} + + + {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5} + + + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + diff --git a/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj.filters b/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj.filters new file mode 100644 index 0000000000..72df23ebc1 --- /dev/null +++ b/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + test\core\end2end\fixtures + + + + + + {abff9aef-586e-65d2-beb8-e6392ecf7440} + + + {fd31cbf1-8cff-2e6a-618d-a01855997839} + + + {c6cc113f-ddb4-733b-5c10-8f98aa2d7d22} + + + {2cd15a3b-a7e6-b847-b6c4-7c6cc03eacc2} + + + + diff --git a/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj b/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj new file mode 100644 index 0000000000..d5d1a15a82 --- /dev/null +++ b/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj @@ -0,0 +1,202 @@ + + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F0A06723-2E3E-FE97-34B7-A2BA26D98B83} + true + $(SolutionDir)IntDir\$(MSBuildProjectName)\ + + + + v100 + + + v110 + + + v120 + + + v140 + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + h2_load_reporting_test + static + Debug + static + Debug + + + h2_load_reporting_test + static + Release + static + Release + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + true + None + false + + + Console + true + false + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + NotUsing + Level3 + MaxSpeed + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + true + true + MultiThreaded + true + None + false + + + Console + true + false + true + true + + + + + + + + + + {1F1F9084-2A93-B80E-364F-5754894AFAB4} + + + {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} + + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + + + {EAB0A629-17A9-44DB-B5FF-E91A721FE037} + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + diff --git a/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj.filters b/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj.filters new file mode 100644 index 0000000000..95b049c852 --- /dev/null +++ b/vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj.filters @@ -0,0 +1,24 @@ + + + + + test\core\end2end\fixtures + + + + + + {467ceaa9-3a51-d5df-0556-1ef8e91f5d7d} + + + {1ec29254-9064-0338-78ca-94d8cfdbd95c} + + + {58fc84e1-7dc9-a517-359e-7d7e1c417432} + + + {92ef09e0-592b-0ca5-4d79-5929ae159ed5} + + + + -- cgit v1.2.3 From ef55d7e02f719d56b9abfb4fb785e9e5b7c44e77 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 14 Jul 2016 13:22:22 -0700 Subject: Fix a memory leak in Node call credentials --- src/node/ext/call_credentials.cc | 30 +++++++++++++++++++++--------- src/node/src/credentials.js | 5 +++-- 2 files changed, 24 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/node/ext/call_credentials.cc b/src/node/ext/call_credentials.cc index 3c8f0c56da..81fc552fd1 100644 --- a/src/node/ext/call_credentials.cc +++ b/src/node/ext/call_credentials.cc @@ -68,6 +68,8 @@ using v8::Value; Nan::Callback *CallCredentials::constructor; Persistent CallCredentials::fun_tpl; +static Callback *plugin_callback; + CallCredentials::CallCredentials(grpc_call_credentials *credentials) : wrapped_credentials(credentials) {} @@ -88,6 +90,11 @@ void CallCredentials::Init(Local exports) { Nan::New(CreateFromPlugin)).ToLocalChecked()); Nan::Set(exports, Nan::New("CallCredentials").ToLocalChecked(), ctr); constructor = new Nan::Callback(ctr); + + Local callback_tpl = + Nan::New(PluginCallback); + plugin_callback = new Callback( + Nan::GetFunction(callback_tpl).ToLocalChecked()); } bool CallCredentials::HasInstance(Local val) { @@ -195,23 +202,28 @@ NAN_METHOD(PluginCallback) { return Nan::ThrowTypeError( "The callback's third argument must be an object"); } + if (!info[3]->IsObject()) { + return Nan::ThrowTypeError( + "The callback's fourth argument must be an object"); + } shared_ptr resources(new Resources); grpc_status_code code = static_cast( Nan::To(info[0]).FromJust()); Utf8String details_utf8_str(info[1]); char *details = *details_utf8_str; grpc_metadata_array array; + Local callback_data = Nan::To(info[3]).ToLocalChecked(); if (!CreateMetadataArray(Nan::To(info[2]).ToLocalChecked(), &array, resources)){ return Nan::ThrowError("Failed to parse metadata"); } grpc_credentials_plugin_metadata_cb cb = reinterpret_cast( - Nan::Get(info.Callee(), + Nan::Get(callback_data, Nan::New("cb").ToLocalChecked() ).ToLocalChecked().As()->Value()); void *user_data = - Nan::Get(info.Callee(), + Nan::Get(callback_data, Nan::New("user_data").ToLocalChecked() ).ToLocalChecked().As()->Value(); cb(user_data, array.metadata, array.count, code, details); @@ -227,17 +239,17 @@ NAUV_WORK_CB(SendPluginCallback) { while (!callbacks.empty()) { plugin_callback_data *data = callbacks.front(); callbacks.pop_front(); - // Attach cb and user_data to plugin_callback so that it can access them later - v8::Local plugin_callback = Nan::GetFunction( - Nan::New(PluginCallback)).ToLocalChecked(); - Nan::Set(plugin_callback, Nan::New("cb").ToLocalChecked(), + Local callback_data = Nan::New(); + Nan::Set(callback_data, Nan::New("cb").ToLocalChecked(), Nan::New(reinterpret_cast(data->cb))); - Nan::Set(plugin_callback, Nan::New("user_data").ToLocalChecked(), + Nan::Set(callback_data, Nan::New("user_data").ToLocalChecked(), Nan::New(data->user_data)); - const int argc = 2; + const int argc = 3; v8::Local argv[argc] = { Nan::New(data->service_url).ToLocalChecked(), - plugin_callback + callback_data, + // Get Local from Nan::Callback* + **plugin_callback }; Nan::Callback *callback = state->callback; callback->Call(argc, argv); diff --git a/src/node/src/credentials.js b/src/node/src/credentials.js index b746d0625d..043df06a66 100644 --- a/src/node/src/credentials.js +++ b/src/node/src/credentials.js @@ -92,7 +92,8 @@ exports.createSsl = ChannelCredentials.createSsl; * @return {CallCredentials} The credentials object */ exports.createFromMetadataGenerator = function(metadata_generator) { - return CallCredentials.createFromPlugin(function(service_url, callback) { + return CallCredentials.createFromPlugin(function(service_url, cb_data, + callback) { metadata_generator({service_url: service_url}, function(error, metadata) { var code = grpc.status.OK; var message = ''; @@ -107,7 +108,7 @@ exports.createFromMetadataGenerator = function(metadata_generator) { metadata = new Metadata(); } } - callback(code, message, metadata._getCoreRepresentation()); + callback(code, message, metadata._getCoreRepresentation(), cb_data); }); }); }; -- cgit v1.2.3 From bce3fb07cea5c9367fd5557a42148f5d0a505a9a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 21 Jul 2016 11:28:35 -0700 Subject: Fixed typo in Node health check package.json --- src/node/health_check/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/node/health_check/package.json b/src/node/health_check/package.json index b68e8b1a80..582d560101 100644 --- a/src/node/health_check/package.json +++ b/src/node/health_check/package.json @@ -19,11 +19,11 @@ "lodash": "^3.9.3", "google-protobuf": "^3.0.0-alpha.5" }, - "files": { + "files": [ "LICENSE", "health.js", "v1" - }, + ], "main": "src/node/index.js", "license": "BSD-3-Clause" } -- cgit v1.2.3 From 9ee78aa17d2dbb6bdbe86cc3f110d0f832bf0d4d Mon Sep 17 00:00:00 2001 From: thinkerou Date: Fri, 22 Jul 2016 03:02:56 +0800 Subject: use php7_wrapper to reduce dup-codes --- src/php/ext/grpc/call.c | 31 ++------------------ src/php/ext/grpc/call.h | 3 ++ src/php/ext/grpc/call_credentials.c | 15 ++-------- src/php/ext/grpc/call_credentials.h | 2 ++ src/php/ext/grpc/channel.c | 40 +++----------------------- src/php/ext/grpc/channel.h | 3 ++ src/php/ext/grpc/channel_credentials.c | 26 +++++------------ src/php/ext/grpc/channel_credentials.h | 3 ++ src/php/ext/grpc/php7_wrapper.h | 52 ++++++++++++++++++++++++++++++++++ src/php/ext/grpc/php_grpc.h | 2 ++ src/php/ext/grpc/server.c | 36 ++--------------------- src/php/ext/grpc/server.h | 3 ++ src/php/ext/grpc/server_credentials.c | 8 ++---- src/php/ext/grpc/server_credentials.h | 3 ++ src/php/ext/grpc/timeval.c | 3 +- src/php/ext/grpc/timeval.h | 3 ++ 16 files changed, 97 insertions(+), 136 deletions(-) create mode 100644 src/php/ext/grpc/php7_wrapper.h (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index bd1eccb01b..3f96db7ccb 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -341,18 +341,11 @@ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { PHP_METHOD(Call, __construct) { zval *channel_obj; char *method; + php_grpc_int method_len; zval *deadline_obj; char *host_override = NULL; -#if PHP_MAJOR_VERSION < 7 - int method_len; - int host_override_len = 0; - wrapped_grpc_call *call = - (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else - size_t method_len; - size_t host_override_len = 0; + php_grpc_int host_override_len = 0; wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); -#endif /* "OsO|s" == 1 Object, 1 string, 1 Object, 1 optional string */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "OsO|s", &channel_obj, @@ -364,13 +357,7 @@ PHP_METHOD(Call, __construct) { "an optional String", 1 TSRMLS_CC); return; } -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_channel *channel = - (wrapped_grpc_channel *)zend_object_store_get_object( - channel_obj TSRMLS_CC); -#else wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(channel_obj); -#endif if (channel->wrapped == NULL) { zend_throw_exception(spl_ce_InvalidArgumentException, "Call cannot be constructed from a closed Channel", @@ -378,13 +365,7 @@ PHP_METHOD(Call, __construct) { return; } add_property_zval(getThis(), "channel", channel_obj); -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_timeval *deadline = - (wrapped_grpc_timeval *)zend_object_store_get_object( - deadline_obj TSRMLS_CC); -#else wrapped_grpc_timeval *deadline = Z_WRAPPED_GRPC_TIMEVAL_P(deadline_obj); -#endif call->wrapped = grpc_channel_create_call(channel->wrapped, NULL, GRPC_PROPAGATE_DEFAULTS, completion_queue, method, host_override, @@ -889,17 +870,9 @@ PHP_METHOD(Call, setCredentials) { return; } -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_call_credentials *creds = - (wrapped_grpc_call_credentials *)zend_object_store_get_object( - creds_obj TSRMLS_CC); - wrapped_grpc_call *call = - (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else wrapped_grpc_call_credentials *creds = Z_WRAPPED_GRPC_CALL_CREDS_P(creds_obj); wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); -#endif grpc_call_error error = GRPC_CALL_ERROR; error = grpc_call_set_credentials(call->wrapped, creds->wrapped); diff --git a/src/php/ext/grpc/call.h b/src/php/ext/grpc/call.h index 9fc52d7820..4931bf392e 100644 --- a/src/php/ext/grpc/call.h +++ b/src/php/ext/grpc/call.h @@ -64,6 +64,9 @@ zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned TSRMLS_DC); * call metadata */ zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array TSRMLS_DC); +#define Z_WRAPPED_GRPC_CALL_P(zv) \ + (wrapped_grpc_call *)zend_object_store_get_object(zv TSRMLS_CC) + #else /* Wrapper struct for grpc_call that can be associated with a PHP object */ diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index 70aaffb848..24ee0a465e 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -153,26 +153,17 @@ PHP_METHOD(CallCredentials, createComposite) { 1 TSRMLS_CC); return; } -#if PHP_MAJOR_VERSION < 7 wrapped_grpc_call_credentials *cred1 = - (wrapped_grpc_call_credentials *)zend_object_store_get_object( - cred1_obj TSRMLS_CC); + Z_WRAPPED_GRPC_CALL_CREDS_P(cred1_obj); wrapped_grpc_call_credentials *cred2 = - (wrapped_grpc_call_credentials *)zend_object_store_get_object( - cred2_obj TSRMLS_CC); + Z_WRAPPED_GRPC_CALL_CREDS_P(cred2_obj); grpc_call_credentials *creds = grpc_composite_call_credentials_create(cred1->wrapped, cred2->wrapped, NULL); +#if PHP_MAJOR_VERSION < 7 zval *creds_object = grpc_php_wrap_call_credentials(creds TSRMLS_CC); RETURN_DESTROY_ZVAL(creds_object); #else - wrapped_grpc_call_credentials *cred1 = - Z_WRAPPED_GRPC_CALL_CREDS_P(cred1_obj); - wrapped_grpc_call_credentials *cred2 = - Z_WRAPPED_GRPC_CALL_CREDS_P(cred2_obj); - grpc_call_credentials *creds = - grpc_composite_call_credentials_create(cred1->wrapped, - cred2->wrapped, NULL); grpc_php_wrap_call_credentials(creds, return_value); RETURN_DESTROY_ZVAL(return_value); #endif diff --git a/src/php/ext/grpc/call_credentials.h b/src/php/ext/grpc/call_credentials.h index e05e14698b..e9688288de 100755 --- a/src/php/ext/grpc/call_credentials.h +++ b/src/php/ext/grpc/call_credentials.h @@ -58,6 +58,8 @@ typedef struct wrapped_grpc_call_credentials { grpc_call_credentials *wrapped; } wrapped_grpc_call_credentials; +#define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \ + (wrapped_grpc_call_credentials *)zend_object_store_get_object(zv TSRMLS_CC) #else /* Wrapper struct for grpc_call_credentials that can be associated diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 6737e340f9..085a51b560 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -201,18 +201,14 @@ void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args) { * @param array $args The arguments to pass to the Channel (optional) */ PHP_METHOD(Channel, __construct) { + wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis()); #if PHP_MAJOR_VERSION < 7 - wrapped_grpc_channel *channel = - (wrapped_grpc_channel *)zend_object_store_get_object( - getThis() TSRMLS_CC); zval **creds_obj = NULL; - int target_length; #else - wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis()); zval *creds_obj = NULL; - size_t target_length; #endif char *target; + php_grpc_int target_length; zval *args_array = NULL; grpc_channel_args args; HashTable *array_hash; @@ -277,14 +273,8 @@ PHP_METHOD(Channel, __construct) { * @return string The URI of the endpoint */ PHP_METHOD(Channel, getTarget) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_channel *channel = - (wrapped_grpc_channel *)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_STRING(grpc_channel_get_target(channel->wrapped), 1); -#else wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis()); - RETURN_STRING(grpc_channel_get_target(channel->wrapped)); -#endif + PHP_GRPC_RETURN_STRING(grpc_channel_get_target(channel->wrapped), 1); } /** @@ -293,12 +283,7 @@ PHP_METHOD(Channel, getTarget) { * @return long The grpc connectivity state */ PHP_METHOD(Channel, getConnectivityState) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_channel *channel = - (wrapped_grpc_channel *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis()); -#endif bool try_to_connect = false; /* "|b" == 1 optional bool */ @@ -320,14 +305,8 @@ PHP_METHOD(Channel, getConnectivityState) { * before deadline */ PHP_METHOD(Channel, watchConnectivityState) { -#if PHP_MAJOR_VERSION < 7 - long last_state; - wrapped_grpc_channel *channel = - (wrapped_grpc_channel *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else - zend_long last_state; wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis()); -#endif + php_grpc_long last_state; zval *deadline_obj; /* "lO" == 1 long 1 object */ @@ -339,13 +318,7 @@ PHP_METHOD(Channel, watchConnectivityState) { return; } -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_timeval *deadline = - (wrapped_grpc_timeval *)zend_object_store_get_object( - deadline_obj TSRMLS_CC); -#else wrapped_grpc_timeval *deadline = Z_WRAPPED_GRPC_TIMEVAL_P(deadline_obj); -#endif grpc_channel_watch_connectivity_state(channel->wrapped, (grpc_connectivity_state)last_state, deadline->wrapped, completion_queue, @@ -360,12 +333,7 @@ PHP_METHOD(Channel, watchConnectivityState) { * Close the channel */ PHP_METHOD(Channel, close) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_channel *channel = - (wrapped_grpc_channel *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis()); -#endif if (channel->wrapped != NULL) { grpc_channel_destroy(channel->wrapped); channel->wrapped = NULL; diff --git a/src/php/ext/grpc/channel.h b/src/php/ext/grpc/channel.h index ea5efeaf86..94c633408e 100755 --- a/src/php/ext/grpc/channel.h +++ b/src/php/ext/grpc/channel.h @@ -56,6 +56,9 @@ typedef struct wrapped_grpc_channel { grpc_channel *wrapped; } wrapped_grpc_channel; +#define Z_WRAPPED_GRPC_CHANNEL_P(zv) \ + (wrapped_grpc_channel *)zend_object_store_get_object(zv TSRMLS_CC) + #else /* Wrapper struct for grpc_channel that can be associated with a PHP object */ diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 16ba0368eb..e255b3004b 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -152,11 +152,7 @@ void grpc_php_wrap_channel_credentials(grpc_channel_credentials *wrapped, */ PHP_METHOD(ChannelCredentials, setDefaultRootsPem) { char *pem_roots; -#if PHP_MAJOR_VERSION < 7 - int pem_roots_length; -#else - size_t pem_roots_length; -#endif + php_grpc_int pem_roots_length; /* "s" == 1 string */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &pem_roots, @@ -197,11 +193,9 @@ PHP_METHOD(ChannelCredentials, createSsl) { char *pem_root_certs = NULL; grpc_ssl_pem_key_cert_pair pem_key_cert_pair; -#if PHP_MAJOR_VERSION < 7 - int root_certs_length = 0, private_key_length = 0, cert_chain_length = 0; -#else - size_t root_certs_length = 0, private_key_length = 0, cert_chain_length = 0; -#endif + php_grpc_int root_certs_length = 0; + php_grpc_int private_key_length = 0; + php_grpc_int cert_chain_length = 0; pem_key_cert_pair.private_key = pem_key_cert_pair.cert_chain = NULL; @@ -246,23 +240,17 @@ PHP_METHOD(ChannelCredentials, createComposite) { "createComposite expects 2 Credentials", 1 TSRMLS_CC); return; } -#if PHP_MAJOR_VERSION < 7 wrapped_grpc_channel_credentials *cred1 = - (wrapped_grpc_channel_credentials *)zend_object_store_get_object( - cred1_obj TSRMLS_CC); + Z_WRAPPED_GRPC_CHANNEL_CREDS_P(cred1_obj); wrapped_grpc_call_credentials *cred2 = - (wrapped_grpc_call_credentials *)zend_object_store_get_object( - cred2_obj TSRMLS_CC); + Z_WRAPPED_GRPC_CALL_CREDS_P(cred2_obj); +#if PHP_MAJOR_VERSION < 7 grpc_channel_credentials *creds = grpc_composite_channel_credentials_create(cred1->wrapped, cred2->wrapped, NULL); zval *creds_object = grpc_php_wrap_channel_credentials(creds TSRMLS_CC); RETURN_DESTROY_ZVAL(creds_object); #else - wrapped_grpc_channel_credentials *cred1 = - Z_WRAPPED_GRPC_CHANNEL_CREDS_P(cred1_obj); - wrapped_grpc_call_credentials *cred2 = - Z_WRAPPED_GRPC_CALL_CREDS_P(cred2_obj); grpc_channel_credentials *creds = grpc_composite_channel_credentials_create(cred1->wrapped, cred2->wrapped, NULL); diff --git a/src/php/ext/grpc/channel_credentials.h b/src/php/ext/grpc/channel_credentials.h index 44071b10f1..0f7759daa6 100755 --- a/src/php/ext/grpc/channel_credentials.h +++ b/src/php/ext/grpc/channel_credentials.h @@ -58,6 +58,9 @@ typedef struct wrapped_grpc_channel_credentials { grpc_channel_credentials *wrapped; } wrapped_grpc_channel_credentials; +#define Z_WRAPPED_GRPC_CHANNEL_CREDS_P(zv) \ + (wrapped_grpc_channel_credentials *)zend_object_store_get_object(zv TSRMLS_CC) + #else /* Wrapper struct for grpc_channel_credentials that can be associated diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h new file mode 100644 index 0000000000..98b2aaeef5 --- /dev/null +++ b/src/php/ext/grpc/php7_wrapper.h @@ -0,0 +1,52 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + +#ifndef PHP7_WRAPPER_GRPC_H +#define PHP7_WRAPPER_GRPC_H + +#if PHP_MAJOR_VERSION < 7 + +#define php_grpc_int int +#define php_grpc_long long +#define PHP_GRPC_RETURN_STRING(val, dup) RETURN_STRING(val, dup) + +#else + +#define php_grpc_int size_t +#define php_grpc_long zend_long +#define PHP_GRPC_RETURN_STRING(val, dup) RETURN_STRING(val) + +#endif /* PHP_MAJOR_VERSION */ + +#endif /* PHP7_WRAPPER_GRPC_H */ diff --git a/src/php/ext/grpc/php_grpc.h b/src/php/ext/grpc/php_grpc.h index bd7ee75a6f..e57a06545e 100644 --- a/src/php/ext/grpc/php_grpc.h +++ b/src/php/ext/grpc/php_grpc.h @@ -57,6 +57,8 @@ extern zend_module_entry grpc_module_entry; #include "php.h" +#include "php7_wrapper.h" + #include "grpc/grpc.h" #define RETURN_DESTROY_ZVAL(val) \ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index 50fb2d0cf9..e67e62c34e 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -129,12 +129,7 @@ zend_object *create_wrapped_grpc_server(zend_class_entry *class_type) { * @param array $args The arguments to pass to the server (optional) */ PHP_METHOD(Server, __construct) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_server *server = - (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis()); -#endif zval *args_array = NULL; grpc_channel_args args; @@ -172,14 +167,12 @@ PHP_METHOD(Server, requestCall) { grpc_metadata_array metadata; grpc_event event; + wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis()); #if PHP_MAJOR_VERSION < 7 - wrapped_grpc_server *server = - (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); zval *result; MAKE_STD_ZVAL(result); object_init(result); #else - wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis()); object_init(return_value); #endif @@ -245,14 +238,8 @@ cleanup: */ PHP_METHOD(Server, addHttp2Port) { const char *addr; -#if PHP_MAJOR_VERSION < 7 - int addr_len; - wrapped_grpc_server *server = - (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else - size_t addr_len; + php_grpc_int addr_len; wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis()); -#endif /* "s" == 1 string */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) @@ -266,15 +253,9 @@ PHP_METHOD(Server, addHttp2Port) { PHP_METHOD(Server, addSecureHttp2Port) { const char *addr; + php_grpc_int addr_len; zval *creds_obj; -#if PHP_MAJOR_VERSION < 7 - int addr_len; - wrapped_grpc_server *server = - (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else - size_t addr_len; wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis()); -#endif /* "sO" == 1 string, 1 object */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO", &addr, &addr_len, @@ -285,14 +266,8 @@ PHP_METHOD(Server, addSecureHttp2Port) { "add_http2_port expects a string and a ServerCredentials", 1 TSRMLS_CC); return; } -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_server_credentials *creds = - (wrapped_grpc_server_credentials *)zend_object_store_get_object( - creds_obj TSRMLS_CC); -#else wrapped_grpc_server_credentials *creds = Z_WRAPPED_GRPC_SERVER_CREDS_P(creds_obj); -#endif RETURN_LONG(grpc_server_add_secure_http2_port(server->wrapped, addr, creds->wrapped)); } @@ -302,12 +277,7 @@ PHP_METHOD(Server, addSecureHttp2Port) { * @return Void */ PHP_METHOD(Server, start) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_server *server = - (wrapped_grpc_server *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis()); -#endif grpc_server_start(server->wrapped); } diff --git a/src/php/ext/grpc/server.h b/src/php/ext/grpc/server.h index a7df456a11..603b9a7102 100755 --- a/src/php/ext/grpc/server.h +++ b/src/php/ext/grpc/server.h @@ -56,6 +56,9 @@ typedef struct wrapped_grpc_server { grpc_server *wrapped; } wrapped_grpc_server; +#define Z_WRAPPED_GRPC_SERVER_P(zv) \ + (wrapped_grpc_server *)zend_object_store_get_object(zv TSRMLS_CC) + #else /* Wrapper struct for grpc_server that can be associated with a PHP object */ diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 296632d5bd..e61fc5b4a1 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -144,11 +144,9 @@ PHP_METHOD(ServerCredentials, createSsl) { char *pem_root_certs = 0; grpc_ssl_pem_key_cert_pair pem_key_cert_pair; -#if PHP_MAJOR_VERSION < 7 - int root_certs_length = 0, private_key_length, cert_chain_length; -#else - size_t root_certs_length = 0, private_key_length, cert_chain_length; -#endif + php_grpc_int root_certs_length = 0; + php_grpc_int private_key_length; + php_grpc_int cert_chain_length; /* "s!ss" == 1 nullable string, 2 strings */ /* TODO: support multiple key cert pairs. */ diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h index d37fafc0dc..9df5950fa7 100755 --- a/src/php/ext/grpc/server_credentials.h +++ b/src/php/ext/grpc/server_credentials.h @@ -58,6 +58,9 @@ typedef struct wrapped_grpc_server_credentials { grpc_server_credentials *wrapped; } wrapped_grpc_server_credentials; +#define Z_WRAPPED_GRPC_SERVER_CREDS_P(zv) \ + (wrapped_grpc_server_credentials *)zend_object_store_get_object(zv TSRMLS_CC) + #else typedef struct wrapped_grpc_server_credentials { diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 8dc997c2dd..db0f8a7aaf 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -127,11 +127,10 @@ PHP_METHOD(Timeval, __construct) { #if PHP_MAJOR_VERSION < 7 wrapped_grpc_timeval *timeval = (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); - long microseconds; #else wrapped_grpc_timeval *timeval = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); - zend_long microseconds; #endif + php_grpc_long microseconds; /* "l" == 1 long */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", µseconds) == diff --git a/src/php/ext/grpc/timeval.h b/src/php/ext/grpc/timeval.h index d4eb2facde..d362460c05 100755 --- a/src/php/ext/grpc/timeval.h +++ b/src/php/ext/grpc/timeval.h @@ -57,6 +57,9 @@ typedef struct wrapped_grpc_timeval { gpr_timespec wrapped; } wrapped_grpc_timeval; +#define Z_WRAPPED_GRPC_TIMEVAL_P(zv) \ + (wrapped_grpc_timeval *)zend_object_store_get_object(zv TSRMLS_CC) + #else typedef struct wrapped_grpc_timeval { -- cgit v1.2.3 From 4b9740bfe0946344084a812d34cf2a759fc3dc21 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Fri, 22 Jul 2016 09:20:12 +0800 Subject: use php7_wrapper to reduce dup-codes --- src/php/ext/grpc/call.c | 17 ++--------------- src/php/ext/grpc/timeval.c | 44 ++++---------------------------------------- 2 files changed, 6 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 3f96db7ccb..d455002de6 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -380,8 +380,6 @@ PHP_METHOD(Call, __construct) { */ PHP_METHOD(Call, startBatch) { #if PHP_MAJOR_VERSION < 7 - wrapped_grpc_call *call = - (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); zval **value; zval **inner_value; HashPosition array_pointer; @@ -395,7 +393,6 @@ PHP_METHOD(Call, startBatch) { MAKE_STD_ZVAL(result); object_init(result); #else - wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); zval *value; zval *inner_value; zval *message_value; @@ -405,6 +402,7 @@ PHP_METHOD(Call, startBatch) { zval recv_status; object_init(return_value); #endif + wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); grpc_op ops[8]; size_t op_num = 0; @@ -829,14 +827,8 @@ cleanup: * @return string The URI of the endpoint */ PHP_METHOD(Call, getPeer) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_call *call = - (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); - RETURN_STRING(grpc_call_get_peer(call->wrapped), 1); -#else wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); - RETURN_STRING(grpc_call_get_peer(call->wrapped)); -#endif + PHP_GRPC_RETURN_STRING(grpc_call_get_peer(call->wrapped), 1); } /** @@ -844,12 +836,7 @@ PHP_METHOD(Call, getPeer) { * has not already ended with another status. */ PHP_METHOD(Call, cancel) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_call *call = - (wrapped_grpc_call *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); -#endif grpc_call_cancel(call->wrapped, NULL); } diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index db0f8a7aaf..a3ec62f13f 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -124,12 +124,7 @@ void grpc_php_wrap_timeval(gpr_timespec wrapped, zval *timeval_object) { * @param long $usec The number of microseconds in the interval */ PHP_METHOD(Timeval, __construct) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_timeval *timeval = - (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else wrapped_grpc_timeval *timeval = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); -#endif php_grpc_long microseconds; /* "l" == 1 long */ @@ -159,19 +154,14 @@ PHP_METHOD(Timeval, add) { "add expects a Timeval", 1 TSRMLS_CC); return; } + wrapped_grpc_timeval *self = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); + wrapped_grpc_timeval *other = Z_WRAPPED_GRPC_TIMEVAL_P(other_obj); #if PHP_MAJOR_VERSION < 7 - wrapped_grpc_timeval *self = - (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); - wrapped_grpc_timeval *other = - (wrapped_grpc_timeval *)zend_object_store_get_object(other_obj TSRMLS_CC); zval *sum = grpc_php_wrap_timeval(gpr_time_add(self->wrapped, other->wrapped) TSRMLS_CC); RETURN_DESTROY_ZVAL(sum); #else - wrapped_grpc_timeval *self = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); - wrapped_grpc_timeval *other = Z_WRAPPED_GRPC_TIMEVAL_P(other_obj); - grpc_php_wrap_timeval(gpr_time_add(self->wrapped, other->wrapped), return_value); RETURN_DESTROY_ZVAL(return_value); @@ -194,18 +184,14 @@ PHP_METHOD(Timeval, subtract) { "subtract expects a Timeval", 1 TSRMLS_CC); return; } + wrapped_grpc_timeval *self = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); + wrapped_grpc_timeval *other = Z_WRAPPED_GRPC_TIMEVAL_P(other_obj); #if PHP_MAJOR_VERSION < 7 - wrapped_grpc_timeval *self = - (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); - wrapped_grpc_timeval *other = - (wrapped_grpc_timeval *)zend_object_store_get_object(other_obj TSRMLS_CC); zval *diff = grpc_php_wrap_timeval(gpr_time_sub(self->wrapped, other->wrapped) TSRMLS_CC); RETURN_DESTROY_ZVAL(diff); #else - wrapped_grpc_timeval *self = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); - wrapped_grpc_timeval *other = Z_WRAPPED_GRPC_TIMEVAL_P(other_obj); grpc_php_wrap_timeval(gpr_time_sub(self->wrapped, other->wrapped), return_value); RETURN_DESTROY_ZVAL(return_value); @@ -231,15 +217,8 @@ PHP_METHOD(Timeval, compare) { "compare expects two Timevals", 1 TSRMLS_CC); return; } -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_timeval *a = - (wrapped_grpc_timeval *)zend_object_store_get_object(a_obj TSRMLS_CC); - wrapped_grpc_timeval *b = - (wrapped_grpc_timeval *)zend_object_store_get_object(b_obj TSRMLS_CC); -#else wrapped_grpc_timeval *a = Z_WRAPPED_GRPC_TIMEVAL_P(a_obj); wrapped_grpc_timeval *b = Z_WRAPPED_GRPC_TIMEVAL_P(b_obj); -#endif long result = gpr_time_cmp(a->wrapped, b->wrapped); RETURN_LONG(result); } @@ -264,19 +243,9 @@ PHP_METHOD(Timeval, similar) { "compare expects three Timevals", 1 TSRMLS_CC); return; } -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_timeval *a = - (wrapped_grpc_timeval *)zend_object_store_get_object(a_obj TSRMLS_CC); - wrapped_grpc_timeval *b = - (wrapped_grpc_timeval *)zend_object_store_get_object(b_obj TSRMLS_CC); - wrapped_grpc_timeval *thresh = - (wrapped_grpc_timeval *)zend_object_store_get_object( - thresh_obj TSRMLS_CC); -#else wrapped_grpc_timeval *a = Z_WRAPPED_GRPC_TIMEVAL_P(a_obj); wrapped_grpc_timeval *b = Z_WRAPPED_GRPC_TIMEVAL_P(b_obj); wrapped_grpc_timeval *thresh = Z_WRAPPED_GRPC_TIMEVAL_P(thresh_obj); -#endif int result = gpr_time_similar(a->wrapped, b->wrapped, thresh->wrapped); RETURN_BOOL(result); } @@ -349,12 +318,7 @@ PHP_METHOD(Timeval, infPast) { * @return void */ PHP_METHOD(Timeval, sleepUntil) { -#if PHP_MAJOR_VERSION < 7 - wrapped_grpc_timeval *this = - (wrapped_grpc_timeval *)zend_object_store_get_object(getThis() TSRMLS_CC); -#else wrapped_grpc_timeval *this = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); -#endif gpr_sleep_until(this->wrapped); } -- cgit v1.2.3 From 440558a7ec9c78a3aad3203663c2d64d026deb68 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 21 Jul 2016 19:31:38 -0700 Subject: C++ Compression Level set properly --- include/grpc++/impl/codegen/async_stream.h | 27 ++ include/grpc++/impl/codegen/async_unary_call.h | 9 + include/grpc++/impl/codegen/call.h | 12 +- include/grpc++/impl/codegen/impl/async_stream.h | 486 ---------------------- include/grpc++/impl/codegen/method_handler_impl.h | 15 + include/grpc++/impl/codegen/server_context.h | 9 +- include/grpc++/impl/codegen/sync_stream.h | 15 + src/cpp/server/server_context.cc | 12 +- 8 files changed, 85 insertions(+), 500 deletions(-) delete mode 100644 include/grpc++/impl/codegen/impl/async_stream.h (limited to 'src') diff --git a/include/grpc++/impl/codegen/async_stream.h b/include/grpc++/impl/codegen/async_stream.h index e96d224ddb..70533aa4d9 100644 --- a/include/grpc++/impl/codegen/async_stream.h +++ b/include/grpc++/impl/codegen/async_stream.h @@ -330,6 +330,9 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface { meta_ops_.set_output_tag(tag); meta_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_.PerformOps(&meta_ops_); } @@ -345,6 +348,9 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface { if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } // The response is dropped if the status is not OK. @@ -363,6 +369,9 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface { if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); @@ -400,6 +409,9 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface { meta_ops_.set_output_tag(tag); meta_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_.PerformOps(&meta_ops_); } @@ -409,6 +421,9 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface { if (!ctx_->sent_initial_metadata_) { write_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + write_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } // TODO(ctiller): don't assert @@ -421,6 +436,9 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface { if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); @@ -459,6 +477,9 @@ class ServerAsyncReaderWriter GRPC_FINAL meta_ops_.set_output_tag(tag); meta_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_.PerformOps(&meta_ops_); } @@ -474,6 +495,9 @@ class ServerAsyncReaderWriter GRPC_FINAL if (!ctx_->sent_initial_metadata_) { write_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + write_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } // TODO(ctiller): don't assert @@ -486,6 +510,9 @@ class ServerAsyncReaderWriter GRPC_FINAL if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); diff --git a/include/grpc++/impl/codegen/async_unary_call.h b/include/grpc++/impl/codegen/async_unary_call.h index 05681e2242..5ceab73cea 100644 --- a/include/grpc++/impl/codegen/async_unary_call.h +++ b/include/grpc++/impl/codegen/async_unary_call.h @@ -126,6 +126,9 @@ class ServerAsyncResponseWriter GRPC_FINAL meta_buf_.set_output_tag(tag); meta_buf_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_buf_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_.PerformOps(&meta_buf_); } @@ -135,6 +138,9 @@ class ServerAsyncResponseWriter GRPC_FINAL if (!ctx_->sent_initial_metadata_) { finish_buf_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } // The response is dropped if the status is not OK. @@ -153,6 +159,9 @@ class ServerAsyncResponseWriter GRPC_FINAL if (!ctx_->sent_initial_metadata_) { finish_buf_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } finish_buf_.ServerSendStatus(ctx_->trailing_metadata_, status); diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index fab85d1517..dfac177970 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -180,17 +180,23 @@ class CallNoOp { class CallOpSendInitialMetadata { public: - CallOpSendInitialMetadata() : send_(false) {} + CallOpSendInitialMetadata() : send_(false) { + maybe_compression_level_.is_set = false; + } void SendInitialMetadata( const std::multimap& metadata, uint32_t flags) { + maybe_compression_level_.is_set = false; send_ = true; flags_ = flags; initial_metadata_count_ = metadata.size(); initial_metadata_ = FillMetadataArray(metadata); - // TODO(dgq): expose compression level in API so it can be properly set. - maybe_compression_level_.is_set = false; + } + + void set_compression_level(grpc_compression_level level) { + maybe_compression_level_.is_set = true; + maybe_compression_level_.level = level; } protected: diff --git a/include/grpc++/impl/codegen/impl/async_stream.h b/include/grpc++/impl/codegen/impl/async_stream.h deleted file mode 100644 index 7d7a956807..0000000000 --- a/include/grpc++/impl/codegen/impl/async_stream.h +++ /dev/null @@ -1,486 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef GRPCXX_IMPL_CODEGEN_IMPL_ASYNC_STREAM_H -#define GRPCXX_IMPL_CODEGEN_IMPL_ASYNC_STREAM_H - -#include -#include -#include -#include -#include -#include - -namespace grpc { - -class CompletionQueue; - -/// Common interface for all client side asynchronous streaming. -class ClientAsyncStreamingInterface { - public: - virtual ~ClientAsyncStreamingInterface() {} - - /// Request notification of the reading of the initial metadata. Completion - /// will be notified by \a tag on the associated completion queue. - /// - /// \param[in] tag Tag identifying this request. - virtual void ReadInitialMetadata(void* tag) = 0; - - /// Request notification completion. - /// - /// \param[out] status To be updated with the operation status. - /// \param[in] tag Tag identifying this request. - virtual void Finish(Status* status, void* tag) = 0; -}; - -/// An interface that yields a sequence of messages of type \a R. -template -class AsyncReaderInterface { - public: - virtual ~AsyncReaderInterface() {} - - /// Read a message of type \a R into \a msg. Completion will be notified by \a - /// tag on the associated completion queue. - /// - /// \param[out] msg Where to eventually store the read message. - /// \param[in] tag The tag identifying the operation. - virtual void Read(R* msg, void* tag) = 0; -}; - -/// An interface that can be fed a sequence of messages of type \a W. -template -class AsyncWriterInterface { - public: - virtual ~AsyncWriterInterface() {} - - /// Request the writing of \a msg with identifying tag \a tag. - /// - /// Only one write may be outstanding at any given time. This means that - /// after calling Write, one must wait to receive \a tag from the completion - /// queue BEFORE calling Write again. - /// - /// \param[in] msg The message to be written. - /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, void* tag) = 0; -}; - -template -class ClientAsyncReaderInterface : public ClientAsyncStreamingInterface, - public AsyncReaderInterface {}; - -template -class ClientAsyncReader GRPC_FINAL : public ClientAsyncReaderInterface { - public: - /// Create a stream and write the first request out. - template - ClientAsyncReader(ChannelInterface* channel, CompletionQueue* cq, - const RpcMethod& method, ClientContext* context, - const W& request, void* tag) - : context_(context), call_(channel->CreateCall(method, context, cq)) { - init_ops_.set_output_tag(tag); - init_ops_.SendInitialMetadata(context->send_initial_metadata_); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); - init_ops_.ClientSendClose(); - call_.PerformOps(&init_ops_); - } - - void ReadInitialMetadata(void* tag) GRPC_OVERRIDE { - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) GRPC_OVERRIDE { - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Finish(Status* status, void* tag) GRPC_OVERRIDE { - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - ClientContext* context_; - Call call_; - CallOpSet - init_ops_; - CallOpSet meta_ops_; - CallOpSet> read_ops_; - CallOpSet finish_ops_; -}; - -/// Common interface for client side asynchronous writing. -template -class ClientAsyncWriterInterface : public ClientAsyncStreamingInterface, - public AsyncWriterInterface { - public: - /// Signal the client is done with the writes. - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -template -class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface { - public: - template - ClientAsyncWriter(ChannelInterface* channel, CompletionQueue* cq, - const RpcMethod& method, ClientContext* context, - R* response, void* tag) - : context_(context), call_(channel->CreateCall(method, context, cq)) { - finish_ops_.RecvMessage(response); - - init_ops_.set_output_tag(tag); - init_ops_.SendInitialMetadata(context->send_initial_metadata_); - call_.PerformOps(&init_ops_); - } - - void ReadInitialMetadata(void* tag) GRPC_OVERRIDE { - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) GRPC_OVERRIDE { - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) GRPC_OVERRIDE { - writes_done_ops_.set_output_tag(tag); - writes_done_ops_.ClientSendClose(); - call_.PerformOps(&writes_done_ops_); - } - - void Finish(Status* status, void* tag) GRPC_OVERRIDE { - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - ClientContext* context_; - Call call_; - CallOpSet init_ops_; - CallOpSet meta_ops_; - CallOpSet write_ops_; - CallOpSet writes_done_ops_; - CallOpSet - finish_ops_; -}; - -/// Client-side interface for asynchronous bi-directional streaming. -template -class ClientAsyncReaderWriterInterface : public ClientAsyncStreamingInterface, - public AsyncWriterInterface, - public AsyncReaderInterface { - public: - /// Signal the client is done with the writes. - /// - /// \param[in] tag The tag identifying the operation. - virtual void WritesDone(void* tag) = 0; -}; - -template -class ClientAsyncReaderWriter GRPC_FINAL - : public ClientAsyncReaderWriterInterface { - public: - ClientAsyncReaderWriter(ChannelInterface* channel, CompletionQueue* cq, - const RpcMethod& method, ClientContext* context, - void* tag) - : context_(context), call_(channel->CreateCall(method, context, cq)) { - init_ops_.set_output_tag(tag); - init_ops_.SendInitialMetadata(context->send_initial_metadata_); - call_.PerformOps(&init_ops_); - } - - void ReadInitialMetadata(void* tag) GRPC_OVERRIDE { - GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - - meta_ops_.set_output_tag(tag); - meta_ops_.RecvInitialMetadata(context_); - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) GRPC_OVERRIDE { - read_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - read_ops_.RecvInitialMetadata(context_); - } - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) GRPC_OVERRIDE { - write_ops_.set_output_tag(tag); - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void WritesDone(void* tag) GRPC_OVERRIDE { - writes_done_ops_.set_output_tag(tag); - writes_done_ops_.ClientSendClose(); - call_.PerformOps(&writes_done_ops_); - } - - void Finish(Status* status, void* tag) GRPC_OVERRIDE { - finish_ops_.set_output_tag(tag); - if (!context_->initial_metadata_received_) { - finish_ops_.RecvInitialMetadata(context_); - } - finish_ops_.ClientRecvStatus(context_, status); - call_.PerformOps(&finish_ops_); - } - - private: - ClientContext* context_; - Call call_; - CallOpSet init_ops_; - CallOpSet meta_ops_; - CallOpSet> read_ops_; - CallOpSet write_ops_; - CallOpSet writes_done_ops_; - CallOpSet finish_ops_; -}; - -template -class ServerAsyncReaderInterface : public ServerAsyncStreamingInterface, - public AsyncReaderInterface { - public: - virtual void Finish(const W& msg, const Status& status, void* tag) = 0; - - virtual void FinishWithError(const Status& status, void* tag) = 0; -}; - -template -class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface { - public: - explicit ServerAsyncReader(ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - void SendInitialMetadata(void* tag) GRPC_OVERRIDE { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) GRPC_OVERRIDE { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Finish(const W& msg, const Status& status, void* tag) GRPC_OVERRIDE { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - } - // The response is dropped if the status is not OK. - if (status.ok()) { - finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, - finish_ops_.SendMessage(msg)); - } else { - finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); - } - call_.PerformOps(&finish_ops_); - } - - void FinishWithError(const Status& status, void* tag) GRPC_OVERRIDE { - GPR_CODEGEN_ASSERT(!status.ok()); - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; } - - Call call_; - ServerContext* ctx_; - CallOpSet meta_ops_; - CallOpSet> read_ops_; - CallOpSet - finish_ops_; -}; - -template -class ServerAsyncWriterInterface : public ServerAsyncStreamingInterface, - public AsyncWriterInterface { - public: - virtual void Finish(const Status& status, void* tag) = 0; -}; - -template -class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface { - public: - explicit ServerAsyncWriter(ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - void SendInitialMetadata(void* tag) GRPC_OVERRIDE { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Write(const W& msg, void* tag) GRPC_OVERRIDE { - write_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - write_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Finish(const Status& status, void* tag) GRPC_OVERRIDE { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; } - - Call call_; - ServerContext* ctx_; - CallOpSet meta_ops_; - CallOpSet write_ops_; - CallOpSet finish_ops_; -}; - -/// Server-side interface for asynchronous bi-directional streaming. -template -class ServerAsyncReaderWriterInterface : public ServerAsyncStreamingInterface, - public AsyncWriterInterface, - public AsyncReaderInterface { - public: - virtual void Finish(const Status& status, void* tag) = 0; -}; - -template -class ServerAsyncReaderWriter GRPC_FINAL - : public ServerAsyncReaderWriterInterface { - public: - explicit ServerAsyncReaderWriter(ServerContext* ctx) - : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} - - void SendInitialMetadata(void* tag) GRPC_OVERRIDE { - GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - - meta_ops_.set_output_tag(tag); - meta_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - call_.PerformOps(&meta_ops_); - } - - void Read(R* msg, void* tag) GRPC_OVERRIDE { - read_ops_.set_output_tag(tag); - read_ops_.RecvMessage(msg); - call_.PerformOps(&read_ops_); - } - - void Write(const W& msg, void* tag) GRPC_OVERRIDE { - write_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - write_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - } - // TODO(ctiller): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); - call_.PerformOps(&write_ops_); - } - - void Finish(const Status& status, void* tag) GRPC_OVERRIDE { - finish_ops_.set_output_tag(tag); - if (!ctx_->sent_initial_metadata_) { - finish_ops_.SendInitialMetadata(ctx_->initial_metadata_); - ctx_->sent_initial_metadata_ = true; - } - finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); - call_.PerformOps(&finish_ops_); - } - - private: - friend class ::grpc::Server; - - void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; } - - Call call_; - ServerContext* ctx_; - CallOpSet meta_ops_; - CallOpSet> read_ops_; - CallOpSet write_ops_; - CallOpSet finish_ops_; -}; - -} // namespace grpc - -#endif // GRPCXX_IMPL_CODEGEN_IMPL_ASYNC_STREAM_H diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h index 21ac6c4fb5..2f4be644ba 100644 --- a/include/grpc++/impl/codegen/method_handler_impl.h +++ b/include/grpc++/impl/codegen/method_handler_impl.h @@ -65,6 +65,9 @@ class RpcMethodHandler : public MethodHandler { ops; ops.SendInitialMetadata(param.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); + if (param.server_context->compression_level_set()) { + ops.set_compression_level(param.server_context->compression_level()); + } if (status.ok()) { status = ops.SendMessage(rsp); } @@ -104,6 +107,9 @@ class ClientStreamingHandler : public MethodHandler { ops; ops.SendInitialMetadata(param.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); + if (param.server_context->compression_level_set()) { + ops.set_compression_level(param.server_context->compression_level()); + } if (status.ok()) { status = ops.SendMessage(rsp); } @@ -144,6 +150,9 @@ class ServerStreamingHandler : public MethodHandler { if (!param.server_context->sent_initial_metadata_) { ops.SendInitialMetadata(param.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); + if (param.server_context->compression_level_set()) { + ops.set_compression_level(param.server_context->compression_level()); + } } ops.ServerSendStatus(param.server_context->trailing_metadata_, status); param.call->PerformOps(&ops); @@ -177,6 +186,9 @@ class BidiStreamingHandler : public MethodHandler { if (!param.server_context->sent_initial_metadata_) { ops.SendInitialMetadata(param.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); + if (param.server_context->compression_level_set()) { + ops.set_compression_level(param.server_context->compression_level()); + } } ops.ServerSendStatus(param.server_context->trailing_metadata_, status); param.call->PerformOps(&ops); @@ -199,6 +211,9 @@ class UnknownMethodHandler : public MethodHandler { if (!context->sent_initial_metadata_) { ops->SendInitialMetadata(context->initial_metadata_, context->initial_metadata_flags()); + if (context->compression_level_set()) { + ops->set_compression_level(context->compression_level()); + } context->sent_initial_metadata_ = true; } ops->ServerSendStatus(context->trailing_metadata_, status); diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h index cea13a513f..08212af861 100644 --- a/include/grpc++/impl/codegen/server_context.h +++ b/include/grpc++/impl/codegen/server_context.h @@ -130,7 +130,13 @@ class ServerContext { grpc_compression_level compression_level() const { return compression_level_; } - void set_compression_level(grpc_compression_level level); + + void set_compression_level(grpc_compression_level level) { + compression_level_set_ = true; + compression_level_ = level; + } + + bool compression_level_set() const { return compression_level_set_; } grpc_compression_algorithm compression_algorithm() const { return compression_algorithm_; @@ -217,6 +223,7 @@ class ServerContext { std::multimap initial_metadata_; std::multimap trailing_metadata_; + bool compression_level_set_; grpc_compression_level compression_level_; grpc_compression_algorithm compression_algorithm_; }; diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index cbfa410699..b2b972760d 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -347,6 +347,9 @@ class ServerReader GRPC_FINAL : public ReaderInterface { CallOpSet ops; ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_->PerformOps(&ops); call_->cq()->Pluck(&ops); @@ -375,6 +378,9 @@ class ServerWriter GRPC_FINAL : public WriterInterface { CallOpSet ops; ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_->PerformOps(&ops); call_->cq()->Pluck(&ops); @@ -389,6 +395,9 @@ class ServerWriter GRPC_FINAL : public WriterInterface { if (!ctx_->sent_initial_metadata_) { ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } call_->PerformOps(&ops); @@ -413,6 +422,9 @@ class ServerReaderWriter GRPC_FINAL : public WriterInterface, CallOpSet ops; ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_->PerformOps(&ops); call_->cq()->Pluck(&ops); @@ -434,6 +446,9 @@ class ServerReaderWriter GRPC_FINAL : public WriterInterface, if (!ctx_->sent_initial_metadata_) { ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } call_->PerformOps(&ops); diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 43117fd1e9..b15e31585b 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -129,7 +129,8 @@ ServerContext::ServerContext() deadline_(gpr_inf_future(GPR_CLOCK_REALTIME)), call_(nullptr), cq_(nullptr), - sent_initial_metadata_(false) {} + sent_initial_metadata_(false), + compression_level_set_(false) {} ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata, size_t metadata_count) @@ -194,15 +195,6 @@ bool ServerContext::IsCancelled() const { } } -void ServerContext::set_compression_level(grpc_compression_level level) { - // TODO(dgq): get rid of grpc_call_compression_for_level and propagate the - // compression level by adding a new argument to - // CallOpSendInitialMetadata::SendInitialMetadata. - const grpc_compression_algorithm algorithm_for_level = - grpc_call_compression_for_level(call_, level); - set_compression_algorithm(algorithm_for_level); -} - void ServerContext::set_compression_algorithm( grpc_compression_algorithm algorithm) { char* algorithm_name = NULL; -- cgit v1.2.3 From 3922838613d5e99cb04eda91750d640320cd8a5e Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 22 Jul 2016 13:13:31 -0700 Subject: Added missing var initialization --- src/cpp/server/server_context.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index b15e31585b..1ca6a2b906 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -140,7 +140,8 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata, deadline_(deadline), call_(nullptr), cq_(nullptr), - sent_initial_metadata_(false) { + sent_initial_metadata_(false), + compression_level_set_(false) { for (size_t i = 0; i < metadata_count; i++) { client_metadata_.insert(std::pair( metadata[i].key, -- cgit v1.2.3 From a3fd28007feaa62e8f9adbdd1bdda8708f598854 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 22 Jul 2016 14:21:54 -0700 Subject: regenerated projects --- grpc.def | 1 + src/ruby/ext/grpc/rb_grpc_imports.generated.c | 2 ++ src/ruby/ext/grpc/rb_grpc_imports.generated.h | 3 +++ 3 files changed, 6 insertions(+) (limited to 'src') diff --git a/grpc.def b/grpc.def index 0849f84e0b..c2f83f577f 100644 --- a/grpc.def +++ b/grpc.def @@ -148,6 +148,7 @@ EXPORTS gpr_slice_ref gpr_slice_unref gpr_slice_new + gpr_slice_new_with_user_data gpr_slice_new_with_len gpr_slice_malloc gpr_slice_from_copied_string diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c index 9748cb576b..d7f862cd9c 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c @@ -186,6 +186,7 @@ gpr_set_log_function_type gpr_set_log_function_import; gpr_slice_ref_type gpr_slice_ref_import; gpr_slice_unref_type gpr_slice_unref_import; gpr_slice_new_type gpr_slice_new_import; +gpr_slice_new_with_user_data_type gpr_slice_new_with_user_data_import; gpr_slice_new_with_len_type gpr_slice_new_with_len_import; gpr_slice_malloc_type gpr_slice_malloc_import; gpr_slice_from_copied_string_type gpr_slice_from_copied_string_import; @@ -458,6 +459,7 @@ void grpc_rb_load_imports(HMODULE library) { gpr_slice_ref_import = (gpr_slice_ref_type) GetProcAddress(library, "gpr_slice_ref"); gpr_slice_unref_import = (gpr_slice_unref_type) GetProcAddress(library, "gpr_slice_unref"); gpr_slice_new_import = (gpr_slice_new_type) GetProcAddress(library, "gpr_slice_new"); + gpr_slice_new_with_user_data_import = (gpr_slice_new_with_user_data_type) GetProcAddress(library, "gpr_slice_new_with_user_data"); gpr_slice_new_with_len_import = (gpr_slice_new_with_len_type) GetProcAddress(library, "gpr_slice_new_with_len"); gpr_slice_malloc_import = (gpr_slice_malloc_type) GetProcAddress(library, "gpr_slice_malloc"); gpr_slice_from_copied_string_import = (gpr_slice_from_copied_string_type) GetProcAddress(library, "gpr_slice_from_copied_string"); diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h index 6f0974e31b..14da63780c 100644 --- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h +++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h @@ -509,6 +509,9 @@ extern gpr_slice_unref_type gpr_slice_unref_import; typedef gpr_slice(*gpr_slice_new_type)(void *p, size_t len, void (*destroy)(void *)); extern gpr_slice_new_type gpr_slice_new_import; #define gpr_slice_new gpr_slice_new_import +typedef gpr_slice(*gpr_slice_new_with_user_data_type)(void *p, size_t len, void (*destroy)(void *), void *user_data); +extern gpr_slice_new_with_user_data_type gpr_slice_new_with_user_data_import; +#define gpr_slice_new_with_user_data gpr_slice_new_with_user_data_import typedef gpr_slice(*gpr_slice_new_with_len_type)(void *p, size_t len, void (*destroy)(void *, size_t)); extern gpr_slice_new_with_len_type gpr_slice_new_with_len_import; #define gpr_slice_new_with_len gpr_slice_new_with_len_import -- cgit v1.2.3 From d8f77f63dc287df7403ed784e7b1ef522bb72180 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Mon, 25 Jul 2016 15:27:18 -0700 Subject: update copyright --- src/php/ext/grpc/php7_wrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 98b2aaeef5..e4d0d4c90b 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without -- cgit v1.2.3 From 6d62ada98390f0fbf545f17cfbab8a7baa0ceaf2 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Wed, 27 Jul 2016 03:47:44 +0800 Subject: add macro to php7_wrapper for reduce duplicate code --- src/php/ext/grpc/call.c | 259 ++++++++++++++------------------- src/php/ext/grpc/call.h | 30 +--- src/php/ext/grpc/call_credentials.c | 73 +++------- src/php/ext/grpc/call_credentials.h | 19 +-- src/php/ext/grpc/channel.c | 84 ++++++----- src/php/ext/grpc/channel.h | 17 +-- src/php/ext/grpc/channel_credentials.c | 53 ++----- src/php/ext/grpc/channel_credentials.h | 18 +-- src/php/ext/grpc/php7_wrapper.h | 32 ++++ src/php/ext/grpc/server.c | 38 ++--- src/php/ext/grpc/server.h | 17 +-- src/php/ext/grpc/server_credentials.c | 32 ++-- src/php/ext/grpc/server_credentials.h | 19 +-- src/php/ext/grpc/timeval.c | 78 +++------- src/php/ext/grpc/timeval.h | 20 +-- 15 files changed, 304 insertions(+), 485 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index d455002de6..fc832dacc2 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -90,34 +90,54 @@ zend_object_value create_wrapped_grpc_call(zend_class_entry *class_type return retval; } -/* Wraps a grpc_call struct in a PHP object. Owned indicates whether the struct - should be destroyed at the end of the object's lifecycle */ -zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned TSRMLS_DC) { - zval *call_object; - MAKE_STD_ZVAL(call_object); - object_init_ex(call_object, grpc_ce_call); - wrapped_grpc_call *call = - (wrapped_grpc_call *)zend_object_store_get_object(call_object TSRMLS_CC); - call->wrapped = wrapped; - call->owned = owned; - return call_object; +#else + +static zend_object_handlers call_ce_handlers; + +/* Frees and destroys an instance of wrapped_grpc_call */ +static void free_wrapped_grpc_call(zend_object *object) { + wrapped_grpc_call *call = wrapped_grpc_call_from_obj(object); + if (call->owned && call->wrapped != NULL) { + grpc_call_destroy(call->wrapped); + } + zend_object_std_dtor(&call->std); +} + +/* Initializes an instance of wrapped_grpc_call to be associated with an + * object of a class specified by class_type */ +zend_object *create_wrapped_grpc_call(zend_class_entry *class_type) { + wrapped_grpc_call *intern; + intern = ecalloc(1, sizeof(wrapped_grpc_call) + + zend_object_properties_size(class_type)); + zend_object_std_init(&intern->std, class_type); + object_properties_init(&intern->std, class_type); + intern->std.handlers = &call_ce_handlers; + return &intern->std; } +#endif + /* Creates and returns a PHP array object with the data in a * grpc_metadata_array. Returns NULL on failure */ -zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array TSRMLS_DC) { +zval *grpc_parse_metadata_array(grpc_metadata_array + *metadata_array TSRMLS_DC) { int count = metadata_array->count; grpc_metadata *elements = metadata_array->metadata; - int i; zval *array; - zval **data = NULL; + PHP_GRPC_MAKE_STD_ZVAL(array); + array_init(array); + int i; HashTable *array_hash; zval *inner_array; char *str_key; char *str_val; size_t key_len; - MAKE_STD_ZVAL(array); - array_init(array); +#if PHP_MAJOR_VERSION < 7 + zval **data = NULL; +#else + zval *data; +#endif + array_hash = Z_ARRVAL_P(array); grpc_metadata *elem; for (i = 0; i < count; i++) { @@ -127,9 +147,14 @@ zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array TSRMLS_DC) { memcpy(str_key, elem->key, key_len); str_val = ecalloc(elem->value_length + 1, sizeof(char)); memcpy(str_val, elem->value, elem->value_length); +#if PHP_MAJOR_VERSION < 7 if (zend_hash_find(array_hash, str_key, key_len, (void **)data) == SUCCESS) { if (Z_TYPE_P(*data) != IS_ARRAY) { +#else + if ((data = zend_hash_str_find(array_hash, str_key, key_len)) != NULL) { + if (Z_TYPE_P(data) != IS_ARRAY) { +#endif zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Metadata hash somehow contains wrong types.", 1 TSRMLS_CC); @@ -137,11 +162,18 @@ zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array TSRMLS_DC) { efree(str_val); return NULL; } - add_next_index_stringl(*data, str_val, elem->value_length, false); +#if PHP_MAJOR_VERSION < 7 + php_grpc_add_next_index_stringl(*data, str_val, elem->value_length, + false); +#else + php_grpc_add_next_index_stringl(data, str_val, elem->value_length, + false); +#endif } else { - MAKE_STD_ZVAL(inner_array); + PHP_GRPC_MAKE_STD_ZVAL(inner_array); array_init(inner_array); - add_next_index_stringl(inner_array, str_val, elem->value_length, false); + php_grpc_add_next_index_stringl(inner_array, str_val, + elem->value_length, false); add_assoc_zval(array, str_key, inner_array); } } @@ -151,20 +183,27 @@ zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array TSRMLS_DC) { /* Populates a grpc_metadata_array with the data in a PHP array object. Returns true on success and false on failure */ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { + HashTable *array_hash; + HashTable *inner_array_hash; +#if PHP_MAJOR_VERSION < 7 zval **inner_array; zval **value; - HashTable *array_hash; HashPosition array_pointer; - HashTable *inner_array_hash; HashPosition inner_array_pointer; char *key; uint key_len; ulong index; +#else + zval *inner_array; + zval *value; + zend_string *key; +#endif if (Z_TYPE_P(array) != IS_ARRAY) { return false; } grpc_metadata_array_init(metadata); array_hash = Z_ARRVAL_P(array); +#if PHP_MAJOR_VERSION < 7 for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); zend_hash_get_current_data_ex(array_hash, (void**)&inner_array, &array_pointer) == SUCCESS; @@ -179,7 +218,22 @@ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { inner_array_hash = Z_ARRVAL_P(*inner_array); metadata->capacity += zend_hash_num_elements(inner_array_hash); } +#else + ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, inner_array) { + if (key == NULL) { + return false; + } + if (Z_TYPE_P(inner_array) != IS_ARRAY) { + return false; + } + inner_array_hash = HASH_OF(inner_array); + metadata->capacity += zend_hash_num_elements(inner_array_hash); + } ZEND_HASH_FOREACH_END(); +#endif + metadata->metadata = gpr_malloc(metadata->capacity * sizeof(grpc_metadata)); + +#if PHP_MAJOR_VERSION < 7 for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); zend_hash_get_current_data_ex(array_hash, (void**)&inner_array, &array_pointer) == SUCCESS; @@ -203,113 +257,7 @@ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { metadata->count += 1; } } - return true; -} - #else - -static zend_object_handlers call_ce_handlers; - -/* Frees and destroys an instance of wrapped_grpc_call */ -static void free_wrapped_grpc_call(zend_object *object) { - wrapped_grpc_call *call = wrapped_grpc_call_from_obj(object); - if (call->owned && call->wrapped != NULL) { - grpc_call_destroy(call->wrapped); - } - zend_object_std_dtor(&call->std); -} - -/* Initializes an instance of wrapped_grpc_call to be associated with an - * object of a class specified by class_type */ -zend_object *create_wrapped_grpc_call(zend_class_entry *class_type) { - wrapped_grpc_call *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_call) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); - intern->std.handlers = &call_ce_handlers; - return &intern->std; -} - -/* Wraps a grpc_call struct in a PHP object. Owned indicates whether the - struct should be destroyed at the end of the object's lifecycle */ -void grpc_php_wrap_call(grpc_call *wrapped, bool owned, zval *call_object) { - object_init_ex(call_object, grpc_ce_call); - wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(call_object); - call->wrapped = wrapped; - call->owned = owned; -} - -/* Creates and returns a PHP array object with the data in a - * grpc_metadata_array. Returns NULL on failure */ -void grpc_parse_metadata_array(grpc_metadata_array *metadata_array, - zval *array) { - int count = metadata_array->count; - grpc_metadata *elements = metadata_array->metadata; - int i; - zval *data; - HashTable *array_hash; - zval inner_array; - char *str_key; - char *str_val; - size_t key_len; - - array_init(array); - array_hash = HASH_OF(array); - grpc_metadata *elem; - for (i = 0; i < count; i++) { - elem = &elements[i]; - key_len = strlen(elem->key); - str_key = ecalloc(key_len + 1, sizeof(char)); - memcpy(str_key, elem->key, key_len); - str_val = ecalloc(elem->value_length + 1, sizeof(char)); - memcpy(str_val, elem->value, elem->value_length); - if ((data = zend_hash_str_find(array_hash, str_key, key_len)) != NULL) { - if (Z_TYPE_P(data) != IS_ARRAY) { - zend_throw_exception(zend_exception_get_default(), - "Metadata hash somehow contains wrong types.", - 1); - efree(str_key); - efree(str_val); - return; - } - add_next_index_stringl(data, str_val, elem->value_length); - } else { - array_init(&inner_array); - add_next_index_stringl(&inner_array, str_val, elem->value_length); - add_assoc_zval(array, str_key, &inner_array); - } - } -} - -/* Populates a grpc_metadata_array with the data in a PHP array object. - Returns true on success and false on failure */ -bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { - zval *inner_array; - zval *value; - HashTable *array_hash; - HashTable *inner_array_hash; - zend_string *key; - if (Z_TYPE_P(array) != IS_ARRAY) { - return false; - } - grpc_metadata_array_init(metadata); - array_hash = HASH_OF(array); - - ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, inner_array) { - if (key == NULL) { - return false; - } - if (Z_TYPE_P(inner_array) != IS_ARRAY) { - return false; - } - inner_array_hash = HASH_OF(inner_array); - metadata->capacity += zend_hash_num_elements(inner_array_hash); - } - ZEND_HASH_FOREACH_END(); - - metadata->metadata = gpr_malloc(metadata->capacity * sizeof(grpc_metadata)); - ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, inner_array) { if (key == NULL) { return false; @@ -326,10 +274,21 @@ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { metadata->count += 1; } ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END(); +#endif return true; } -#endif +/* Wraps a grpc_call struct in a PHP object. Owned indicates whether the + struct should be destroyed at the end of the object's lifecycle */ +zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned TSRMLS_DC) { + zval *call_object; + PHP_GRPC_MAKE_STD_ZVAL(call_object); + object_init_ex(call_object, grpc_ce_call); + wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(call_object); + call->wrapped = wrapped; + call->owned = owned; + return call_object; +} /** * Constructs a new instance of the Call class. @@ -379,6 +338,10 @@ PHP_METHOD(Call, __construct) { * @return object Object with results of all actions */ PHP_METHOD(Call, startBatch) { + zval *result; + PHP_GRPC_MAKE_STD_ZVAL(result); + object_init(result); + php_grpc_ulong index; #if PHP_MAJOR_VERSION < 7 zval **value; zval **inner_value; @@ -387,20 +350,14 @@ PHP_METHOD(Call, startBatch) { zval **message_flags; char *key; uint key_len; - ulong index; - zval *result; zval *recv_status; - MAKE_STD_ZVAL(result); - object_init(result); #else zval *value; zval *inner_value; zval *message_value; zval *message_flags; zend_string *key; - zend_ulong index; zval recv_status; - object_init(return_value); #endif wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); @@ -574,7 +531,7 @@ PHP_METHOD(Call, startBatch) { #else -array_hash = HASH_OF(array); + array_hash = HASH_OF(array); ZEND_HASH_FOREACH_KEY_VAL(array_hash, index, key, value) { if (key) { zend_throw_exception(spl_ce_InvalidArgumentException, @@ -692,8 +649,7 @@ array_hash = HASH_OF(array); ops[op_num].flags = 0; ops[op_num].reserved = NULL; op_num++; - } - ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FOREACH_END(); #endif @@ -755,43 +711,44 @@ array_hash = HASH_OF(array); } } #else + zval recv_md; for (int i = 0; i < op_num; i++) { switch(ops[i].op) { case GRPC_OP_SEND_INITIAL_METADATA: - add_property_bool(return_value, "send_metadata", true); + add_property_bool(result, "send_metadata", true); break; case GRPC_OP_SEND_MESSAGE: - add_property_bool(return_value, "send_message", true); + add_property_bool(result, "send_message", true); break; case GRPC_OP_SEND_CLOSE_FROM_CLIENT: - add_property_bool(return_value, "send_close", true); + add_property_bool(result, "send_close", true); break; case GRPC_OP_SEND_STATUS_FROM_SERVER: - add_property_bool(return_value, "send_status", true); + add_property_bool(result, "send_status", true); break; case GRPC_OP_RECV_INITIAL_METADATA: - grpc_parse_metadata_array(&recv_metadata, array); - add_property_zval(return_value, "metadata", array); + recv_md = *grpc_parse_metadata_array(&recv_metadata); + add_property_zval(result, "metadata", &recv_md); break; case GRPC_OP_RECV_MESSAGE: byte_buffer_to_string(message, &message_str, &message_len); if (message_str == NULL) { - add_property_null(return_value, "message"); + add_property_null(result, "message"); } else { - add_property_stringl(return_value, "message", message_str, + add_property_stringl(result, "message", message_str, message_len); } break; case GRPC_OP_RECV_STATUS_ON_CLIENT: object_init(&recv_status); - grpc_parse_metadata_array(&recv_trailing_metadata, array); - add_property_zval(&recv_status, "metadata", array); + recv_md = *grpc_parse_metadata_array(&recv_trailing_metadata); + add_property_zval(&recv_status, "metadata", &recv_md); add_property_long(&recv_status, "code", status); add_property_string(&recv_status, "details", status_details); - add_property_zval(return_value, "status", &recv_status); + add_property_zval(result, "status", &recv_status); break; case GRPC_OP_RECV_CLOSE_ON_SERVER: - add_property_bool(return_value, "cancelled", cancelled); + add_property_bool(result, "cancelled", cancelled); break; default: break; @@ -815,11 +772,7 @@ cleanup: grpc_byte_buffer_destroy(message); } } -#if PHP_MAJOR_VERSION < 7 RETURN_DESTROY_ZVAL(result); -#else - RETURN_DESTROY_ZVAL(return_value); -#endif } /** diff --git a/src/php/ext/grpc/call.h b/src/php/ext/grpc/call.h index 4931bf392e..e49f9b382a 100644 --- a/src/php/ext/grpc/call.h +++ b/src/php/ext/grpc/call.h @@ -48,34 +48,19 @@ /* Class entry for the Call PHP class */ extern zend_class_entry *grpc_ce_call; -#if PHP_MAJOR_VERSION < 7 - /* Wrapper struct for grpc_call that can be associated with a PHP object */ -typedef struct wrapped_grpc_call { - zend_object std; +PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_call) bool owned; grpc_call *wrapped; -} wrapped_grpc_call; - -/* Creates a Call object that wraps the given grpc_call struct */ -zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned TSRMLS_DC); +PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_call) -/* Creates and returns a PHP associative array of metadata from a C array of - * call metadata */ -zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array TSRMLS_DC); +#if PHP_MAJOR_VERSION < 7 #define Z_WRAPPED_GRPC_CALL_P(zv) \ (wrapped_grpc_call *)zend_object_store_get_object(zv TSRMLS_CC) #else -/* Wrapper struct for grpc_call that can be associated with a PHP object */ -typedef struct wrapped_grpc_call { - bool owned; - grpc_call *wrapped; - zend_object std; -} wrapped_grpc_call; - static inline wrapped_grpc_call *wrapped_grpc_call_from_obj(zend_object *obj) { return (wrapped_grpc_call*)((char*)(obj) - @@ -84,15 +69,14 @@ static inline wrapped_grpc_call #define Z_WRAPPED_GRPC_CALL_P(zv) wrapped_grpc_call_from_obj(Z_OBJ_P((zv))) -/* Creates a Call object that wraps the given grpc_call struct */ -void grpc_php_wrap_call(grpc_call *wrapped, bool owned, zval *call_object); +#endif /* PHP_MAJOR_VERSION */ /* Creates and returns a PHP associative array of metadata from a C array of * call metadata */ -void grpc_parse_metadata_array(grpc_metadata_array *metadata_array, - zval *array); +zval *grpc_parse_metadata_array(grpc_metadata_array *metadata_array TSRMLS_DC); -#endif /* PHP_MAJOR_VERSION */ +/* Creates a Call object that wraps the given grpc_call struct */ +zval *grpc_php_wrap_call(grpc_call *wrapped, bool owned TSRMLS_DC); /* Initializes the Call PHP class */ void grpc_init_call(TSRMLS_D); diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index 24ee0a465e..29762afb29 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -86,17 +86,6 @@ zend_object_value create_wrapped_grpc_call_credentials( return retval; } -zval *grpc_php_wrap_call_credentials(grpc_call_credentials *wrapped TSRMLS_DC) { - zval *credentials_object; - MAKE_STD_ZVAL(credentials_object); - object_init_ex(credentials_object, grpc_ce_call_credentials); - wrapped_grpc_call_credentials *credentials = - (wrapped_grpc_call_credentials *)zend_object_store_get_object( - credentials_object TSRMLS_CC); - credentials->wrapped = wrapped; - return credentials_object; -} - #else static zend_object_handlers call_credentials_ce_handlers; @@ -124,16 +113,19 @@ zend_object *create_wrapped_grpc_call_credentials(zend_class_entry return &intern->std; } -void grpc_php_wrap_call_credentials(grpc_call_credentials *wrapped, - zval *credentials_object) { +#endif + +zval *grpc_php_wrap_call_credentials(grpc_call_credentials + *wrapped TSRMLS_DC) { + zval *credentials_object; + PHP_GRPC_MAKE_STD_ZVAL(credentials_object); object_init_ex(credentials_object, grpc_ce_call_credentials); wrapped_grpc_call_credentials *credentials = Z_WRAPPED_GRPC_CALL_CREDS_P(credentials_object); credentials->wrapped = wrapped; + return credentials_object; } -#endif - /** * Create composite credentials from two existing credentials. * @param CallCredentials cred1 The first credential @@ -160,13 +152,10 @@ PHP_METHOD(CallCredentials, createComposite) { grpc_call_credentials *creds = grpc_composite_call_credentials_create(cred1->wrapped, cred2->wrapped, NULL); -#if PHP_MAJOR_VERSION < 7 - zval *creds_object = grpc_php_wrap_call_credentials(creds TSRMLS_CC); + zval *creds_object; + PHP_GRPC_MAKE_STD_ZVAL(creds_object); + creds_object = grpc_php_wrap_call_credentials(creds TSRMLS_CC); RETURN_DESTROY_ZVAL(creds_object); -#else - grpc_php_wrap_call_credentials(creds, return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** @@ -207,13 +196,10 @@ PHP_METHOD(CallCredentials, createFromPlugin) { grpc_call_credentials *creds = grpc_metadata_credentials_create_from_plugin(plugin, NULL); -#if PHP_MAJOR_VERSION < 7 - zval *creds_object = grpc_php_wrap_call_credentials(creds TSRMLS_CC); + zval *creds_object; + PHP_GRPC_MAKE_STD_ZVAL(creds_object); + creds_object = grpc_php_wrap_call_credentials(creds TSRMLS_CC); RETURN_DESTROY_ZVAL(creds_object); -#else - grpc_php_wrap_call_credentials(creds, return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /* Callback function for plugin creds API */ @@ -226,37 +212,28 @@ void plugin_get_metadata(void *ptr, grpc_auth_metadata_context context, /* prepare to call the user callback function with info from the * grpc_auth_metadata_context */ -#if PHP_MAJOR_VERSION < 7 - zval **params[1]; zval *arg; - zval *retval; - MAKE_STD_ZVAL(arg); + PHP_GRPC_MAKE_STD_ZVAL(arg); object_init(arg); - add_property_string(arg, "service_url", context.service_url, true); - add_property_string(arg, "method_name", context.method_name, true); + php_grpc_add_property_string(arg, "service_url", context.service_url, true); + php_grpc_add_property_string(arg, "method_name", context.method_name, true); + zval *retval; + PHP_GRPC_MAKE_STD_ZVAL(retval); +#if PHP_MAJOR_VERSION < 7 + zval **params[1]; params[0] = &arg; - state->fci->param_count = 1; state->fci->params = params; state->fci->retval_ptr_ptr = &retval; #else - zval arg; - zval retval; - object_init(&arg); - add_property_string(&arg, "service_url", context.service_url); - add_property_string(&arg, "method_name", context.method_name); - state->fci->param_count = 1; - state->fci->params = &arg; - state->fci->retval = &retval; + state->fci->params = arg; + state->fci->retval = retval; #endif + state->fci->param_count = 1; /* call the user callback function */ zend_call_function(state->fci, state->fci_cache TSRMLS_CC); -#if PHP_MAJOR_VERSION < 7 if (Z_TYPE_P(retval) != IS_ARRAY) { -#else - if (Z_TYPE_P(&retval) != IS_ARRAY) { -#endif zend_throw_exception(spl_ce_InvalidArgumentException, "plugin callback must return metadata array", 1 TSRMLS_CC); @@ -264,11 +241,7 @@ void plugin_get_metadata(void *ptr, grpc_auth_metadata_context context, } grpc_metadata_array metadata; -#if PHP_MAJOR_VERSION < 7 if (!create_metadata_array(retval, &metadata)) { -#else - if (!create_metadata_array(&retval, &metadata)) { -#endif zend_throw_exception(spl_ce_InvalidArgumentException, "invalid metadata", 1 TSRMLS_CC); grpc_metadata_array_destroy(&metadata); diff --git a/src/php/ext/grpc/call_credentials.h b/src/php/ext/grpc/call_credentials.h index e9688288de..822d077ccb 100755 --- a/src/php/ext/grpc/call_credentials.h +++ b/src/php/ext/grpc/call_credentials.h @@ -49,25 +49,18 @@ /* Class entry for the CallCredentials PHP class */ extern zend_class_entry *grpc_ce_call_credentials; -#if PHP_MAJOR_VERSION < 7 - /* Wrapper struct for grpc_call_credentials that can be associated * with a PHP object */ -typedef struct wrapped_grpc_call_credentials { - zend_object std; +PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_call_credentials) grpc_call_credentials *wrapped; -} wrapped_grpc_call_credentials; +PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_call_credentials) + +#if PHP_MAJOR_VERSION < 7 #define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \ (wrapped_grpc_call_credentials *)zend_object_store_get_object(zv TSRMLS_CC) -#else -/* Wrapper struct for grpc_call_credentials that can be associated - * with a PHP object */ -typedef struct wrapped_grpc_call_credentials { - grpc_call_credentials *wrapped; - zend_object std; -} wrapped_grpc_call_credentials; +#else static inline wrapped_grpc_call_credentials *wrapped_grpc_call_creds_from_obj(zend_object *obj) { @@ -77,7 +70,7 @@ static inline wrapped_grpc_call_credentials std)); } -#define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \ +#define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \ wrapped_grpc_call_creds_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 085a51b560..18ebcabc26 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -86,19 +86,58 @@ zend_object_value create_wrapped_grpc_channel(zend_class_entry *class_type return retval; } +#else + +static zend_object_handlers channel_ce_handlers; + +/* Frees and destroys an instance of wrapped_grpc_channel */ +static void free_wrapped_grpc_channel(zend_object *object) { + wrapped_grpc_channel *channel = wrapped_grpc_channel_from_obj(object); + if (channel->wrapped != NULL) { + grpc_channel_destroy(channel->wrapped); + } + zend_object_std_dtor(&channel->std); +} + +/* Initializes an instance of wrapped_grpc_channel to be associated with an + * object of a class specified by class_type */ +zend_object *create_wrapped_grpc_channel(zend_class_entry *class_type) { + wrapped_grpc_channel *intern; + intern = ecalloc(1, sizeof(wrapped_grpc_channel) + + zend_object_properties_size(class_type)); + zend_object_std_init(&intern->std, class_type); + object_properties_init(&intern->std, class_type); + intern->std.handlers = &channel_ce_handlers; + return &intern->std; +} + +#endif + void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args TSRMLS_DC) { HashTable *array_hash; - HashPosition array_pointer; int args_index; +#if PHP_MAJOR_VERSION < 7 + HashPosition array_pointer; zval **data; char *key; uint key_len; ulong index; +#else + zval *data; + zend_string *key; +#endif array_hash = Z_ARRVAL_P(args_array); + if (!array_hash) { + zend_throw_exception(spl_ce_InvalidArgumentException, + "array_hash is NULL", 1); + return; + } args->num_args = zend_hash_num_elements(array_hash); args->args = ecalloc(args->num_args, sizeof(grpc_arg)); args_index = 0; + +#if PHP_MAJOR_VERSION < 7 for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); zend_hash_get_current_data_ex(array_hash, (void **)&data, &array_pointer) == SUCCESS; @@ -126,47 +165,7 @@ void php_grpc_read_args_array(zval *args_array, } args_index++; } -} - #else - -static zend_object_handlers channel_ce_handlers; - -/* Frees and destroys an instance of wrapped_grpc_channel */ -static void free_wrapped_grpc_channel(zend_object *object) { - wrapped_grpc_channel *channel = wrapped_grpc_channel_from_obj(object); - if (channel->wrapped != NULL) { - grpc_channel_destroy(channel->wrapped); - } - zend_object_std_dtor(&channel->std); -} - -/* Initializes an instance of wrapped_grpc_channel to be associated with an - * object of a class specified by class_type */ -zend_object *create_wrapped_grpc_channel(zend_class_entry *class_type) { - wrapped_grpc_channel *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_channel) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); - intern->std.handlers = &channel_ce_handlers; - return &intern->std; -} - -void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args) { - HashTable *array_hash; - int args_index; - zval *data; - zend_string *key; - array_hash = HASH_OF(args_array); - if (!array_hash) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "array_hash is NULL", 1); - return; - } - args->num_args = zend_hash_num_elements(array_hash); - args->args = ecalloc(args->num_args, sizeof(grpc_arg)); - args_index = 0; ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, data) { if (key == NULL) { zend_throw_exception(spl_ce_InvalidArgumentException, @@ -189,9 +188,8 @@ void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args) { } args_index++; } ZEND_HASH_FOREACH_END(); -} - #endif +} /** * Construct an instance of the Channel class. If the $args array contains a diff --git a/src/php/ext/grpc/channel.h b/src/php/ext/grpc/channel.h index 94c633408e..0b815657d3 100755 --- a/src/php/ext/grpc/channel.h +++ b/src/php/ext/grpc/channel.h @@ -48,32 +48,25 @@ /* Class entry for the PHP Channel class */ extern zend_class_entry *grpc_ce_channel; -#if PHP_MAJOR_VERSION < 7 - /* Wrapper struct for grpc_channel that can be associated with a PHP object */ -typedef struct wrapped_grpc_channel { - zend_object std; +PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_channel) grpc_channel *wrapped; -} wrapped_grpc_channel; +PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_channel) + +#if PHP_MAJOR_VERSION < 7 #define Z_WRAPPED_GRPC_CHANNEL_P(zv) \ (wrapped_grpc_channel *)zend_object_store_get_object(zv TSRMLS_CC) #else -/* Wrapper struct for grpc_channel that can be associated with a PHP object */ -typedef struct wrapped_grpc_channel { - grpc_channel *wrapped; - zend_object std; -} wrapped_grpc_channel; - static inline wrapped_grpc_channel *wrapped_grpc_channel_from_obj(zend_object *obj) { return (wrapped_grpc_channel*)((char*)(obj) - XtOffsetOf(wrapped_grpc_channel, std)); } -#define Z_WRAPPED_GRPC_CHANNEL_P(zv) \ +#define Z_WRAPPED_GRPC_CHANNEL_P(zv) \ wrapped_grpc_channel_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index e255b3004b..1c2ea5ba82 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -96,18 +96,6 @@ zend_object_value create_wrapped_grpc_channel_credentials( return retval; } -zval *grpc_php_wrap_channel_credentials(grpc_channel_credentials - *wrapped TSRMLS_DC) { - zval *credentials_object; - MAKE_STD_ZVAL(credentials_object); - object_init_ex(credentials_object, grpc_ce_channel_credentials); - wrapped_grpc_channel_credentials *credentials = - (wrapped_grpc_channel_credentials *)zend_object_store_get_object( - credentials_object TSRMLS_CC); - credentials->wrapped = wrapped; - return credentials_object; -} - #else static zend_object_handlers channel_credentials_ce_handlers; @@ -135,16 +123,19 @@ zend_object *create_wrapped_grpc_channel_credentials(zend_class_entry return &intern->std; } -void grpc_php_wrap_channel_credentials(grpc_channel_credentials *wrapped, - zval *credentials_object) { +#endif + +zval *grpc_php_wrap_channel_credentials(grpc_channel_credentials + *wrapped TSRMLS_DC) { + zval *credentials_object; + PHP_GRPC_MAKE_STD_ZVAL(credentials_object); object_init_ex(credentials_object, grpc_ce_channel_credentials); wrapped_grpc_channel_credentials *credentials = Z_WRAPPED_GRPC_CHANNEL_CREDS_P(credentials_object); credentials->wrapped = wrapped; + return credentials_object; } -#endif - /** * Set default roots pem. * @param string pem_roots PEM encoding of the server root certificates @@ -171,13 +162,10 @@ PHP_METHOD(ChannelCredentials, setDefaultRootsPem) { */ PHP_METHOD(ChannelCredentials, createDefault) { grpc_channel_credentials *creds = grpc_google_default_credentials_create(); -#if PHP_MAJOR_VERSION < 7 - zval *creds_object = grpc_php_wrap_channel_credentials(creds TSRMLS_CC); + zval *creds_object; + PHP_GRPC_MAKE_STD_ZVAL(creds_object); + creds_object = grpc_php_wrap_channel_credentials(creds TSRMLS_CC); RETURN_DESTROY_ZVAL(creds_object); -#else - grpc_php_wrap_channel_credentials(creds, return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** @@ -213,13 +201,10 @@ PHP_METHOD(ChannelCredentials, createSsl) { grpc_channel_credentials *creds = grpc_ssl_credentials_create( pem_root_certs, pem_key_cert_pair.private_key == NULL ? NULL : &pem_key_cert_pair, NULL); -#if PHP_MAJOR_VERSION < 7 - zval *creds_object = grpc_php_wrap_channel_credentials(creds TSRMLS_CC); + zval *creds_object; + PHP_GRPC_MAKE_STD_ZVAL(creds_object); + creds_object = grpc_php_wrap_channel_credentials(creds TSRMLS_CC); RETURN_DESTROY_ZVAL(creds_object); -#else - grpc_php_wrap_channel_credentials(creds, return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** @@ -244,19 +229,13 @@ PHP_METHOD(ChannelCredentials, createComposite) { Z_WRAPPED_GRPC_CHANNEL_CREDS_P(cred1_obj); wrapped_grpc_call_credentials *cred2 = Z_WRAPPED_GRPC_CALL_CREDS_P(cred2_obj); -#if PHP_MAJOR_VERSION < 7 grpc_channel_credentials *creds = grpc_composite_channel_credentials_create(cred1->wrapped, cred2->wrapped, NULL); - zval *creds_object = grpc_php_wrap_channel_credentials(creds TSRMLS_CC); + zval *creds_object; + PHP_GRPC_MAKE_STD_ZVAL(creds_object); + creds_object = grpc_php_wrap_channel_credentials(creds TSRMLS_CC); RETURN_DESTROY_ZVAL(creds_object); -#else - grpc_channel_credentials *creds = - grpc_composite_channel_credentials_create(cred1->wrapped, - cred2->wrapped, NULL); - grpc_php_wrap_channel_credentials(creds, return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** diff --git a/src/php/ext/grpc/channel_credentials.h b/src/php/ext/grpc/channel_credentials.h index 0f7759daa6..21225db5fb 100755 --- a/src/php/ext/grpc/channel_credentials.h +++ b/src/php/ext/grpc/channel_credentials.h @@ -49,27 +49,19 @@ /* Class entry for the ChannelCredentials PHP class */ extern zend_class_entry *grpc_ce_channel_credentials; -#if PHP_MAJOR_VERSION < 7 - /* Wrapper struct for grpc_channel_credentials that can be associated * with a PHP object */ -typedef struct wrapped_grpc_channel_credentials { - zend_object std; +PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_channel_credentials) grpc_channel_credentials *wrapped; -} wrapped_grpc_channel_credentials; +PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_channel_credentials) + +#if PHP_MAJOR_VERSION < 7 #define Z_WRAPPED_GRPC_CHANNEL_CREDS_P(zv) \ (wrapped_grpc_channel_credentials *)zend_object_store_get_object(zv TSRMLS_CC) #else -/* Wrapper struct for grpc_channel_credentials that can be associated - * with a PHP object */ -typedef struct wrapped_grpc_channel_credentials { - grpc_channel_credentials *wrapped; - zend_object std; -} wrapped_grpc_channel_credentials; - static inline wrapped_grpc_channel_credentials *wrapped_grpc_channel_creds_from_obj(zend_object *obj) { return @@ -78,7 +70,7 @@ static inline wrapped_grpc_channel_credentials XtOffsetOf(wrapped_grpc_channel_credentials, std)); } -#define Z_WRAPPED_GRPC_CHANNEL_CREDS_P(zv) \ +#define Z_WRAPPED_GRPC_CHANNEL_CREDS_P(zv) \ wrapped_grpc_channel_creds_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index e4d0d4c90b..58dffc38dc 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -39,13 +39,45 @@ #define php_grpc_int int #define php_grpc_long long +#define php_grpc_ulong ulong +#define php_grpc_add_property_string(arg, name, context, b) \ + add_property_string(arg, name, context, b) +#define php_grpc_add_property_stringl(res, name, str, len, b) \ + add_property_stringl(res, name, str, len, b) +#define php_grpc_add_next_index_stringl(data, str, len, b) \ + add_next_index_stringl(data, str, len, b) + #define PHP_GRPC_RETURN_STRING(val, dup) RETURN_STRING(val, dup) +#define PHP_GRPC_MAKE_STD_ZVAL(pzv) MAKE_STD_ZVAL(pzv) + +#define PHP_GRPC_WRAP_OBJECT_START(name) \ + typedef struct name { \ + zend_object std; +#define PHP_GRPC_WRAP_OBJECT_END(name) \ + } name; #else #define php_grpc_int size_t #define php_grpc_long zend_long +#define php_grpc_ulong zend_ulong +#define php_grpc_add_property_string(arg, name, context, b) \ + add_property_string(arg, name, context) +#define php_grpc_add_property_stringl(res, name, str, len, b) \ + add_property_stringl(res, name, str, len) +#define php_grpc_add_next_index_stringl(data, str, len, b) \ + add_next_index_stringl(data, str, len) + #define PHP_GRPC_RETURN_STRING(val, dup) RETURN_STRING(val) +#define PHP_GRPC_MAKE_STD_ZVAL(pzv) \ + zval _stack_zval_##pzv; \ + pzv = &(_stack_zval_##pzv) + +#define PHP_GRPC_WRAP_OBJECT_START(name) \ + typedef struct name { +#define PHP_GRPC_WRAP_OBJECT_END(name) \ + zend_object std; \ + } name; #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index e67e62c34e..577b707089 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -168,13 +168,9 @@ PHP_METHOD(Server, requestCall) { grpc_event event; wrapped_grpc_server *server = Z_WRAPPED_GRPC_SERVER_P(getThis()); -#if PHP_MAJOR_VERSION < 7 zval *result; - MAKE_STD_ZVAL(result); + PHP_GRPC_MAKE_STD_ZVAL(result); object_init(result); -#else - object_init(return_value); -#endif grpc_call_details_init(&details); grpc_metadata_array_init(&metadata); @@ -195,40 +191,32 @@ PHP_METHOD(Server, requestCall) { 1 TSRMLS_CC); goto cleanup; } + php_grpc_add_property_string(result, "method", details.method, true); + php_grpc_add_property_string(result, "host", details.host, true); #if PHP_MAJOR_VERSION < 7 add_property_zval(result, "call", grpc_php_wrap_call(call, true TSRMLS_CC)); - add_property_string(result, "method", details.method, true); - add_property_string(result, "host", details.host, true); add_property_zval(result, "absolute_deadline", grpc_php_wrap_timeval(details.deadline TSRMLS_CC)); add_property_zval(result, "metadata", grpc_parse_metadata_array(&metadata TSRMLS_CC)); - -cleanup: - grpc_call_details_destroy(&details); - grpc_metadata_array_destroy(&metadata); - RETURN_DESTROY_ZVAL(result); - #else - zval zv_call; zval zv_timeval; zval zv_md; - grpc_php_wrap_call(call, true, &zv_call); - grpc_php_wrap_timeval(details.deadline, &zv_timeval); - grpc_parse_metadata_array(&metadata, &zv_md); - - add_property_zval(return_value, "call", &zv_call); - add_property_string(return_value, "method", details.method); - add_property_string(return_value, "host", details.host); - add_property_zval(return_value, "absolute_deadline", &zv_timeval); - add_property_zval(return_value, "metadata", &zv_md); + //TODO(thinkerou): why use zval* to unit test error? + zv_call = *grpc_php_wrap_call(call, true); + zv_timeval = *grpc_php_wrap_timeval(details.deadline); + zv_md = *grpc_parse_metadata_array(&metadata); + + add_property_zval(result, "call", &zv_call); + add_property_zval(result, "absolute_deadline", &zv_timeval); + add_property_zval(result, "metadata", &zv_md); +#endif cleanup: grpc_call_details_destroy(&details); grpc_metadata_array_destroy(&metadata); - RETURN_DESTROY_ZVAL(return_value); -#endif + RETURN_DESTROY_ZVAL(result); } /** diff --git a/src/php/ext/grpc/server.h b/src/php/ext/grpc/server.h index 603b9a7102..02ef1f7975 100755 --- a/src/php/ext/grpc/server.h +++ b/src/php/ext/grpc/server.h @@ -48,32 +48,25 @@ /* Class entry for the Server PHP class */ extern zend_class_entry *grpc_ce_server; -#if PHP_MAJOR_VERSION < 7 - /* Wrapper struct for grpc_server that can be associated with a PHP object */ -typedef struct wrapped_grpc_server { - zend_object std; +PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_server) grpc_server *wrapped; -} wrapped_grpc_server; +PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_server) + +#if PHP_MAJOR_VERSION < 7 #define Z_WRAPPED_GRPC_SERVER_P(zv) \ (wrapped_grpc_server *)zend_object_store_get_object(zv TSRMLS_CC) #else -/* Wrapper struct for grpc_server that can be associated with a PHP object */ -typedef struct wrapped_grpc_server { - grpc_server *wrapped; - zend_object std; -} wrapped_grpc_server; - static inline wrapped_grpc_server *wrapped_grpc_server_from_obj(zend_object *obj) { return (wrapped_grpc_server*)((char*)(obj) - XtOffsetOf(wrapped_grpc_server, std)); } -#define Z_WRAPPED_GRPC_SERVER_P(zv) \ +#define Z_WRAPPED_GRPC_SERVER_P(zv) \ wrapped_grpc_server_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index e61fc5b4a1..46416f5b47 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -84,18 +84,6 @@ zend_object_value create_wrapped_grpc_server_credentials( return retval; } -zval *grpc_php_wrap_server_credentials(grpc_server_credentials - *wrapped TSRMLS_DC) { - zval *server_credentials_object; - MAKE_STD_ZVAL(server_credentials_object); - object_init_ex(server_credentials_object, grpc_ce_server_credentials); - wrapped_grpc_server_credentials *server_credentials = - (wrapped_grpc_server_credentials *)zend_object_store_get_object( - server_credentials_object TSRMLS_CC); - server_credentials->wrapped = wrapped; - return server_credentials_object; -} - #else static zend_object_handlers server_credentials_ce_handlers; @@ -123,16 +111,19 @@ zend_object *create_wrapped_grpc_server_credentials(zend_class_entry return &intern->std; } -void grpc_php_wrap_server_credentials(grpc_server_credentials *wrapped, - zval *server_credentials_object) { +#endif + +zval *grpc_php_wrap_server_credentials(grpc_server_credentials + *wrapped TSRMLS_DC) { + zval *server_credentials_object; + PHP_GRPC_MAKE_STD_ZVAL(server_credentials_object); object_init_ex(server_credentials_object, grpc_ce_server_credentials); wrapped_grpc_server_credentials *server_credentials = Z_WRAPPED_GRPC_SERVER_CREDS_P(server_credentials_object); server_credentials->wrapped = wrapped; + return server_credentials_object; } -#endif - /** * Create SSL credentials. * @param string pem_root_certs PEM encoding of the server root certificates @@ -163,13 +154,10 @@ PHP_METHOD(ServerCredentials, createSsl) { grpc_server_credentials *creds = grpc_ssl_server_credentials_create_ex( pem_root_certs, &pem_key_cert_pair, 1, GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE, NULL); -#if PHP_MAJOR_VERSION < 7 - zval *creds_object = grpc_php_wrap_server_credentials(creds TSRMLS_CC); + zval *creds_object; + PHP_GRPC_MAKE_STD_ZVAL(creds_object); + creds_object = grpc_php_wrap_server_credentials(creds TSRMLS_CC); RETURN_DESTROY_ZVAL(creds_object); -#else - grpc_php_wrap_server_credentials(creds, return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } static zend_function_entry server_credentials_methods[] = { diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h index 9df5950fa7..2a90aa69a2 100755 --- a/src/php/ext/grpc/server_credentials.h +++ b/src/php/ext/grpc/server_credentials.h @@ -49,33 +49,26 @@ /* Class entry for the Server_Credentials PHP class */ extern zend_class_entry *grpc_ce_server_credentials; -#if PHP_MAJOR_VERSION < 7 - /* Wrapper struct for grpc_server_credentials that can be associated with a PHP * object */ -typedef struct wrapped_grpc_server_credentials { - zend_object std; +PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_server_credentials) grpc_server_credentials *wrapped; -} wrapped_grpc_server_credentials; +PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_server_credentials) + +#if PHP_MAJOR_VERSION < 7 #define Z_WRAPPED_GRPC_SERVER_CREDS_P(zv) \ (wrapped_grpc_server_credentials *)zend_object_store_get_object(zv TSRMLS_CC) #else -typedef struct wrapped_grpc_server_credentials { - grpc_server_credentials *wrapped; - zend_object std; -} wrapped_grpc_server_credentials; - static inline wrapped_grpc_server_credentials *wrapped_grpc_server_creds_from_obj(zend_object *obj) { return (wrapped_grpc_server_credentials*) - ((char*)(obj) - - XtOffsetOf(wrapped_grpc_server_credentials, std)); + ((char*)(obj) - XtOffsetOf(wrapped_grpc_server_credentials, std)); } -#define Z_WRAPPED_GRPC_SERVER_CREDS_P(zv) \ +#define Z_WRAPPED_GRPC_SERVER_CREDS_P(zv) \ wrapped_grpc_server_creds_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index a3ec62f13f..18635ae46c 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -78,17 +78,6 @@ zend_object_value create_wrapped_grpc_timeval(zend_class_entry *class_type return retval; } -zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) { - zval *timeval_object; - MAKE_STD_ZVAL(timeval_object); - object_init_ex(timeval_object, grpc_ce_timeval); - wrapped_grpc_timeval *timeval = - (wrapped_grpc_timeval *)zend_object_store_get_object( - timeval_object TSRMLS_CC); - memcpy(&timeval->wrapped, &wrapped, sizeof(gpr_timespec)); - return timeval_object; -} - #else static zend_object_handlers timeval_ce_handlers; @@ -111,14 +100,17 @@ zend_object *create_wrapped_grpc_timeval(zend_class_entry *class_type) { return &intern->std; } -void grpc_php_wrap_timeval(gpr_timespec wrapped, zval *timeval_object) { +#endif + +zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) { + zval *timeval_object; + PHP_GRPC_MAKE_STD_ZVAL(timeval_object); object_init_ex(timeval_object, grpc_ce_timeval); wrapped_grpc_timeval *timeval = Z_WRAPPED_GRPC_TIMEVAL_P(timeval_object); memcpy(&timeval->wrapped, &wrapped, sizeof(gpr_timespec)); + return timeval_object; } -#endif - /** * Constructs a new instance of the Timeval class * @param long $usec The number of microseconds in the interval @@ -156,16 +148,12 @@ PHP_METHOD(Timeval, add) { } wrapped_grpc_timeval *self = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); wrapped_grpc_timeval *other = Z_WRAPPED_GRPC_TIMEVAL_P(other_obj); -#if PHP_MAJOR_VERSION < 7 - zval *sum = + zval *sum; + PHP_GRPC_MAKE_STD_ZVAL(sum); + sum = grpc_php_wrap_timeval(gpr_time_add(self->wrapped, other->wrapped) TSRMLS_CC); RETURN_DESTROY_ZVAL(sum); -#else - grpc_php_wrap_timeval(gpr_time_add(self->wrapped, other->wrapped), - return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** @@ -186,16 +174,12 @@ PHP_METHOD(Timeval, subtract) { } wrapped_grpc_timeval *self = Z_WRAPPED_GRPC_TIMEVAL_P(getThis()); wrapped_grpc_timeval *other = Z_WRAPPED_GRPC_TIMEVAL_P(other_obj); -#if PHP_MAJOR_VERSION < 7 - zval *diff = + zval *diff; + PHP_GRPC_MAKE_STD_ZVAL(diff); + diff = grpc_php_wrap_timeval(gpr_time_sub(self->wrapped, other->wrapped) TSRMLS_CC); RETURN_DESTROY_ZVAL(diff); -#else - grpc_php_wrap_timeval(gpr_time_sub(self->wrapped, other->wrapped), - return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** @@ -255,13 +239,10 @@ PHP_METHOD(Timeval, similar) { * @return Timeval The current time */ PHP_METHOD(Timeval, now) { -#if PHP_MAJOR_VERSION < 7 - zval *now = grpc_php_wrap_timeval(gpr_now(GPR_CLOCK_REALTIME) TSRMLS_CC); + zval *now; + PHP_GRPC_MAKE_STD_ZVAL(now); + now = grpc_php_wrap_timeval(gpr_now(GPR_CLOCK_REALTIME) TSRMLS_CC); RETURN_DESTROY_ZVAL(now); -#else - grpc_php_wrap_timeval(gpr_now(GPR_CLOCK_REALTIME), return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** @@ -269,18 +250,13 @@ PHP_METHOD(Timeval, now) { * @return Timeval Zero length time interval */ PHP_METHOD(Timeval, zero) { -#if PHP_MAJOR_VERSION < 7 - zval *grpc_php_timeval_zero = + zval *grpc_php_timeval_zero; + PHP_GRPC_MAKE_STD_ZVAL(grpc_php_timeval_zero); + grpc_php_timeval_zero = grpc_php_wrap_timeval(gpr_time_0(GPR_CLOCK_REALTIME) TSRMLS_CC); RETURN_ZVAL(grpc_php_timeval_zero, false, /* Copy original before returning? */ true /* Destroy original before returning */); -#else - grpc_php_wrap_timeval(gpr_time_0(GPR_CLOCK_REALTIME), return_value); - RETURN_ZVAL(return_value, - false, /* Copy original before returning? */ - true /* Destroy original before returning */); -#endif } /** @@ -288,14 +264,11 @@ PHP_METHOD(Timeval, zero) { * @return Timeval Infinite future time value */ PHP_METHOD(Timeval, infFuture) { -#if PHP_MAJOR_VERSION < 7 - zval *grpc_php_timeval_inf_future = + zval *grpc_php_timeval_inf_future; + PHP_GRPC_MAKE_STD_ZVAL(grpc_php_timeval_inf_future); + grpc_php_timeval_inf_future = grpc_php_wrap_timeval(gpr_inf_future(GPR_CLOCK_REALTIME) TSRMLS_CC); RETURN_DESTROY_ZVAL(grpc_php_timeval_inf_future); -#else - grpc_php_wrap_timeval(gpr_inf_future(GPR_CLOCK_REALTIME), return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** @@ -303,14 +276,11 @@ PHP_METHOD(Timeval, infFuture) { * @return Timeval Infinite past time value */ PHP_METHOD(Timeval, infPast) { -#if PHP_MAJOR_VERSION < 7 - zval *grpc_php_timeval_inf_past = + zval *grpc_php_timeval_inf_past; + PHP_GRPC_MAKE_STD_ZVAL(grpc_php_timeval_inf_past); + grpc_php_timeval_inf_past = grpc_php_wrap_timeval(gpr_inf_past(GPR_CLOCK_REALTIME) TSRMLS_CC); RETURN_DESTROY_ZVAL(grpc_php_timeval_inf_past); -#else - grpc_php_wrap_timeval(gpr_inf_past(GPR_CLOCK_REALTIME), return_value); - RETURN_DESTROY_ZVAL(return_value); -#endif } /** diff --git a/src/php/ext/grpc/timeval.h b/src/php/ext/grpc/timeval.h index d362460c05..63a1d702f3 100755 --- a/src/php/ext/grpc/timeval.h +++ b/src/php/ext/grpc/timeval.h @@ -50,30 +50,24 @@ extern zend_class_entry *grpc_ce_timeval; /* Wrapper struct for timeval that can be associated with a PHP object */ -#if PHP_MAJOR_VERSION < 7 - -typedef struct wrapped_grpc_timeval { - zend_object std; +PHP_GRPC_WRAP_OBJECT_START(wrapped_grpc_timeval) gpr_timespec wrapped; -} wrapped_grpc_timeval; +PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_timeval) + +#if PHP_MAJOR_VERSION < 7 #define Z_WRAPPED_GRPC_TIMEVAL_P(zv) \ (wrapped_grpc_timeval *)zend_object_store_get_object(zv TSRMLS_CC) #else -typedef struct wrapped_grpc_timeval { - gpr_timespec wrapped; - zend_object std; -} wrapped_grpc_timeval; - static inline wrapped_grpc_timeval *wrapped_grpc_timeval_from_obj(zend_object *obj) { return (wrapped_grpc_timeval*)((char*)(obj) - XtOffsetOf(wrapped_grpc_timeval, std)); } -#define Z_WRAPPED_GRPC_TIMEVAL_P(zv) \ +#define Z_WRAPPED_GRPC_TIMEVAL_P(zv) \ wrapped_grpc_timeval_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ @@ -85,10 +79,6 @@ void grpc_init_timeval(TSRMLS_D); void grpc_shutdown_timeval(TSRMLS_D); /* Creates a Timeval object that wraps the given timeval struct */ -#if PHP_MAJOR_VERSION < 7 zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC); -#else -void grpc_php_wrap_timeval(gpr_timespec wrapped, zval *timeval_object); -#endif /* PHP_MAJOR_VERSION */ #endif /* NET_GRPC_PHP_GRPC_TIMEVAL_H_ */ -- cgit v1.2.3 From 8fa9d31cd7196dfe3af0ac1152f4166eec4ce5be Mon Sep 17 00:00:00 2001 From: thinkerou Date: Wed, 27 Jul 2016 04:13:59 +0800 Subject: fix indent use two spaces --- src/php/ext/grpc/timeval.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 18635ae46c..7d1ee2178a 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -56,9 +56,9 @@ zend_class_entry *grpc_ce_timeval; /* Frees and destroys an instance of wrapped_grpc_call */ void free_wrapped_grpc_timeval(void *object TSRMLS_DC) { - wrapped_grpc_timeval *timeval = (wrapped_grpc_timeval *)object; - zend_object_std_dtor(&timeval->std TSRMLS_CC); - efree(timeval); + wrapped_grpc_timeval *timeval = (wrapped_grpc_timeval *)object; + zend_object_std_dtor(&timeval->std TSRMLS_CC); + efree(timeval); } /* Initializes an instance of wrapped_grpc_timeval to be associated with an -- cgit v1.2.3 From b5282c7628b8373a3ebee30d525ed12937ae2004 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 26 Jul 2016 13:14:27 -0700 Subject: Remove .rb suffix from grpc-tools scripts, to be consistent with other gems --- src/ruby/tools/bin/grpc_tools_ruby_protoc | 41 ++++++++++++++++++++++ src/ruby/tools/bin/grpc_tools_ruby_protoc.rb | 41 ---------------------- src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin | 41 ++++++++++++++++++++++ .../tools/bin/grpc_tools_ruby_protoc_plugin.rb | 41 ---------------------- src/ruby/tools/grpc-tools.gemspec | 2 +- 5 files changed, 83 insertions(+), 83 deletions(-) create mode 100755 src/ruby/tools/bin/grpc_tools_ruby_protoc delete mode 100755 src/ruby/tools/bin/grpc_tools_ruby_protoc.rb create mode 100755 src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin delete mode 100755 src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin.rb (limited to 'src') diff --git a/src/ruby/tools/bin/grpc_tools_ruby_protoc b/src/ruby/tools/bin/grpc_tools_ruby_protoc new file mode 100755 index 0000000000..3a2a5b8dc9 --- /dev/null +++ b/src/ruby/tools/bin/grpc_tools_ruby_protoc @@ -0,0 +1,41 @@ +#!/usr/bin/env ruby +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +require 'rbconfig' + +require_relative '../os_check' + +protoc_name = 'protoc' + RbConfig::CONFIG['EXEEXT'] + +protoc_path = File.join(File.dirname(__FILE__), + RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name, + protoc_name) + +exec([ protoc_path, protoc_path ], *ARGV) diff --git a/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb b/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb deleted file mode 100755 index 3a2a5b8dc9..0000000000 --- a/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env ruby -# Copyright 2016, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -require 'rbconfig' - -require_relative '../os_check' - -protoc_name = 'protoc' + RbConfig::CONFIG['EXEEXT'] - -protoc_path = File.join(File.dirname(__FILE__), - RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name, - protoc_name) - -exec([ protoc_path, protoc_path ], *ARGV) diff --git a/src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin b/src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin new file mode 100755 index 0000000000..4b296dedc7 --- /dev/null +++ b/src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin @@ -0,0 +1,41 @@ +#!/usr/bin/env ruby +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +require 'rbconfig' + +require_relative '../os_check' + +plugin_name = 'grpc_ruby_plugin' + RbConfig::CONFIG['EXEEXT'] + +plugin_path = File.join(File.dirname(__FILE__), + RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name, + plugin_name) + +exec([ plugin_path, plugin_path ], *ARGV) diff --git a/src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin.rb b/src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin.rb deleted file mode 100755 index 4b296dedc7..0000000000 --- a/src/ruby/tools/bin/grpc_tools_ruby_protoc_plugin.rb +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env ruby -# Copyright 2016, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -require 'rbconfig' - -require_relative '../os_check' - -plugin_name = 'grpc_ruby_plugin' + RbConfig::CONFIG['EXEEXT'] - -plugin_path = File.join(File.dirname(__FILE__), - RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name, - plugin_name) - -exec([ plugin_path, plugin_path ], *ARGV) diff --git a/src/ruby/tools/grpc-tools.gemspec b/src/ruby/tools/grpc-tools.gemspec index 9fa4b66392..68e2a7a113 100644 --- a/src/ruby/tools/grpc-tools.gemspec +++ b/src/ruby/tools/grpc-tools.gemspec @@ -18,5 +18,5 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY - s.executables = %w( grpc_tools_ruby_protoc.rb grpc_tools_ruby_protoc_plugin.rb ) + s.executables = %w( grpc_tools_ruby_protoc grpc_tools_ruby_protoc_plugin ) end -- cgit v1.2.3 From b95870d85b3fdb95810034909d40527aebd2d82a Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Fri, 22 Jul 2016 12:37:10 -0700 Subject: php: fix composer.json --- examples/php/composer.json | 2 +- src/php/composer.json | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/examples/php/composer.json b/examples/php/composer.json index a8b790b1de..d40b5db059 100644 --- a/examples/php/composer.json +++ b/examples/php/composer.json @@ -3,6 +3,6 @@ "description": "gRPC example for PHP", "minimum-stability": "dev", "require": { - "grpc/grpc": "v0.15.0" + "grpc/grpc": "v0.15.2" } } diff --git a/src/php/composer.json b/src/php/composer.json index 88418206e8..1eacc643a2 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -8,7 +8,9 @@ "version": "1.0.0", "require": { "php": ">=5.5.0", - "stanley-cheung/protobuf-php": "v0.6", + "stanley-cheung/protobuf-php": "v0.6" + }, + "require-dev": { "google/auth": "v0.9" }, "autoload": { -- cgit v1.2.3 From fdf27a49bb84f956ad8ef9c731e58e7755b78b0a Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Tue, 26 Jul 2016 17:46:59 -0700 Subject: remove reference to homebrew --- src/php/bin/determine_extension_dir.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/php/bin/determine_extension_dir.sh b/src/php/bin/determine_extension_dir.sh index b4342ac89f..a59882506f 100755 --- a/src/php/bin/determine_extension_dir.sh +++ b/src/php/bin/determine_extension_dir.sh @@ -29,11 +29,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. set -e default_extension_dir=$(php-config --extension-dir) -if command -v brew > /dev/null && \ - brew ls --versions | grep php5[56]-grpc > /dev/null; then - # the grpc php extension was installed by homebrew - : -elif [ ! -e $default_extension_dir/grpc.so ]; then +if [ ! -e $default_extension_dir/grpc.so ]; then # the grpc extension is not found in the default PHP extension dir # try the source modules directory module_dir=../ext/grpc/modules -- cgit v1.2.3 From b2d590463f9aacfa543a3171a040290b6f67a28e Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Tue, 26 Jul 2016 17:55:52 -0700 Subject: update README --- src/php/README.md | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/php/README.md b/src/php/README.md index 8abedc40a3..7e9819b256 100644 --- a/src/php/README.md +++ b/src/php/README.md @@ -9,23 +9,12 @@ GA ## Environment -Prerequisite: `php` >=5.5, `phpize`, `pecl`, `phpunit` - -**Linux (Debian):** - -```sh -$ sudo apt-get install php5 php5-dev php-pear -``` - -**Linux (CentOS):** - -```sh -$ yum install php55w -$ yum --enablerepo=remi,remi-php55 install php-devel php-pear -``` - -**Mac OS X:** +Prerequisite: +* `php` 5.5 or above, 7.0 or above +* `pear` and `pecl` +* `phpunit` +**PEAR:** ```sh $ curl -O http://pear.php.net/go-pear.phar $ sudo php -d detect_unicode=0 go-pear.phar @@ -72,13 +61,7 @@ $ sudo make install ### gRPC PHP extension -Install the gRPC PHP extension from PECL - -```sh -$ sudo pecl install grpc -``` - -Or, compile from source +Compile the gRPC PHP extension ```sh $ cd grpc/src/php/ext/grpc @@ -148,12 +131,8 @@ Alternatively, you can download `protoc` binaries from [the protocol buffers Git You need to install `protoc-gen-php` to generate stub class `.php` files from service definition `.proto` files. ```sh -$ cd grpc/src/php/vendor/stanley-cheung/protobuf-php # if you had run `composer install` in the previous step - -OR - -$ git clone https://github.com/stanley-cheung/Protobuf-PHP # clone from github repo - +$ git clone https://github.com/stanley-cheung/Protobuf-PHP +$ cd Protobuf-PHP $ gem install rake ronn $ rake pear:package version=1.0 $ sudo pear install Protobuf-1.0.tgz @@ -175,7 +154,7 @@ Run a local server serving the math services. Please see [Node][] for how to run ```sh $ cd grpc $ npm install -$ nodejs src/node/test/math/math_server.js +$ node src/node/test/math/math_server.js ``` ### Run test client @@ -212,7 +191,7 @@ Make sure the Node math server is still running, as above. ```sh $ cd grpc $ npm install -$ nodejs src/node/test/math/math_server.js +$ node src/node/test/math/math_server.js ``` Make sure you have run `composer install` to generate the `vendor/autoload.php` file @@ -282,7 +261,7 @@ Make sure the Node math server is still running, as above. ```sh $ cd grpc $ npm install -$ nodejs src/node/test/math/math_server.js +$ node src/node/test/math/math_server.js ``` Make sure you have run `composer install` to generate the `vendor/autoload.php` file -- cgit v1.2.3 From 5a2c91806f49cc10362284c8f0d86771791a9692 Mon Sep 17 00:00:00 2001 From: Ken Payson Date: Tue, 26 Jul 2016 17:15:08 -0700 Subject: Updated ruby protos to use new _pb filename --- src/compiler/ruby_generator_helpers-inl.h | 4 +- src/ruby/.rubocop.yml | 4 +- src/ruby/bin/math.rb | 32 ----- src/ruby/bin/math_client.rb | 2 +- src/ruby/bin/math_pb.rb | 32 +++++ src/ruby/bin/math_server.rb | 2 +- src/ruby/bin/math_services.rb | 66 --------- src/ruby/bin/math_services_pb.rb | 66 +++++++++ src/ruby/pb/grpc/health/checker.rb | 2 +- src/ruby/pb/grpc/health/v1/health.rb | 28 ---- src/ruby/pb/grpc/health/v1/health_pb.rb | 28 ++++ src/ruby/pb/grpc/health/v1/health_services.rb | 56 -------- src/ruby/pb/grpc/health/v1/health_services_pb.rb | 56 ++++++++ .../testing/duplicate/echo_duplicate_services.rb | 58 -------- .../duplicate/echo_duplicate_services_pb.rb | 58 ++++++++ src/ruby/pb/grpc/testing/metrics.rb | 28 ---- src/ruby/pb/grpc/testing/metrics_pb.rb | 28 ++++ src/ruby/pb/grpc/testing/metrics_services.rb | 64 --------- src/ruby/pb/grpc/testing/metrics_services_pb.rb | 64 +++++++++ src/ruby/pb/src/proto/grpc/testing/empty.rb | 15 -- src/ruby/pb/src/proto/grpc/testing/empty_pb.rb | 15 ++ src/ruby/pb/src/proto/grpc/testing/messages.rb | 84 ----------- src/ruby/pb/src/proto/grpc/testing/messages_pb.rb | 82 +++++++++++ src/ruby/pb/src/proto/grpc/testing/test.rb | 14 -- src/ruby/pb/src/proto/grpc/testing/test_pb.rb | 14 ++ .../pb/src/proto/grpc/testing/test_services.rb | 110 --------------- .../pb/src/proto/grpc/testing/test_services_pb.rb | 110 +++++++++++++++ src/ruby/pb/test/client.rb | 6 +- src/ruby/pb/test/proto/empty.rb | 15 -- src/ruby/pb/test/proto/messages.rb | 80 ----------- src/ruby/pb/test/proto/test.rb | 14 -- src/ruby/pb/test/proto/test_services.rb | 64 --------- src/ruby/pb/test/server.rb | 6 +- src/ruby/qps/client.rb | 2 +- src/ruby/qps/server.rb | 6 +- src/ruby/qps/src/proto/grpc/testing/control.rb | 154 -------------------- src/ruby/qps/src/proto/grpc/testing/control_pb.rb | 156 +++++++++++++++++++++ src/ruby/qps/src/proto/grpc/testing/messages.rb | 84 ----------- src/ruby/qps/src/proto/grpc/testing/messages_pb.rb | 82 +++++++++++ src/ruby/qps/src/proto/grpc/testing/payloads.rb | 33 ----- src/ruby/qps/src/proto/grpc/testing/payloads_pb.rb | 33 +++++ src/ruby/qps/src/proto/grpc/testing/services.rb | 14 -- src/ruby/qps/src/proto/grpc/testing/services_pb.rb | 14 ++ .../src/proto/grpc/testing/services_services.rb | 92 ------------ .../src/proto/grpc/testing/services_services_pb.rb | 92 ++++++++++++ src/ruby/qps/src/proto/grpc/testing/stats.rb | 39 ------ src/ruby/qps/src/proto/grpc/testing/stats_pb.rb | 39 ++++++ src/ruby/qps/worker.rb | 2 +- src/ruby/spec/pb/duplicate/codegen_spec.rb | 4 +- src/ruby/spec/pb/health/checker_spec.rb | 8 +- src/ruby/stress/metrics_server.rb | 4 +- 51 files changed, 995 insertions(+), 1170 deletions(-) delete mode 100755 src/ruby/bin/math.rb create mode 100644 src/ruby/bin/math_pb.rb delete mode 100755 src/ruby/bin/math_services.rb create mode 100644 src/ruby/bin/math_services_pb.rb delete mode 100644 src/ruby/pb/grpc/health/v1/health.rb create mode 100644 src/ruby/pb/grpc/health/v1/health_pb.rb delete mode 100644 src/ruby/pb/grpc/health/v1/health_services.rb create mode 100644 src/ruby/pb/grpc/health/v1/health_services_pb.rb delete mode 100644 src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb create mode 100644 src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services_pb.rb delete mode 100644 src/ruby/pb/grpc/testing/metrics.rb create mode 100644 src/ruby/pb/grpc/testing/metrics_pb.rb delete mode 100644 src/ruby/pb/grpc/testing/metrics_services.rb create mode 100644 src/ruby/pb/grpc/testing/metrics_services_pb.rb delete mode 100644 src/ruby/pb/src/proto/grpc/testing/empty.rb create mode 100644 src/ruby/pb/src/proto/grpc/testing/empty_pb.rb delete mode 100644 src/ruby/pb/src/proto/grpc/testing/messages.rb create mode 100644 src/ruby/pb/src/proto/grpc/testing/messages_pb.rb delete mode 100644 src/ruby/pb/src/proto/grpc/testing/test.rb create mode 100644 src/ruby/pb/src/proto/grpc/testing/test_pb.rb delete mode 100644 src/ruby/pb/src/proto/grpc/testing/test_services.rb create mode 100644 src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb delete mode 100644 src/ruby/pb/test/proto/empty.rb delete mode 100644 src/ruby/pb/test/proto/messages.rb delete mode 100644 src/ruby/pb/test/proto/test.rb delete mode 100644 src/ruby/pb/test/proto/test_services.rb delete mode 100644 src/ruby/qps/src/proto/grpc/testing/control.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/control_pb.rb delete mode 100644 src/ruby/qps/src/proto/grpc/testing/messages.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/messages_pb.rb delete mode 100644 src/ruby/qps/src/proto/grpc/testing/payloads.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/payloads_pb.rb delete mode 100644 src/ruby/qps/src/proto/grpc/testing/services.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/services_pb.rb delete mode 100644 src/ruby/qps/src/proto/grpc/testing/services_services.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/services_services_pb.rb delete mode 100644 src/ruby/qps/src/proto/grpc/testing/stats.rb create mode 100644 src/ruby/qps/src/proto/grpc/testing/stats_pb.rb (limited to 'src') diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h index ff6939ed9f..aa3c22fea6 100644 --- a/src/compiler/ruby_generator_helpers-inl.h +++ b/src/compiler/ruby_generator_helpers-inl.h @@ -48,7 +48,7 @@ inline bool ServicesFilename(const grpc::protobuf::FileDescriptor *file, file->name().find_last_of(".proto") == file->name().size() - 1) { *file_name_or_error = file->name().substr(0, file->name().size() - proto_suffix_length) + - "_services.rb"; + "_services_pb.rb"; return true; } else { *file_name_or_error = "Invalid proto file name: must end with .proto"; @@ -58,7 +58,7 @@ inline bool ServicesFilename(const grpc::protobuf::FileDescriptor *file, inline grpc::string MessagesRequireName( const grpc::protobuf::FileDescriptor *file) { - return Replace(file->name(), ".proto", ""); + return Replace(file->name(), ".proto", "_pb"); } // Get leading or trailing comments in a string. Comment lines start with "# ". diff --git a/src/ruby/.rubocop.yml b/src/ruby/.rubocop.yml index 34bb477543..0f61ccfa81 100644 --- a/src/ruby/.rubocop.yml +++ b/src/ruby/.rubocop.yml @@ -5,8 +5,8 @@ inherit_from: .rubocop_todo.yml AllCops: Exclude: - 'bin/apis/**/*' - - 'bin/math.rb' - - 'bin/math_services.rb' + - 'bin/math_pb.rb' + - 'bin/math_services_pb.rb' - 'pb/grpc/health/v1/*' - 'pb/test/**/*' diff --git a/src/ruby/bin/math.rb b/src/ruby/bin/math.rb deleted file mode 100755 index 60429a1505..0000000000 --- a/src/ruby/bin/math.rb +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: math.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "math.DivArgs" do - optional :dividend, :int64, 1 - optional :divisor, :int64, 2 - end - add_message "math.DivReply" do - optional :quotient, :int64, 1 - optional :remainder, :int64, 2 - end - add_message "math.FibArgs" do - optional :limit, :int64, 1 - end - add_message "math.Num" do - optional :num, :int64, 1 - end - add_message "math.FibReply" do - optional :count, :int64, 1 - end -end - -module Math - DivArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.DivArgs").msgclass - DivReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.DivReply").msgclass - FibArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.FibArgs").msgclass - Num = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.Num").msgclass - FibReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.FibReply").msgclass -end diff --git a/src/ruby/bin/math_client.rb b/src/ruby/bin/math_client.rb index d7e00e4293..1f238a798b 100755 --- a/src/ruby/bin/math_client.rb +++ b/src/ruby/bin/math_client.rb @@ -40,7 +40,7 @@ $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir) $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) require 'grpc' -require 'math_services' +require 'math_services_pb' require 'optparse' include GRPC::Core::TimeConsts diff --git a/src/ruby/bin/math_pb.rb b/src/ruby/bin/math_pb.rb new file mode 100644 index 0000000000..60429a1505 --- /dev/null +++ b/src/ruby/bin/math_pb.rb @@ -0,0 +1,32 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: math.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "math.DivArgs" do + optional :dividend, :int64, 1 + optional :divisor, :int64, 2 + end + add_message "math.DivReply" do + optional :quotient, :int64, 1 + optional :remainder, :int64, 2 + end + add_message "math.FibArgs" do + optional :limit, :int64, 1 + end + add_message "math.Num" do + optional :num, :int64, 1 + end + add_message "math.FibReply" do + optional :count, :int64, 1 + end +end + +module Math + DivArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.DivArgs").msgclass + DivReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.DivReply").msgclass + FibArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.FibArgs").msgclass + Num = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.Num").msgclass + FibReply = Google::Protobuf::DescriptorPool.generated_pool.lookup("math.FibReply").msgclass +end diff --git a/src/ruby/bin/math_server.rb b/src/ruby/bin/math_server.rb index 1ee4c5632d..751a6ebcab 100755 --- a/src/ruby/bin/math_server.rb +++ b/src/ruby/bin/math_server.rb @@ -42,7 +42,7 @@ $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) require 'forwardable' require 'grpc' require 'logger' -require 'math_services' +require 'math_services_pb' require 'optparse' # RubyLogger defines a logger for gRPC based on the standard ruby logger. diff --git a/src/ruby/bin/math_services.rb b/src/ruby/bin/math_services.rb deleted file mode 100755 index 34c36abdda..0000000000 --- a/src/ruby/bin/math_services.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: math.proto for package 'math' -# Original file comments: -# Copyright 2015, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -require 'grpc' -require 'math' - -module Math - module Math - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'math.Math' - - # Div divides args.dividend by args.divisor and returns the quotient and - # remainder. - rpc :Div, DivArgs, DivReply - # DivMany accepts an arbitrary number of division args from the client stream - # and sends back the results in the reply stream. The stream continues until - # the client closes its end; the server does the same after sending all the - # replies. The stream ends immediately if either end aborts. - rpc :DivMany, stream(DivArgs), stream(DivReply) - # Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib - # generates up to limit numbers; otherwise it continues until the call is - # canceled. Unlike Fib above, Fib has no final FibReply. - rpc :Fib, FibArgs, stream(Num) - # Sum sums a stream of numbers, returning the final result once the stream - # is closed. - rpc :Sum, stream(Num), Num - end - - Stub = Service.rpc_stub_class - end -end diff --git a/src/ruby/bin/math_services_pb.rb b/src/ruby/bin/math_services_pb.rb new file mode 100644 index 0000000000..2ba1825d4f --- /dev/null +++ b/src/ruby/bin/math_services_pb.rb @@ -0,0 +1,66 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: math.proto for package 'math' +# Original file comments: +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +require 'grpc' +require 'math_pb' + +module Math + module Math + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'math.Math' + + # Div divides DivArgs.dividend by DivArgs.divisor and returns the quotient + # and remainder. + rpc :Div, DivArgs, DivReply + # DivMany accepts an arbitrary number of division args from the client stream + # and sends back the results in the reply stream. The stream continues until + # the client closes its end; the server does the same after sending all the + # replies. The stream ends immediately if either end aborts. + rpc :DivMany, stream(DivArgs), stream(DivReply) + # Fib generates numbers in the Fibonacci sequence. If FibArgs.limit > 0, Fib + # generates up to limit numbers; otherwise it continues until the call is + # canceled. Unlike Fib above, Fib has no final FibReply. + rpc :Fib, FibArgs, stream(Num) + # Sum sums a stream of numbers, returning the final result once the stream + # is closed. + rpc :Sum, stream(Num), Num + end + + Stub = Service.rpc_stub_class + end +end diff --git a/src/ruby/pb/grpc/health/checker.rb b/src/ruby/pb/grpc/health/checker.rb index f7310d9289..4bce1744c4 100644 --- a/src/ruby/pb/grpc/health/checker.rb +++ b/src/ruby/pb/grpc/health/checker.rb @@ -28,7 +28,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'grpc/health/v1/health_services' +require 'grpc/health/v1/health_services_pb' require 'thread' module Grpc diff --git a/src/ruby/pb/grpc/health/v1/health.rb b/src/ruby/pb/grpc/health/v1/health.rb deleted file mode 100644 index aa87a93918..0000000000 --- a/src/ruby/pb/grpc/health/v1/health.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: grpc/health/v1/health.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.health.v1.HealthCheckRequest" do - optional :service, :string, 1 - end - add_message "grpc.health.v1.HealthCheckResponse" do - optional :status, :enum, 1, "grpc.health.v1.HealthCheckResponse.ServingStatus" - end - add_enum "grpc.health.v1.HealthCheckResponse.ServingStatus" do - value :UNKNOWN, 0 - value :SERVING, 1 - value :NOT_SERVING, 2 - end -end - -module Grpc - module Health - module V1 - HealthCheckRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckRequest").msgclass - HealthCheckResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse").msgclass - HealthCheckResponse::ServingStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse.ServingStatus").enummodule - end - end -end diff --git a/src/ruby/pb/grpc/health/v1/health_pb.rb b/src/ruby/pb/grpc/health/v1/health_pb.rb new file mode 100644 index 0000000000..aa87a93918 --- /dev/null +++ b/src/ruby/pb/grpc/health/v1/health_pb.rb @@ -0,0 +1,28 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: grpc/health/v1/health.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.health.v1.HealthCheckRequest" do + optional :service, :string, 1 + end + add_message "grpc.health.v1.HealthCheckResponse" do + optional :status, :enum, 1, "grpc.health.v1.HealthCheckResponse.ServingStatus" + end + add_enum "grpc.health.v1.HealthCheckResponse.ServingStatus" do + value :UNKNOWN, 0 + value :SERVING, 1 + value :NOT_SERVING, 2 + end +end + +module Grpc + module Health + module V1 + HealthCheckRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckRequest").msgclass + HealthCheckResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse").msgclass + HealthCheckResponse::ServingStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.health.v1.HealthCheckResponse.ServingStatus").enummodule + end + end +end diff --git a/src/ruby/pb/grpc/health/v1/health_services.rb b/src/ruby/pb/grpc/health/v1/health_services.rb deleted file mode 100644 index 68a3956f54..0000000000 --- a/src/ruby/pb/grpc/health/v1/health_services.rb +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: grpc/health/v1/health.proto for package 'grpc.health.v1' -# Original file comments: -# Copyright 2015, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -require 'grpc' -require 'grpc/health/v1/health' - -module Grpc - module Health - module V1 - module Health - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.health.v1.Health' - - rpc :Check, HealthCheckRequest, HealthCheckResponse - end - - Stub = Service.rpc_stub_class - end - end - end -end diff --git a/src/ruby/pb/grpc/health/v1/health_services_pb.rb b/src/ruby/pb/grpc/health/v1/health_services_pb.rb new file mode 100644 index 0000000000..8cc01e91dc --- /dev/null +++ b/src/ruby/pb/grpc/health/v1/health_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: grpc/health/v1/health.proto for package 'grpc.health.v1' +# Original file comments: +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +require 'grpc' +require 'grpc/health/v1/health_pb' + +module Grpc + module Health + module V1 + module Health + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.health.v1.Health' + + rpc :Check, HealthCheckRequest, HealthCheckResponse + end + + Stub = Service.rpc_stub_class + end + end + end +end diff --git a/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb b/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb deleted file mode 100644 index eb523ffa6f..0000000000 --- a/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: grpc/testing/duplicate/echo_duplicate.proto for package 'grpc.testing.duplicate' -# Original file comments: -# Copyright 2015, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# This is a partial copy of echo.proto with a different package name. -# - -require 'grpc' -require 'grpc/testing/duplicate/echo_duplicate' - -module Grpc - module Testing - module Duplicate - module EchoTestService - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.duplicate.EchoTestService' - - rpc :Echo, Grpc::Testing::EchoRequest, Grpc::Testing::EchoResponse - end - - Stub = Service.rpc_stub_class - end - end - end -end diff --git a/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services_pb.rb b/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services_pb.rb new file mode 100644 index 0000000000..e51c2f087a --- /dev/null +++ b/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services_pb.rb @@ -0,0 +1,58 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: src/proto/grpc/testing/duplicate/echo_duplicate.proto for package 'grpc.testing.duplicate' +# Original file comments: +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# This is a partial copy of echo.proto with a different package name. +# + +require 'grpc' +require 'src/proto/grpc/testing/duplicate/echo_duplicate_pb' + +module Grpc + module Testing + module Duplicate + module EchoTestService + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.duplicate.EchoTestService' + + rpc :Echo, Grpc::Testing::EchoRequest, Grpc::Testing::EchoResponse + end + + Stub = Service.rpc_stub_class + end + end + end +end diff --git a/src/ruby/pb/grpc/testing/metrics.rb b/src/ruby/pb/grpc/testing/metrics.rb deleted file mode 100644 index 3b3c8cd61b..0000000000 --- a/src/ruby/pb/grpc/testing/metrics.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: grpc/testing/metrics.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.GaugeResponse" do - optional :name, :string, 1 - oneof :value do - optional :long_value, :int64, 2 - optional :double_value, :double, 3 - optional :string_value, :string, 4 - end - end - add_message "grpc.testing.GaugeRequest" do - optional :name, :string, 1 - end - add_message "grpc.testing.EmptyMessage" do - end -end - -module Grpc - module Testing - GaugeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GaugeResponse").msgclass - GaugeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GaugeRequest").msgclass - EmptyMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EmptyMessage").msgclass - end -end diff --git a/src/ruby/pb/grpc/testing/metrics_pb.rb b/src/ruby/pb/grpc/testing/metrics_pb.rb new file mode 100644 index 0000000000..77b6c90970 --- /dev/null +++ b/src/ruby/pb/grpc/testing/metrics_pb.rb @@ -0,0 +1,28 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/metrics.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.testing.GaugeResponse" do + optional :name, :string, 1 + oneof :value do + optional :long_value, :int64, 2 + optional :double_value, :double, 3 + optional :string_value, :string, 4 + end + end + add_message "grpc.testing.GaugeRequest" do + optional :name, :string, 1 + end + add_message "grpc.testing.EmptyMessage" do + end +end + +module Grpc + module Testing + GaugeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GaugeResponse").msgclass + GaugeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.GaugeRequest").msgclass + EmptyMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EmptyMessage").msgclass + end +end diff --git a/src/ruby/pb/grpc/testing/metrics_services.rb b/src/ruby/pb/grpc/testing/metrics_services.rb deleted file mode 100644 index 467b7b3ee5..0000000000 --- a/src/ruby/pb/grpc/testing/metrics_services.rb +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: grpc/testing/metrics.proto for package 'grpc.testing' -# Original file comments: -# Copyright 2015-2016, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Contains the definitions for a metrics service and the type of metrics -# exposed by the service. -# -# Currently, 'Gauge' (i.e a metric that represents the measured value of -# something at an instant of time) is the only metric type supported by the -# service. - -require 'grpc' -require 'grpc/testing/metrics' - -module Grpc - module Testing - module MetricsService - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.MetricsService' - - # Returns the values of all the gauges that are currently being maintained by - # the service - rpc :GetAllGauges, EmptyMessage, stream(GaugeResponse) - # Returns the value of one gauge - rpc :GetGauge, GaugeRequest, GaugeResponse - end - - Stub = Service.rpc_stub_class - end - end -end diff --git a/src/ruby/pb/grpc/testing/metrics_services_pb.rb b/src/ruby/pb/grpc/testing/metrics_services_pb.rb new file mode 100644 index 0000000000..e46366b1fb --- /dev/null +++ b/src/ruby/pb/grpc/testing/metrics_services_pb.rb @@ -0,0 +1,64 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: src/proto/grpc/testing/metrics.proto for package 'grpc.testing' +# Original file comments: +# Copyright 2015-2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Contains the definitions for a metrics service and the type of metrics +# exposed by the service. +# +# Currently, 'Gauge' (i.e a metric that represents the measured value of +# something at an instant of time) is the only metric type supported by the +# service. + +require 'grpc' +require 'src/proto/grpc/testing/metrics_pb' + +module Grpc + module Testing + module MetricsService + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.MetricsService' + + # Returns the values of all the gauges that are currently being maintained by + # the service + rpc :GetAllGauges, EmptyMessage, stream(GaugeResponse) + # Returns the value of one gauge + rpc :GetGauge, GaugeRequest, GaugeResponse + end + + Stub = Service.rpc_stub_class + end + end +end diff --git a/src/ruby/pb/src/proto/grpc/testing/empty.rb b/src/ruby/pb/src/proto/grpc/testing/empty.rb deleted file mode 100644 index 9c2568d605..0000000000 --- a/src/ruby/pb/src/proto/grpc/testing/empty.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/empty.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.Empty" do - end -end - -module Grpc - module Testing - Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Empty").msgclass - end -end diff --git a/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb b/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb new file mode 100644 index 0000000000..9c2568d605 --- /dev/null +++ b/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb @@ -0,0 +1,15 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/empty.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.testing.Empty" do + end +end + +module Grpc + module Testing + Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Empty").msgclass + end +end diff --git a/src/ruby/pb/src/proto/grpc/testing/messages.rb b/src/ruby/pb/src/proto/grpc/testing/messages.rb deleted file mode 100644 index 2bdfe0eade..0000000000 --- a/src/ruby/pb/src/proto/grpc/testing/messages.rb +++ /dev/null @@ -1,84 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/messages.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.Payload" do - optional :type, :enum, 1, "grpc.testing.PayloadType" - optional :body, :bytes, 2 - end - add_message "grpc.testing.EchoStatus" do - optional :code, :int32, 1 - optional :message, :string, 2 - end - add_message "grpc.testing.SimpleRequest" do - optional :response_type, :enum, 1, "grpc.testing.PayloadType" - optional :response_size, :int32, 2 - optional :payload, :message, 3, "grpc.testing.Payload" - optional :fill_username, :bool, 4 - optional :fill_oauth_scope, :bool, 5 - optional :response_compression, :enum, 6, "grpc.testing.CompressionType" - optional :response_status, :message, 7, "grpc.testing.EchoStatus" - end - add_message "grpc.testing.SimpleResponse" do - optional :payload, :message, 1, "grpc.testing.Payload" - optional :username, :string, 2 - optional :oauth_scope, :string, 3 - end - add_message "grpc.testing.StreamingInputCallRequest" do - optional :payload, :message, 1, "grpc.testing.Payload" - end - add_message "grpc.testing.StreamingInputCallResponse" do - optional :aggregated_payload_size, :int32, 1 - end - add_message "grpc.testing.ResponseParameters" do - optional :size, :int32, 1 - optional :interval_us, :int32, 2 - end - add_message "grpc.testing.StreamingOutputCallRequest" do - optional :response_type, :enum, 1, "grpc.testing.PayloadType" - repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters" - optional :payload, :message, 3, "grpc.testing.Payload" - optional :response_compression, :enum, 6, "grpc.testing.CompressionType" - optional :response_status, :message, 7, "grpc.testing.EchoStatus" - end - add_message "grpc.testing.StreamingOutputCallResponse" do - optional :payload, :message, 1, "grpc.testing.Payload" - end - add_message "grpc.testing.ReconnectParams" do - optional :max_reconnect_backoff_ms, :int32, 1 - end - add_message "grpc.testing.ReconnectInfo" do - optional :passed, :bool, 1 - repeated :backoff_ms, :int32, 2 - end - add_enum "grpc.testing.PayloadType" do - value :COMPRESSABLE, 0 - value :UNCOMPRESSABLE, 1 - value :RANDOM, 2 - end - add_enum "grpc.testing.CompressionType" do - value :NONE, 0 - value :GZIP, 1 - value :DEFLATE, 2 - end -end - -module Grpc - module Testing - Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass - EchoStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass - SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass - SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass - StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass - StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass - ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass - StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass - StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass - ReconnectParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectParams").msgclass - ReconnectInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass - PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule - CompressionType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CompressionType").enummodule - end -end diff --git a/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb b/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb new file mode 100644 index 0000000000..e27ccd0dc0 --- /dev/null +++ b/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb @@ -0,0 +1,82 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/messages.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.testing.BoolValue" do + optional :value, :bool, 1 + end + add_message "grpc.testing.Payload" do + optional :type, :enum, 1, "grpc.testing.PayloadType" + optional :body, :bytes, 2 + end + add_message "grpc.testing.EchoStatus" do + optional :code, :int32, 1 + optional :message, :string, 2 + end + add_message "grpc.testing.SimpleRequest" do + optional :response_type, :enum, 1, "grpc.testing.PayloadType" + optional :response_size, :int32, 2 + optional :payload, :message, 3, "grpc.testing.Payload" + optional :fill_username, :bool, 4 + optional :fill_oauth_scope, :bool, 5 + optional :response_compressed, :message, 6, "grpc.testing.BoolValue" + optional :response_status, :message, 7, "grpc.testing.EchoStatus" + optional :expect_compressed, :message, 8, "grpc.testing.BoolValue" + end + add_message "grpc.testing.SimpleResponse" do + optional :payload, :message, 1, "grpc.testing.Payload" + optional :username, :string, 2 + optional :oauth_scope, :string, 3 + end + add_message "grpc.testing.StreamingInputCallRequest" do + optional :payload, :message, 1, "grpc.testing.Payload" + optional :expect_compressed, :message, 2, "grpc.testing.BoolValue" + end + add_message "grpc.testing.StreamingInputCallResponse" do + optional :aggregated_payload_size, :int32, 1 + end + add_message "grpc.testing.ResponseParameters" do + optional :size, :int32, 1 + optional :interval_us, :int32, 2 + optional :compressed, :message, 3, "grpc.testing.BoolValue" + end + add_message "grpc.testing.StreamingOutputCallRequest" do + optional :response_type, :enum, 1, "grpc.testing.PayloadType" + repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters" + optional :payload, :message, 3, "grpc.testing.Payload" + optional :response_status, :message, 7, "grpc.testing.EchoStatus" + end + add_message "grpc.testing.StreamingOutputCallResponse" do + optional :payload, :message, 1, "grpc.testing.Payload" + end + add_message "grpc.testing.ReconnectParams" do + optional :max_reconnect_backoff_ms, :int32, 1 + end + add_message "grpc.testing.ReconnectInfo" do + optional :passed, :bool, 1 + repeated :backoff_ms, :int32, 2 + end + add_enum "grpc.testing.PayloadType" do + value :COMPRESSABLE, 0 + end +end + +module Grpc + module Testing + BoolValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.BoolValue").msgclass + Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass + EchoStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass + SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass + SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass + StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass + StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass + ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass + StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass + StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass + ReconnectParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectParams").msgclass + ReconnectInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass + PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule + end +end diff --git a/src/ruby/pb/src/proto/grpc/testing/test.rb b/src/ruby/pb/src/proto/grpc/testing/test.rb deleted file mode 100644 index 245b5ce00c..0000000000 --- a/src/ruby/pb/src/proto/grpc/testing/test.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/test.proto - -require 'google/protobuf' - -require 'src/proto/grpc/testing/empty' -require 'src/proto/grpc/testing/messages' -Google::Protobuf::DescriptorPool.generated_pool.build do -end - -module Grpc - module Testing - end -end diff --git a/src/ruby/pb/src/proto/grpc/testing/test_pb.rb b/src/ruby/pb/src/proto/grpc/testing/test_pb.rb new file mode 100644 index 0000000000..2cc9863031 --- /dev/null +++ b/src/ruby/pb/src/proto/grpc/testing/test_pb.rb @@ -0,0 +1,14 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/test.proto + +require 'google/protobuf' + +require 'src/proto/grpc/testing/empty_pb' +require 'src/proto/grpc/testing/messages_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do +end + +module Grpc + module Testing + end +end diff --git a/src/ruby/pb/src/proto/grpc/testing/test_services.rb b/src/ruby/pb/src/proto/grpc/testing/test_services.rb deleted file mode 100644 index 2652de5e6d..0000000000 --- a/src/ruby/pb/src/proto/grpc/testing/test_services.rb +++ /dev/null @@ -1,110 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: src/proto/grpc/testing/test.proto for package 'grpc.testing' -# Original file comments: -# Copyright 2015-2016, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# An integration test service that covers all the method signature permutations -# of unary/streaming requests/responses. -# - -require 'grpc' -require 'src/proto/grpc/testing/test' - -module Grpc - module Testing - module TestService - # A simple service to test the various types of RPCs and experiment with - # performance with various types of payload. - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.TestService' - - # One empty request followed by one empty response. - rpc :EmptyCall, Empty, Empty - # One request followed by one response. - rpc :UnaryCall, SimpleRequest, SimpleResponse - # One request followed by a sequence of responses (streamed download). - # The server returns the payload with client desired type and sizes. - rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse) - # A sequence of requests followed by one response (streamed upload). - # The server returns the aggregated size of client payload as the result. - rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse - # A sequence of requests with each request served by the server immediately. - # As one request could lead to multiple responses, this interface - # demonstrates the idea of full duplexing. - rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse) - # A sequence of requests followed by a sequence of responses. - # The server buffers all the client requests and then serves them in order. A - # stream of responses are returned to the client when the server starts with - # first request. - rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse) - end - - Stub = Service.rpc_stub_class - end - module UnimplementedService - # A simple service NOT implemented at servers so clients can test for - # that case. - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.UnimplementedService' - - # A call that no server should implement - rpc :UnimplementedCall, Empty, Empty - end - - Stub = Service.rpc_stub_class - end - module ReconnectService - # A service used to control reconnect server. - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.ReconnectService' - - rpc :Start, ReconnectParams, Empty - rpc :Stop, Empty, ReconnectInfo - end - - Stub = Service.rpc_stub_class - end - end -end diff --git a/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb b/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb new file mode 100644 index 0000000000..fde328e4c5 --- /dev/null +++ b/src/ruby/pb/src/proto/grpc/testing/test_services_pb.rb @@ -0,0 +1,110 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: src/proto/grpc/testing/test.proto for package 'grpc.testing' +# Original file comments: +# Copyright 2015-2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# An integration test service that covers all the method signature permutations +# of unary/streaming requests/responses. +# + +require 'grpc' +require 'src/proto/grpc/testing/test_pb' + +module Grpc + module Testing + module TestService + # A simple service to test the various types of RPCs and experiment with + # performance with various types of payload. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.TestService' + + # One empty request followed by one empty response. + rpc :EmptyCall, Empty, Empty + # One request followed by one response. + rpc :UnaryCall, SimpleRequest, SimpleResponse + # One request followed by a sequence of responses (streamed download). + # The server returns the payload with client desired type and sizes. + rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse) + # A sequence of requests followed by one response (streamed upload). + # The server returns the aggregated size of client payload as the result. + rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse + # A sequence of requests with each request served by the server immediately. + # As one request could lead to multiple responses, this interface + # demonstrates the idea of full duplexing. + rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse) + # A sequence of requests followed by a sequence of responses. + # The server buffers all the client requests and then serves them in order. A + # stream of responses are returned to the client when the server starts with + # first request. + rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse) + end + + Stub = Service.rpc_stub_class + end + module UnimplementedService + # A simple service NOT implemented at servers so clients can test for + # that case. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.UnimplementedService' + + # A call that no server should implement + rpc :UnimplementedCall, Empty, Empty + end + + Stub = Service.rpc_stub_class + end + module ReconnectService + # A service used to control reconnect server. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.ReconnectService' + + rpc :Start, ReconnectParams, Empty + rpc :Stop, Empty, ReconnectInfo + end + + Stub = Service.rpc_stub_class + end + end +end diff --git a/src/ruby/pb/test/client.rb b/src/ruby/pb/test/client.rb index 066a7bb90f..b9af160e7a 100755 --- a/src/ruby/pb/test/client.rb +++ b/src/ruby/pb/test/client.rb @@ -52,9 +52,9 @@ require_relative '../../lib/grpc' require 'googleauth' require 'google/protobuf' -require_relative 'proto/empty' -require_relative 'proto/messages' -require_relative 'proto/test_services' +require_relative '../src/proto/grpc/testing/empty_pb' +require_relative '../src/proto/grpc/testing/messages_pb' +require_relative '../src/proto/grpc/testing/test_services_pb' AUTH_ENV = Google::Auth::CredentialsLoader::ENV_VAR diff --git a/src/ruby/pb/test/proto/empty.rb b/src/ruby/pb/test/proto/empty.rb deleted file mode 100644 index 559adcc85e..0000000000 --- a/src/ruby/pb/test/proto/empty.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: test/proto/empty.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.Empty" do - end -end - -module Grpc - module Testing - Empty = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Empty").msgclass - end -end diff --git a/src/ruby/pb/test/proto/messages.rb b/src/ruby/pb/test/proto/messages.rb deleted file mode 100644 index 5222c9824a..0000000000 --- a/src/ruby/pb/test/proto/messages.rb +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: test/proto/messages.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.Payload" do - optional :type, :enum, 1, "grpc.testing.PayloadType" - optional :body, :bytes, 2 - end - add_message "grpc.testing.EchoStatus" do - optional :code, :int32, 1 - optional :message, :string, 2 - end - add_message "grpc.testing.SimpleRequest" do - optional :response_type, :enum, 1, "grpc.testing.PayloadType" - optional :response_size, :int32, 2 - optional :payload, :message, 3, "grpc.testing.Payload" - optional :fill_username, :bool, 4 - optional :fill_oauth_scope, :bool, 5 - optional :response_compression, :enum, 6, "grpc.testing.CompressionType" - optional :response_status, :message, 7, "grpc.testing.EchoStatus" - end - add_message "grpc.testing.SimpleResponse" do - optional :payload, :message, 1, "grpc.testing.Payload" - optional :username, :string, 2 - optional :oauth_scope, :string, 3 - end - add_message "grpc.testing.StreamingInputCallRequest" do - optional :payload, :message, 1, "grpc.testing.Payload" - end - add_message "grpc.testing.StreamingInputCallResponse" do - optional :aggregated_payload_size, :int32, 1 - end - add_message "grpc.testing.ResponseParameters" do - optional :size, :int32, 1 - optional :interval_us, :int32, 2 - end - add_message "grpc.testing.StreamingOutputCallRequest" do - optional :response_type, :enum, 1, "grpc.testing.PayloadType" - repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters" - optional :payload, :message, 3, "grpc.testing.Payload" - optional :response_compression, :enum, 6, "grpc.testing.CompressionType" - optional :response_status, :message, 7, "grpc.testing.EchoStatus" - end - add_message "grpc.testing.StreamingOutputCallResponse" do - optional :payload, :message, 1, "grpc.testing.Payload" - end - add_message "grpc.testing.ReconnectInfo" do - optional :passed, :bool, 1 - repeated :backoff_ms, :int32, 2 - end - add_enum "grpc.testing.PayloadType" do - value :COMPRESSABLE, 0 - value :UNCOMPRESSABLE, 1 - value :RANDOM, 2 - end - add_enum "grpc.testing.CompressionType" do - value :NONE, 0 - value :GZIP, 1 - value :DEFLATE, 2 - end -end - -module Grpc - module Testing - Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass - EchoStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass - SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass - SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass - StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass - StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass - ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass - StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass - StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass - ReconnectInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass - PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule - CompressionType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CompressionType").enummodule - end -end diff --git a/src/ruby/pb/test/proto/test.rb b/src/ruby/pb/test/proto/test.rb deleted file mode 100644 index 100eb6505c..0000000000 --- a/src/ruby/pb/test/proto/test.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: test/proto/test.proto - -require 'google/protobuf' - -require 'test/proto/empty' -require 'test/proto/messages' -Google::Protobuf::DescriptorPool.generated_pool.build do -end - -module Grpc - module Testing - end -end diff --git a/src/ruby/pb/test/proto/test_services.rb b/src/ruby/pb/test/proto/test_services.rb deleted file mode 100644 index 9df9cc5860..0000000000 --- a/src/ruby/pb/test/proto/test_services.rb +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: test/proto/test.proto for package 'grpc.testing' - -require 'grpc' -require 'test/proto/test' - -module Grpc - module Testing - module TestService - - # TODO: add proto service documentation here - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.TestService' - - rpc :EmptyCall, Empty, Empty - rpc :UnaryCall, SimpleRequest, SimpleResponse - rpc :StreamingOutputCall, StreamingOutputCallRequest, stream(StreamingOutputCallResponse) - rpc :StreamingInputCall, stream(StreamingInputCallRequest), StreamingInputCallResponse - rpc :FullDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse) - rpc :HalfDuplexCall, stream(StreamingOutputCallRequest), stream(StreamingOutputCallResponse) - end - - Stub = Service.rpc_stub_class - end - module UnimplementedService - - # TODO: add proto service documentation here - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.UnimplementedService' - - rpc :UnimplementedCall, Empty, Empty - end - - Stub = Service.rpc_stub_class - end - module ReconnectService - - # TODO: add proto service documentation here - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.ReconnectService' - - rpc :Start, Empty, Empty - rpc :Stop, Empty, ReconnectInfo - end - - Stub = Service.rpc_stub_class - end - end -end diff --git a/src/ruby/pb/test/server.rb b/src/ruby/pb/test/server.rb index 088f281dc4..0808121661 100755 --- a/src/ruby/pb/test/server.rb +++ b/src/ruby/pb/test/server.rb @@ -50,9 +50,9 @@ require 'optparse' require 'grpc' -require 'test/proto/empty' -require 'test/proto/messages' -require 'test/proto/test_services' +require_relative '../src/proto/grpc/testing/empty_pb' +require_relative '../src/proto/grpc/testing/messages_pb' +require_relative '../src/proto/grpc/testing/test_services_pb' # DebugIsTruncated extends the default Logger to truncate debug messages class DebugIsTruncated < Logger diff --git a/src/ruby/qps/client.rb b/src/ruby/qps/client.rb index 917b01271e..7ed648acef 100644 --- a/src/ruby/qps/client.rb +++ b/src/ruby/qps/client.rb @@ -38,7 +38,7 @@ $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) require 'grpc' require 'histogram' -require 'src/proto/grpc/testing/services_services' +require 'src/proto/grpc/testing/services_services_pb' class Poisson def interarrival diff --git a/src/ruby/qps/server.rb b/src/ruby/qps/server.rb index 52a89ce847..cd98ee1fd9 100644 --- a/src/ruby/qps/server.rb +++ b/src/ruby/qps/server.rb @@ -38,9 +38,9 @@ $LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) require 'grpc' require 'qps-common' -require 'src/proto/grpc/testing/messages' -require 'src/proto/grpc/testing/services_services' -require 'src/proto/grpc/testing/stats' +require 'src/proto/grpc/testing/messages_pb' +require 'src/proto/grpc/testing/services_services_pb' +require 'src/proto/grpc/testing/stats_pb' class BenchmarkServiceImpl < Grpc::Testing::BenchmarkService::Service def unary_call(req, _call) diff --git a/src/ruby/qps/src/proto/grpc/testing/control.rb b/src/ruby/qps/src/proto/grpc/testing/control.rb deleted file mode 100644 index 958fca320b..0000000000 --- a/src/ruby/qps/src/proto/grpc/testing/control.rb +++ /dev/null @@ -1,154 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/control.proto - -require 'google/protobuf' - -require 'src/proto/grpc/testing/payloads' -require 'src/proto/grpc/testing/stats' -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.PoissonParams" do - optional :offered_load, :double, 1 - end - add_message "grpc.testing.ClosedLoopParams" do - end - add_message "grpc.testing.LoadParams" do - oneof :load do - optional :closed_loop, :message, 1, "grpc.testing.ClosedLoopParams" - optional :poisson, :message, 2, "grpc.testing.PoissonParams" - end - end - add_message "grpc.testing.SecurityParams" do - optional :use_test_ca, :bool, 1 - optional :server_host_override, :string, 2 - end - add_message "grpc.testing.ClientConfig" do - repeated :server_targets, :string, 1 - optional :client_type, :enum, 2, "grpc.testing.ClientType" - optional :security_params, :message, 3, "grpc.testing.SecurityParams" - optional :outstanding_rpcs_per_channel, :int32, 4 - optional :client_channels, :int32, 5 - optional :async_client_threads, :int32, 7 - optional :rpc_type, :enum, 8, "grpc.testing.RpcType" - optional :load_params, :message, 10, "grpc.testing.LoadParams" - optional :payload_config, :message, 11, "grpc.testing.PayloadConfig" - optional :histogram_params, :message, 12, "grpc.testing.HistogramParams" - repeated :core_list, :int32, 13 - optional :core_limit, :int32, 14 - optional :other_client_api, :string, 15 - end - add_message "grpc.testing.ClientStatus" do - optional :stats, :message, 1, "grpc.testing.ClientStats" - end - add_message "grpc.testing.Mark" do - optional :reset, :bool, 1 - end - add_message "grpc.testing.ClientArgs" do - oneof :argtype do - optional :setup, :message, 1, "grpc.testing.ClientConfig" - optional :mark, :message, 2, "grpc.testing.Mark" - end - end - add_message "grpc.testing.ServerConfig" do - optional :server_type, :enum, 1, "grpc.testing.ServerType" - optional :security_params, :message, 2, "grpc.testing.SecurityParams" - optional :port, :int32, 4 - optional :async_server_threads, :int32, 7 - optional :core_limit, :int32, 8 - optional :payload_config, :message, 9, "grpc.testing.PayloadConfig" - repeated :core_list, :int32, 10 - optional :other_server_api, :string, 11 - end - add_message "grpc.testing.ServerArgs" do - oneof :argtype do - optional :setup, :message, 1, "grpc.testing.ServerConfig" - optional :mark, :message, 2, "grpc.testing.Mark" - end - end - add_message "grpc.testing.ServerStatus" do - optional :stats, :message, 1, "grpc.testing.ServerStats" - optional :port, :int32, 2 - optional :cores, :int32, 3 - end - add_message "grpc.testing.CoreRequest" do - end - add_message "grpc.testing.CoreResponse" do - optional :cores, :int32, 1 - end - add_message "grpc.testing.Void" do - end - add_message "grpc.testing.Scenario" do - optional :name, :string, 1 - optional :client_config, :message, 2, "grpc.testing.ClientConfig" - optional :num_clients, :int32, 3 - optional :server_config, :message, 4, "grpc.testing.ServerConfig" - optional :num_servers, :int32, 5 - optional :warmup_seconds, :int32, 6 - optional :benchmark_seconds, :int32, 7 - optional :spawn_local_worker_count, :int32, 8 - end - add_message "grpc.testing.Scenarios" do - repeated :scenarios, :message, 1, "grpc.testing.Scenario" - end - add_message "grpc.testing.ScenarioResultSummary" do - optional :qps, :double, 1 - optional :qps_per_server_core, :double, 2 - optional :server_system_time, :double, 3 - optional :server_user_time, :double, 4 - optional :client_system_time, :double, 5 - optional :client_user_time, :double, 6 - optional :latency_50, :double, 7 - optional :latency_90, :double, 8 - optional :latency_95, :double, 9 - optional :latency_99, :double, 10 - optional :latency_999, :double, 11 - end - add_message "grpc.testing.ScenarioResult" do - optional :scenario, :message, 1, "grpc.testing.Scenario" - optional :latencies, :message, 2, "grpc.testing.HistogramData" - repeated :client_stats, :message, 3, "grpc.testing.ClientStats" - repeated :server_stats, :message, 4, "grpc.testing.ServerStats" - repeated :server_cores, :int32, 5 - optional :summary, :message, 6, "grpc.testing.ScenarioResultSummary" - end - add_enum "grpc.testing.ClientType" do - value :SYNC_CLIENT, 0 - value :ASYNC_CLIENT, 1 - value :OTHER_CLIENT, 2 - end - add_enum "grpc.testing.ServerType" do - value :SYNC_SERVER, 0 - value :ASYNC_SERVER, 1 - value :ASYNC_GENERIC_SERVER, 2 - value :OTHER_SERVER, 3 - end - add_enum "grpc.testing.RpcType" do - value :UNARY, 0 - value :STREAMING, 1 - end -end - -module Grpc - module Testing - PoissonParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PoissonParams").msgclass - ClosedLoopParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClosedLoopParams").msgclass - LoadParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadParams").msgclass - SecurityParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SecurityParams").msgclass - ClientConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientConfig").msgclass - ClientStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientStatus").msgclass - Mark = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Mark").msgclass - ClientArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientArgs").msgclass - ServerConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerConfig").msgclass - ServerArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerArgs").msgclass - ServerStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerStatus").msgclass - CoreRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CoreRequest").msgclass - CoreResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CoreResponse").msgclass - Void = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Void").msgclass - Scenario = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Scenario").msgclass - Scenarios = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Scenarios").msgclass - ScenarioResultSummary = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ScenarioResultSummary").msgclass - ScenarioResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ScenarioResult").msgclass - ClientType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientType").enummodule - ServerType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerType").enummodule - RpcType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.RpcType").enummodule - end -end diff --git a/src/ruby/qps/src/proto/grpc/testing/control_pb.rb b/src/ruby/qps/src/proto/grpc/testing/control_pb.rb new file mode 100644 index 0000000000..02207a2b5d --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/control_pb.rb @@ -0,0 +1,156 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/control.proto + +require 'google/protobuf' + +require 'src/proto/grpc/testing/payloads_pb' +require 'src/proto/grpc/testing/stats_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.testing.PoissonParams" do + optional :offered_load, :double, 1 + end + add_message "grpc.testing.ClosedLoopParams" do + end + add_message "grpc.testing.LoadParams" do + oneof :load do + optional :closed_loop, :message, 1, "grpc.testing.ClosedLoopParams" + optional :poisson, :message, 2, "grpc.testing.PoissonParams" + end + end + add_message "grpc.testing.SecurityParams" do + optional :use_test_ca, :bool, 1 + optional :server_host_override, :string, 2 + end + add_message "grpc.testing.ClientConfig" do + repeated :server_targets, :string, 1 + optional :client_type, :enum, 2, "grpc.testing.ClientType" + optional :security_params, :message, 3, "grpc.testing.SecurityParams" + optional :outstanding_rpcs_per_channel, :int32, 4 + optional :client_channels, :int32, 5 + optional :async_client_threads, :int32, 7 + optional :rpc_type, :enum, 8, "grpc.testing.RpcType" + optional :load_params, :message, 10, "grpc.testing.LoadParams" + optional :payload_config, :message, 11, "grpc.testing.PayloadConfig" + optional :histogram_params, :message, 12, "grpc.testing.HistogramParams" + repeated :core_list, :int32, 13 + optional :core_limit, :int32, 14 + optional :other_client_api, :string, 15 + end + add_message "grpc.testing.ClientStatus" do + optional :stats, :message, 1, "grpc.testing.ClientStats" + end + add_message "grpc.testing.Mark" do + optional :reset, :bool, 1 + end + add_message "grpc.testing.ClientArgs" do + oneof :argtype do + optional :setup, :message, 1, "grpc.testing.ClientConfig" + optional :mark, :message, 2, "grpc.testing.Mark" + end + end + add_message "grpc.testing.ServerConfig" do + optional :server_type, :enum, 1, "grpc.testing.ServerType" + optional :security_params, :message, 2, "grpc.testing.SecurityParams" + optional :port, :int32, 4 + optional :async_server_threads, :int32, 7 + optional :core_limit, :int32, 8 + optional :payload_config, :message, 9, "grpc.testing.PayloadConfig" + repeated :core_list, :int32, 10 + optional :other_server_api, :string, 11 + end + add_message "grpc.testing.ServerArgs" do + oneof :argtype do + optional :setup, :message, 1, "grpc.testing.ServerConfig" + optional :mark, :message, 2, "grpc.testing.Mark" + end + end + add_message "grpc.testing.ServerStatus" do + optional :stats, :message, 1, "grpc.testing.ServerStats" + optional :port, :int32, 2 + optional :cores, :int32, 3 + end + add_message "grpc.testing.CoreRequest" do + end + add_message "grpc.testing.CoreResponse" do + optional :cores, :int32, 1 + end + add_message "grpc.testing.Void" do + end + add_message "grpc.testing.Scenario" do + optional :name, :string, 1 + optional :client_config, :message, 2, "grpc.testing.ClientConfig" + optional :num_clients, :int32, 3 + optional :server_config, :message, 4, "grpc.testing.ServerConfig" + optional :num_servers, :int32, 5 + optional :warmup_seconds, :int32, 6 + optional :benchmark_seconds, :int32, 7 + optional :spawn_local_worker_count, :int32, 8 + end + add_message "grpc.testing.Scenarios" do + repeated :scenarios, :message, 1, "grpc.testing.Scenario" + end + add_message "grpc.testing.ScenarioResultSummary" do + optional :qps, :double, 1 + optional :qps_per_server_core, :double, 2 + optional :server_system_time, :double, 3 + optional :server_user_time, :double, 4 + optional :client_system_time, :double, 5 + optional :client_user_time, :double, 6 + optional :latency_50, :double, 7 + optional :latency_90, :double, 8 + optional :latency_95, :double, 9 + optional :latency_99, :double, 10 + optional :latency_999, :double, 11 + end + add_message "grpc.testing.ScenarioResult" do + optional :scenario, :message, 1, "grpc.testing.Scenario" + optional :latencies, :message, 2, "grpc.testing.HistogramData" + repeated :client_stats, :message, 3, "grpc.testing.ClientStats" + repeated :server_stats, :message, 4, "grpc.testing.ServerStats" + repeated :server_cores, :int32, 5 + optional :summary, :message, 6, "grpc.testing.ScenarioResultSummary" + repeated :client_success, :bool, 7 + repeated :server_success, :bool, 8 + end + add_enum "grpc.testing.ClientType" do + value :SYNC_CLIENT, 0 + value :ASYNC_CLIENT, 1 + value :OTHER_CLIENT, 2 + end + add_enum "grpc.testing.ServerType" do + value :SYNC_SERVER, 0 + value :ASYNC_SERVER, 1 + value :ASYNC_GENERIC_SERVER, 2 + value :OTHER_SERVER, 3 + end + add_enum "grpc.testing.RpcType" do + value :UNARY, 0 + value :STREAMING, 1 + end +end + +module Grpc + module Testing + PoissonParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PoissonParams").msgclass + ClosedLoopParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClosedLoopParams").msgclass + LoadParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.LoadParams").msgclass + SecurityParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SecurityParams").msgclass + ClientConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientConfig").msgclass + ClientStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientStatus").msgclass + Mark = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Mark").msgclass + ClientArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientArgs").msgclass + ServerConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerConfig").msgclass + ServerArgs = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerArgs").msgclass + ServerStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerStatus").msgclass + CoreRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CoreRequest").msgclass + CoreResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CoreResponse").msgclass + Void = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Void").msgclass + Scenario = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Scenario").msgclass + Scenarios = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Scenarios").msgclass + ScenarioResultSummary = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ScenarioResultSummary").msgclass + ScenarioResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ScenarioResult").msgclass + ClientType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientType").enummodule + ServerType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerType").enummodule + RpcType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.RpcType").enummodule + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/messages.rb b/src/ruby/qps/src/proto/grpc/testing/messages.rb deleted file mode 100644 index 2bdfe0eade..0000000000 --- a/src/ruby/qps/src/proto/grpc/testing/messages.rb +++ /dev/null @@ -1,84 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/messages.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.Payload" do - optional :type, :enum, 1, "grpc.testing.PayloadType" - optional :body, :bytes, 2 - end - add_message "grpc.testing.EchoStatus" do - optional :code, :int32, 1 - optional :message, :string, 2 - end - add_message "grpc.testing.SimpleRequest" do - optional :response_type, :enum, 1, "grpc.testing.PayloadType" - optional :response_size, :int32, 2 - optional :payload, :message, 3, "grpc.testing.Payload" - optional :fill_username, :bool, 4 - optional :fill_oauth_scope, :bool, 5 - optional :response_compression, :enum, 6, "grpc.testing.CompressionType" - optional :response_status, :message, 7, "grpc.testing.EchoStatus" - end - add_message "grpc.testing.SimpleResponse" do - optional :payload, :message, 1, "grpc.testing.Payload" - optional :username, :string, 2 - optional :oauth_scope, :string, 3 - end - add_message "grpc.testing.StreamingInputCallRequest" do - optional :payload, :message, 1, "grpc.testing.Payload" - end - add_message "grpc.testing.StreamingInputCallResponse" do - optional :aggregated_payload_size, :int32, 1 - end - add_message "grpc.testing.ResponseParameters" do - optional :size, :int32, 1 - optional :interval_us, :int32, 2 - end - add_message "grpc.testing.StreamingOutputCallRequest" do - optional :response_type, :enum, 1, "grpc.testing.PayloadType" - repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters" - optional :payload, :message, 3, "grpc.testing.Payload" - optional :response_compression, :enum, 6, "grpc.testing.CompressionType" - optional :response_status, :message, 7, "grpc.testing.EchoStatus" - end - add_message "grpc.testing.StreamingOutputCallResponse" do - optional :payload, :message, 1, "grpc.testing.Payload" - end - add_message "grpc.testing.ReconnectParams" do - optional :max_reconnect_backoff_ms, :int32, 1 - end - add_message "grpc.testing.ReconnectInfo" do - optional :passed, :bool, 1 - repeated :backoff_ms, :int32, 2 - end - add_enum "grpc.testing.PayloadType" do - value :COMPRESSABLE, 0 - value :UNCOMPRESSABLE, 1 - value :RANDOM, 2 - end - add_enum "grpc.testing.CompressionType" do - value :NONE, 0 - value :GZIP, 1 - value :DEFLATE, 2 - end -end - -module Grpc - module Testing - Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass - EchoStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass - SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass - SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass - StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass - StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass - ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass - StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass - StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass - ReconnectParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectParams").msgclass - ReconnectInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass - PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule - CompressionType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.CompressionType").enummodule - end -end diff --git a/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb b/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb new file mode 100644 index 0000000000..e27ccd0dc0 --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/messages_pb.rb @@ -0,0 +1,82 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/messages.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.testing.BoolValue" do + optional :value, :bool, 1 + end + add_message "grpc.testing.Payload" do + optional :type, :enum, 1, "grpc.testing.PayloadType" + optional :body, :bytes, 2 + end + add_message "grpc.testing.EchoStatus" do + optional :code, :int32, 1 + optional :message, :string, 2 + end + add_message "grpc.testing.SimpleRequest" do + optional :response_type, :enum, 1, "grpc.testing.PayloadType" + optional :response_size, :int32, 2 + optional :payload, :message, 3, "grpc.testing.Payload" + optional :fill_username, :bool, 4 + optional :fill_oauth_scope, :bool, 5 + optional :response_compressed, :message, 6, "grpc.testing.BoolValue" + optional :response_status, :message, 7, "grpc.testing.EchoStatus" + optional :expect_compressed, :message, 8, "grpc.testing.BoolValue" + end + add_message "grpc.testing.SimpleResponse" do + optional :payload, :message, 1, "grpc.testing.Payload" + optional :username, :string, 2 + optional :oauth_scope, :string, 3 + end + add_message "grpc.testing.StreamingInputCallRequest" do + optional :payload, :message, 1, "grpc.testing.Payload" + optional :expect_compressed, :message, 2, "grpc.testing.BoolValue" + end + add_message "grpc.testing.StreamingInputCallResponse" do + optional :aggregated_payload_size, :int32, 1 + end + add_message "grpc.testing.ResponseParameters" do + optional :size, :int32, 1 + optional :interval_us, :int32, 2 + optional :compressed, :message, 3, "grpc.testing.BoolValue" + end + add_message "grpc.testing.StreamingOutputCallRequest" do + optional :response_type, :enum, 1, "grpc.testing.PayloadType" + repeated :response_parameters, :message, 2, "grpc.testing.ResponseParameters" + optional :payload, :message, 3, "grpc.testing.Payload" + optional :response_status, :message, 7, "grpc.testing.EchoStatus" + end + add_message "grpc.testing.StreamingOutputCallResponse" do + optional :payload, :message, 1, "grpc.testing.Payload" + end + add_message "grpc.testing.ReconnectParams" do + optional :max_reconnect_backoff_ms, :int32, 1 + end + add_message "grpc.testing.ReconnectInfo" do + optional :passed, :bool, 1 + repeated :backoff_ms, :int32, 2 + end + add_enum "grpc.testing.PayloadType" do + value :COMPRESSABLE, 0 + end +end + +module Grpc + module Testing + BoolValue = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.BoolValue").msgclass + Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.Payload").msgclass + EchoStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.EchoStatus").msgclass + SimpleRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleRequest").msgclass + SimpleResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleResponse").msgclass + StreamingInputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallRequest").msgclass + StreamingInputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingInputCallResponse").msgclass + ResponseParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ResponseParameters").msgclass + StreamingOutputCallRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallRequest").msgclass + StreamingOutputCallResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.StreamingOutputCallResponse").msgclass + ReconnectParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectParams").msgclass + ReconnectInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ReconnectInfo").msgclass + PayloadType = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadType").enummodule + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/payloads.rb b/src/ruby/qps/src/proto/grpc/testing/payloads.rb deleted file mode 100644 index ae8855f685..0000000000 --- a/src/ruby/qps/src/proto/grpc/testing/payloads.rb +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/payloads.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.ByteBufferParams" do - optional :req_size, :int32, 1 - optional :resp_size, :int32, 2 - end - add_message "grpc.testing.SimpleProtoParams" do - optional :req_size, :int32, 1 - optional :resp_size, :int32, 2 - end - add_message "grpc.testing.ComplexProtoParams" do - end - add_message "grpc.testing.PayloadConfig" do - oneof :payload do - optional :bytebuf_params, :message, 1, "grpc.testing.ByteBufferParams" - optional :simple_params, :message, 2, "grpc.testing.SimpleProtoParams" - optional :complex_params, :message, 3, "grpc.testing.ComplexProtoParams" - end - end -end - -module Grpc - module Testing - ByteBufferParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ByteBufferParams").msgclass - SimpleProtoParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleProtoParams").msgclass - ComplexProtoParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ComplexProtoParams").msgclass - PayloadConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadConfig").msgclass - end -end diff --git a/src/ruby/qps/src/proto/grpc/testing/payloads_pb.rb b/src/ruby/qps/src/proto/grpc/testing/payloads_pb.rb new file mode 100644 index 0000000000..ae8855f685 --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/payloads_pb.rb @@ -0,0 +1,33 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/payloads.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.testing.ByteBufferParams" do + optional :req_size, :int32, 1 + optional :resp_size, :int32, 2 + end + add_message "grpc.testing.SimpleProtoParams" do + optional :req_size, :int32, 1 + optional :resp_size, :int32, 2 + end + add_message "grpc.testing.ComplexProtoParams" do + end + add_message "grpc.testing.PayloadConfig" do + oneof :payload do + optional :bytebuf_params, :message, 1, "grpc.testing.ByteBufferParams" + optional :simple_params, :message, 2, "grpc.testing.SimpleProtoParams" + optional :complex_params, :message, 3, "grpc.testing.ComplexProtoParams" + end + end +end + +module Grpc + module Testing + ByteBufferParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ByteBufferParams").msgclass + SimpleProtoParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.SimpleProtoParams").msgclass + ComplexProtoParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ComplexProtoParams").msgclass + PayloadConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.PayloadConfig").msgclass + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/services.rb b/src/ruby/qps/src/proto/grpc/testing/services.rb deleted file mode 100644 index b2675c2afe..0000000000 --- a/src/ruby/qps/src/proto/grpc/testing/services.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/services.proto - -require 'google/protobuf' - -require 'src/proto/grpc/testing/messages' -require 'src/proto/grpc/testing/control' -Google::Protobuf::DescriptorPool.generated_pool.build do -end - -module Grpc - module Testing - end -end diff --git a/src/ruby/qps/src/proto/grpc/testing/services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/services_pb.rb new file mode 100644 index 0000000000..5ce13bf8b0 --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/services_pb.rb @@ -0,0 +1,14 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/services.proto + +require 'google/protobuf' + +require 'src/proto/grpc/testing/messages_pb' +require 'src/proto/grpc/testing/control_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do +end + +module Grpc + module Testing + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/services_services.rb b/src/ruby/qps/src/proto/grpc/testing/services_services.rb deleted file mode 100644 index 94b9a1e164..0000000000 --- a/src/ruby/qps/src/proto/grpc/testing/services_services.rb +++ /dev/null @@ -1,92 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: src/proto/grpc/testing/services.proto for package 'grpc.testing' -# Original file comments: -# Copyright 2015, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# An integration test service that covers all the method signature permutations -# of unary/streaming requests/responses. - -require 'grpc' -require 'src/proto/grpc/testing/services' - -module Grpc - module Testing - module BenchmarkService - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.BenchmarkService' - - # One request followed by one response. - # The server returns the client payload as-is. - rpc :UnaryCall, SimpleRequest, SimpleResponse - # One request followed by one response. - # The server returns the client payload as-is. - rpc :StreamingCall, stream(SimpleRequest), stream(SimpleResponse) - end - - Stub = Service.rpc_stub_class - end - module WorkerService - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'grpc.testing.WorkerService' - - # Start server with specified workload. - # First request sent specifies the ServerConfig followed by ServerStatus - # response. After that, a "Mark" can be sent anytime to request the latest - # stats. Closing the stream will initiate shutdown of the test server - # and once the shutdown has finished, the OK status is sent to terminate - # this RPC. - rpc :RunServer, stream(ServerArgs), stream(ServerStatus) - # Start client with specified workload. - # First request sent specifies the ClientConfig followed by ClientStatus - # response. After that, a "Mark" can be sent anytime to request the latest - # stats. Closing the stream will initiate shutdown of the test client - # and once the shutdown has finished, the OK status is sent to terminate - # this RPC. - rpc :RunClient, stream(ClientArgs), stream(ClientStatus) - # Just return the core count - unary call - rpc :CoreCount, CoreRequest, CoreResponse - # Quit this worker - rpc :QuitWorker, Void, Void - end - - Stub = Service.rpc_stub_class - end - end -end diff --git a/src/ruby/qps/src/proto/grpc/testing/services_services_pb.rb b/src/ruby/qps/src/proto/grpc/testing/services_services_pb.rb new file mode 100644 index 0000000000..bdbb9c86d0 --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/services_services_pb.rb @@ -0,0 +1,92 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: src/proto/grpc/testing/services.proto for package 'grpc.testing' +# Original file comments: +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# An integration test service that covers all the method signature permutations +# of unary/streaming requests/responses. + +require 'grpc' +require 'src/proto/grpc/testing/services_pb' + +module Grpc + module Testing + module BenchmarkService + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.BenchmarkService' + + # One request followed by one response. + # The server returns the client payload as-is. + rpc :UnaryCall, SimpleRequest, SimpleResponse + # One request followed by one response. + # The server returns the client payload as-is. + rpc :StreamingCall, stream(SimpleRequest), stream(SimpleResponse) + end + + Stub = Service.rpc_stub_class + end + module WorkerService + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'grpc.testing.WorkerService' + + # Start server with specified workload. + # First request sent specifies the ServerConfig followed by ServerStatus + # response. After that, a "Mark" can be sent anytime to request the latest + # stats. Closing the stream will initiate shutdown of the test server + # and once the shutdown has finished, the OK status is sent to terminate + # this RPC. + rpc :RunServer, stream(ServerArgs), stream(ServerStatus) + # Start client with specified workload. + # First request sent specifies the ClientConfig followed by ClientStatus + # response. After that, a "Mark" can be sent anytime to request the latest + # stats. Closing the stream will initiate shutdown of the test client + # and once the shutdown has finished, the OK status is sent to terminate + # this RPC. + rpc :RunClient, stream(ClientArgs), stream(ClientStatus) + # Just return the core count - unary call + rpc :CoreCount, CoreRequest, CoreResponse + # Quit this worker + rpc :QuitWorker, Void, Void + end + + Stub = Service.rpc_stub_class + end + end +end diff --git a/src/ruby/qps/src/proto/grpc/testing/stats.rb b/src/ruby/qps/src/proto/grpc/testing/stats.rb deleted file mode 100644 index 41f75bedf0..0000000000 --- a/src/ruby/qps/src/proto/grpc/testing/stats.rb +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: src/proto/grpc/testing/stats.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "grpc.testing.ServerStats" do - optional :time_elapsed, :double, 1 - optional :time_user, :double, 2 - optional :time_system, :double, 3 - end - add_message "grpc.testing.HistogramParams" do - optional :resolution, :double, 1 - optional :max_possible, :double, 2 - end - add_message "grpc.testing.HistogramData" do - repeated :bucket, :uint32, 1 - optional :min_seen, :double, 2 - optional :max_seen, :double, 3 - optional :sum, :double, 4 - optional :sum_of_squares, :double, 5 - optional :count, :double, 6 - end - add_message "grpc.testing.ClientStats" do - optional :latencies, :message, 1, "grpc.testing.HistogramData" - optional :time_elapsed, :double, 2 - optional :time_user, :double, 3 - optional :time_system, :double, 4 - end -end - -module Grpc - module Testing - ServerStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerStats").msgclass - HistogramParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.HistogramParams").msgclass - HistogramData = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.HistogramData").msgclass - ClientStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientStats").msgclass - end -end diff --git a/src/ruby/qps/src/proto/grpc/testing/stats_pb.rb b/src/ruby/qps/src/proto/grpc/testing/stats_pb.rb new file mode 100644 index 0000000000..41f75bedf0 --- /dev/null +++ b/src/ruby/qps/src/proto/grpc/testing/stats_pb.rb @@ -0,0 +1,39 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: src/proto/grpc/testing/stats.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "grpc.testing.ServerStats" do + optional :time_elapsed, :double, 1 + optional :time_user, :double, 2 + optional :time_system, :double, 3 + end + add_message "grpc.testing.HistogramParams" do + optional :resolution, :double, 1 + optional :max_possible, :double, 2 + end + add_message "grpc.testing.HistogramData" do + repeated :bucket, :uint32, 1 + optional :min_seen, :double, 2 + optional :max_seen, :double, 3 + optional :sum, :double, 4 + optional :sum_of_squares, :double, 5 + optional :count, :double, 6 + end + add_message "grpc.testing.ClientStats" do + optional :latencies, :message, 1, "grpc.testing.HistogramData" + optional :time_elapsed, :double, 2 + optional :time_user, :double, 3 + optional :time_system, :double, 4 + end +end + +module Grpc + module Testing + ServerStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ServerStats").msgclass + HistogramParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.HistogramParams").msgclass + HistogramData = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.HistogramData").msgclass + ClientStats = Google::Protobuf::DescriptorPool.generated_pool.lookup("grpc.testing.ClientStats").msgclass + end +end diff --git a/src/ruby/qps/worker.rb b/src/ruby/qps/worker.rb index 665fb86352..12b8087ca0 100755 --- a/src/ruby/qps/worker.rb +++ b/src/ruby/qps/worker.rb @@ -44,7 +44,7 @@ require 'facter' require 'client' require 'qps-common' require 'server' -require 'src/proto/grpc/testing/services_services' +require 'src/proto/grpc/testing/services_services_pb' class WorkerServiceImpl < Grpc::Testing::WorkerService::Service def cpu_cores diff --git a/src/ruby/spec/pb/duplicate/codegen_spec.rb b/src/ruby/spec/pb/duplicate/codegen_spec.rb index 54c136c510..ea0240965c 100644 --- a/src/ruby/spec/pb/duplicate/codegen_spec.rb +++ b/src/ruby/spec/pb/duplicate/codegen_spec.rb @@ -44,7 +44,7 @@ describe 'Ping protobuf code generation' do # Get the current content service_path = File.join(root_dir, 'src', 'ruby', 'pb', 'grpc', 'testing', 'duplicate', - 'echo_duplicate_services.rb') + 'echo_duplicate_services_pb.rb') want = nil File.open(service_path) { |f| want = f.read } @@ -54,7 +54,7 @@ describe 'Ping protobuf code generation' do got = nil Dir.mktmpdir do |tmp_dir| gen_out = File.join(tmp_dir, 'src', 'proto', 'grpc', 'testing', - 'duplicate', 'echo_duplicate_services.rb') + 'duplicate', 'echo_duplicate_services_pb.rb') pid = spawn( 'protoc', '-I.', diff --git a/src/ruby/spec/pb/health/checker_spec.rb b/src/ruby/spec/pb/health/checker_spec.rb index de11c9fedf..1b2fa96827 100644 --- a/src/ruby/spec/pb/health/checker_spec.rb +++ b/src/ruby/spec/pb/health/checker_spec.rb @@ -28,7 +28,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. require 'grpc' -require 'grpc/health/v1/health' +require 'grpc/health/v1/health_pb' require 'grpc/health/checker' require 'open3' require 'tmpdir' @@ -43,7 +43,7 @@ describe 'Health protobuf code generation' do skip 'protoc || grpc_ruby_plugin missing, cannot verify health code-gen' else it 'should already be loaded indirectly i.e, used by the other specs' do - expect(require('grpc/health/v1/health_services')).to be(false) + expect(require('grpc/health/v1/health_services_pb')).to be(false) end it 'should have the same content as created by code generation' do @@ -52,7 +52,7 @@ describe 'Health protobuf code generation' do # Get the current content service_path = File.join(root_dir, 'ruby', 'pb', 'grpc', - 'health', 'v1', 'health_services.rb') + 'health', 'v1', 'health_services_pb.rb') want = nil File.open(service_path) { |f| want = f.read } @@ -62,7 +62,7 @@ describe 'Health protobuf code generation' do got = nil Dir.mktmpdir do |tmp_dir| gen_out = File.join(tmp_dir, 'grpc', 'health', 'v1', - 'health_services.rb') + 'health_services_pb.rb') pid = spawn( 'protoc', '-I.', diff --git a/src/ruby/stress/metrics_server.rb b/src/ruby/stress/metrics_server.rb index 13638c4d21..2b7f78577d 100644 --- a/src/ruby/stress/metrics_server.rb +++ b/src/ruby/stress/metrics_server.rb @@ -27,8 +27,8 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -require_relative '../pb/grpc/testing/metrics.rb' -require_relative '../pb/grpc/testing/metrics_services.rb' +require_relative '../pb/grpc/testing/metrics_pb.rb' +require_relative '../pb/grpc/testing/metrics_services_pb.rb' class Gauge def get_name -- cgit v1.2.3 From 011d1efc8f109a392304b51985fce790ae2d8c22 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Wed, 27 Jul 2016 09:44:49 +0800 Subject: add macro to php7_wrapper for reduce duplicate code --- src/php/ext/grpc/call.c | 24 ++++++------------------ src/php/ext/grpc/call_credentials.c | 26 ++++++-------------------- src/php/ext/grpc/call_credentials.h | 4 ++-- src/php/ext/grpc/channel.c | 24 ++++++------------------ src/php/ext/grpc/channel_credentials.c | 26 ++++++-------------------- src/php/ext/grpc/channel_credentials.h | 7 +++---- src/php/ext/grpc/php7_wrapper.h | 18 ++++++++++++++++++ src/php/ext/grpc/server.c | 32 ++++++++------------------------ src/php/ext/grpc/server_credentials.c | 26 ++++++-------------------- src/php/ext/grpc/server_credentials.h | 4 ++-- src/php/ext/grpc/timeval.c | 17 ++++------------- 11 files changed, 67 insertions(+), 141 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index fc832dacc2..add6841039 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -59,17 +59,14 @@ zend_class_entry *grpc_ce_call; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_call */ -void free_wrapped_grpc_call(void *object TSRMLS_DC) { - wrapped_grpc_call *call = (wrapped_grpc_call *)object; - if (call->owned && call->wrapped != NULL) { - grpc_call_destroy(call->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call) + if (p->owned && p->wrapped != NULL) { + grpc_call_destroy(p->wrapped); } - zend_object_std_dtor(&call->std TSRMLS_CC); - efree(call); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ @@ -94,15 +91,6 @@ zend_object_value create_wrapped_grpc_call(zend_class_entry *class_type static zend_object_handlers call_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_call */ -static void free_wrapped_grpc_call(zend_object *object) { - wrapped_grpc_call *call = wrapped_grpc_call_from_obj(object); - if (call->owned && call->wrapped != NULL) { - grpc_call_destroy(call->wrapped); - } - zend_object_std_dtor(&call->std); -} - /* Initializes an instance of wrapped_grpc_call to be associated with an * object of a class specified by class_type */ zend_object *create_wrapped_grpc_call(zend_class_entry *class_type) { diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index 29762afb29..aa589b0387 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -53,18 +53,14 @@ zend_class_entry *grpc_ce_call_credentials; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_call_credentials */ -void free_wrapped_grpc_call_credentials(void *object TSRMLS_DC) { - wrapped_grpc_call_credentials *creds = - (wrapped_grpc_call_credentials *)object; - if (creds->wrapped != NULL) { - grpc_call_credentials_release(creds->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call_credentials) + if (p->wrapped != NULL) { + grpc_call_credentials_release(p->wrapped); } - zend_object_std_dtor(&creds->std TSRMLS_CC); - efree(creds); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_call_credentials to be * associated with an object of a class specified by class_type */ @@ -90,16 +86,6 @@ zend_object_value create_wrapped_grpc_call_credentials( static zend_object_handlers call_credentials_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_call_credentials */ -static void free_wrapped_grpc_call_credentials(zend_object *object) { - wrapped_grpc_call_credentials *creds = - wrapped_grpc_call_creds_from_obj(object); - if (creds->wrapped != NULL) { - grpc_call_credentials_release(creds->wrapped); - } - zend_object_std_dtor(&creds->std); -} - /* Initializes an instance of wrapped_grpc_call_credentials to be * associated with an object of a class specified by class_type */ zend_object *create_wrapped_grpc_call_credentials(zend_class_entry diff --git a/src/php/ext/grpc/call_credentials.h b/src/php/ext/grpc/call_credentials.h index 822d077ccb..8014b75c70 100755 --- a/src/php/ext/grpc/call_credentials.h +++ b/src/php/ext/grpc/call_credentials.h @@ -63,7 +63,7 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_call_credentials) #else static inline wrapped_grpc_call_credentials -*wrapped_grpc_call_creds_from_obj(zend_object *obj) { +*wrapped_grpc_call_credentials_from_obj(zend_object *obj) { return (wrapped_grpc_call_credentials*)((char*)(obj) - XtOffsetOf(wrapped_grpc_call_credentials, @@ -71,7 +71,7 @@ static inline wrapped_grpc_call_credentials } #define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \ - wrapped_grpc_call_creds_from_obj(Z_OBJ_P((zv))) + wrapped_grpc_call_credentials_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 18ebcabc26..9c4b265e94 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -57,17 +57,14 @@ zend_class_entry *grpc_ce_channel; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_channel */ -void free_wrapped_grpc_channel(void *object TSRMLS_DC) { - wrapped_grpc_channel *channel = (wrapped_grpc_channel *)object; - if (channel->wrapped != NULL) { - grpc_channel_destroy(channel->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel) + if (p->wrapped != NULL) { + grpc_channel_destroy(p->wrapped); } - zend_object_std_dtor(&channel->std TSRMLS_CC); - efree(channel); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_channel to be associated with an * object of a class specified by class_type */ @@ -90,15 +87,6 @@ zend_object_value create_wrapped_grpc_channel(zend_class_entry *class_type static zend_object_handlers channel_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_channel */ -static void free_wrapped_grpc_channel(zend_object *object) { - wrapped_grpc_channel *channel = wrapped_grpc_channel_from_obj(object); - if (channel->wrapped != NULL) { - grpc_channel_destroy(channel->wrapped); - } - zend_object_std_dtor(&channel->std); -} - /* Initializes an instance of wrapped_grpc_channel to be associated with an * object of a class specified by class_type */ zend_object *create_wrapped_grpc_channel(zend_class_entry *class_type) { diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 1c2ea5ba82..938134cd9c 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -63,18 +63,14 @@ static grpc_ssl_roots_override_result get_ssl_roots_override( return GRPC_SSL_ROOTS_OVERRIDE_OK; } -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_channel_credentials */ -void free_wrapped_grpc_channel_credentials(void *object TSRMLS_DC) { - wrapped_grpc_channel_credentials *creds = - (wrapped_grpc_channel_credentials *)object; - if (creds->wrapped != NULL) { - grpc_channel_credentials_release(creds->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel_credentials) + if (p->wrapped != NULL) { + grpc_channel_credentials_release(p->wrapped); } - zend_object_std_dtor(&creds->std TSRMLS_CC); - efree(creds); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_channel_credentials to be * associated with an object of a class specified by class_type */ @@ -100,16 +96,6 @@ zend_object_value create_wrapped_grpc_channel_credentials( static zend_object_handlers channel_credentials_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_channel_credentials */ -static void free_wrapped_grpc_channel_credentials(zend_object *object) { - wrapped_grpc_channel_credentials *creds = - wrapped_grpc_channel_creds_from_obj(object); - if (creds->wrapped != NULL) { - grpc_channel_credentials_release(creds->wrapped); - } - zend_object_std_dtor(&creds->std); -} - /* Initializes an instance of wrapped_grpc_channel_credentials to be * associated with an object of a class specified by class_type */ zend_object *create_wrapped_grpc_channel_credentials(zend_class_entry diff --git a/src/php/ext/grpc/channel_credentials.h b/src/php/ext/grpc/channel_credentials.h index 21225db5fb..39dc85283d 100755 --- a/src/php/ext/grpc/channel_credentials.h +++ b/src/php/ext/grpc/channel_credentials.h @@ -63,15 +63,14 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_channel_credentials) #else static inline wrapped_grpc_channel_credentials -*wrapped_grpc_channel_creds_from_obj(zend_object *obj) { +*wrapped_grpc_channel_credentials_from_obj(zend_object *obj) { return (wrapped_grpc_channel_credentials *) - ((char*)(obj) - - XtOffsetOf(wrapped_grpc_channel_credentials, std)); + ((char*)(obj) - XtOffsetOf(wrapped_grpc_channel_credentials, std)); } #define Z_WRAPPED_GRPC_CHANNEL_CREDS_P(zv) \ - wrapped_grpc_channel_creds_from_obj(Z_OBJ_P((zv))) + wrapped_grpc_channel_credentials_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 58dffc38dc..868432eb33 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -56,6 +56,14 @@ #define PHP_GRPC_WRAP_OBJECT_END(name) \ } name; +#define PHP_GRPC_FREE_WRAPPED_FUNC_START(klass) \ + void free_##klass(void *object TSRMLS_DC) { \ + klass *p = (klass *)object; +#define PHP_GRPC_FREE_WRAPPED_FUNC_END() \ + zend_object_std_dtor(&p->std TSRMLS_CC); \ + efree(p); \ + } + #else #define php_grpc_int size_t @@ -79,6 +87,16 @@ zend_object std; \ } name; +#define WRAPPED_OBJECT_FROM_OBJ(klass, obj) \ + klass##_from_obj(obj); + +#define PHP_GRPC_FREE_WRAPPED_FUNC_START(klass) \ + static void free_##klass(zend_object *object) { \ + klass *p = WRAPPED_OBJECT_FROM_OBJ(klass, object) +#define PHP_GRPC_FREE_WRAPPED_FUNC_END() \ + zend_object_std_dtor(&p->std); \ + } + #endif /* PHP_MAJOR_VERSION */ #endif /* PHP7_WRAPPER_GRPC_H */ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index 577b707089..dc815f4d7c 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -58,21 +58,18 @@ zend_class_entry *grpc_ce_server; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_server */ -void free_wrapped_grpc_server(void *object TSRMLS_DC) { - wrapped_grpc_server *server = (wrapped_grpc_server *)object; - if (server->wrapped != NULL) { - grpc_server_shutdown_and_notify(server->wrapped, completion_queue, NULL); - grpc_server_cancel_all_calls(server->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server) + if (p->wrapped != NULL) { + grpc_server_shutdown_and_notify(p->wrapped, completion_queue, NULL); + grpc_server_cancel_all_calls(p->wrapped); grpc_completion_queue_pluck(completion_queue, NULL, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_server_destroy(server->wrapped); + grpc_server_destroy(p->wrapped); } - zend_object_std_dtor(&server->std TSRMLS_CC); - efree(server); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ @@ -97,19 +94,6 @@ zend_object_value create_wrapped_grpc_server(zend_class_entry *class_type static zend_object_handlers server_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_server */ -static void free_wrapped_grpc_server(zend_object *object) { - wrapped_grpc_server *server = wrapped_grpc_server_from_obj(object); - if (server->wrapped != NULL) { - grpc_server_shutdown_and_notify(server->wrapped, completion_queue, NULL); - grpc_server_cancel_all_calls(server->wrapped); - grpc_completion_queue_pluck(completion_queue, NULL, - gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_server_destroy(server->wrapped); - } - zend_object_std_dtor(&server->std); -} - /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ zend_object *create_wrapped_grpc_server(zend_class_entry *class_type) { diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 46416f5b47..b1471d06e2 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -51,18 +51,14 @@ zend_class_entry *grpc_ce_server_credentials; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instace of wrapped_grpc_server_credentials */ -void free_wrapped_grpc_server_credentials(void *object TSRMLS_DC) { - wrapped_grpc_server_credentials *creds = - (wrapped_grpc_server_credentials *)object; - if (creds->wrapped != NULL) { - grpc_server_credentials_release(creds->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server_credentials) + if (p->wrapped != NULL) { + grpc_server_credentials_release(p->wrapped); } - zend_object_std_dtor(&creds->std TSRMLS_CC); - efree(creds); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instace of wrapped_grpc_server_credentials to be associated * with an object of a class specified by class_type */ @@ -88,16 +84,6 @@ zend_object_value create_wrapped_grpc_server_credentials( static zend_object_handlers server_credentials_ce_handlers; -/* Frees and destroys an instace of wrapped_grpc_server_credentials */ -static void free_wrapped_grpc_server_credentials(zend_object *object) { - wrapped_grpc_server_credentials *creds = - wrapped_grpc_server_creds_from_obj(object); - if (creds->wrapped != NULL) { - grpc_server_credentials_release(creds->wrapped); - } - zend_object_std_dtor(&creds->std); -} - /* Initializes an instace of wrapped_grpc_server_credentials to be associated * with an object of a class specified by class_type */ zend_object *create_wrapped_grpc_server_credentials(zend_class_entry diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h index 2a90aa69a2..9551ec6c24 100755 --- a/src/php/ext/grpc/server_credentials.h +++ b/src/php/ext/grpc/server_credentials.h @@ -63,13 +63,13 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_server_credentials) #else static inline wrapped_grpc_server_credentials -*wrapped_grpc_server_creds_from_obj(zend_object *obj) { +*wrapped_grpc_server_credentials_from_obj(zend_object *obj) { return (wrapped_grpc_server_credentials*) ((char*)(obj) - XtOffsetOf(wrapped_grpc_server_credentials, std)); } #define Z_WRAPPED_GRPC_SERVER_CREDS_P(zv) \ - wrapped_grpc_server_creds_from_obj(Z_OBJ_P((zv))) + wrapped_grpc_server_credentials_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 7d1ee2178a..e19bfe1565 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -52,14 +52,11 @@ zend_class_entry *grpc_ce_timeval; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_call */ -void free_wrapped_grpc_timeval(void *object TSRMLS_DC) { - wrapped_grpc_timeval *timeval = (wrapped_grpc_timeval *)object; - zend_object_std_dtor(&timeval->std TSRMLS_CC); - efree(timeval); -} +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_timeval) +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_timeval to be associated with an * object of a class specified by class_type */ @@ -82,12 +79,6 @@ zend_object_value create_wrapped_grpc_timeval(zend_class_entry *class_type static zend_object_handlers timeval_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_call */ -static void free_wrapped_grpc_timeval(zend_object *object) { - wrapped_grpc_timeval *timeval = wrapped_grpc_timeval_from_obj(object); - zend_object_std_dtor(&timeval->std); -} - /* Initializes an instance of wrapped_grpc_timeval to be associated with an * object of a class specified by class_type */ zend_object *create_wrapped_grpc_timeval(zend_class_entry *class_type) { -- cgit v1.2.3 From d2583007f57da83579814086d5c811b72852d5aa Mon Sep 17 00:00:00 2001 From: thinkerou Date: Wed, 27 Jul 2016 09:48:45 +0800 Subject: add macro to php7_wrapper for reduce duplicate code --- src/php/ext/grpc/call.c | 24 ++++++------------------ src/php/ext/grpc/call_credentials.c | 26 ++++++-------------------- src/php/ext/grpc/call_credentials.h | 4 ++-- src/php/ext/grpc/channel.c | 24 ++++++------------------ src/php/ext/grpc/channel_credentials.c | 26 ++++++-------------------- src/php/ext/grpc/channel_credentials.h | 7 +++---- src/php/ext/grpc/php7_wrapper.h | 18 ++++++++++++++++++ src/php/ext/grpc/server.c | 32 ++++++++------------------------ src/php/ext/grpc/server_credentials.c | 26 ++++++-------------------- src/php/ext/grpc/server_credentials.h | 4 ++-- src/php/ext/grpc/timeval.c | 17 ++++------------- 11 files changed, 67 insertions(+), 141 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index fc832dacc2..add6841039 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -59,17 +59,14 @@ zend_class_entry *grpc_ce_call; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_call */ -void free_wrapped_grpc_call(void *object TSRMLS_DC) { - wrapped_grpc_call *call = (wrapped_grpc_call *)object; - if (call->owned && call->wrapped != NULL) { - grpc_call_destroy(call->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call) + if (p->owned && p->wrapped != NULL) { + grpc_call_destroy(p->wrapped); } - zend_object_std_dtor(&call->std TSRMLS_CC); - efree(call); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ @@ -94,15 +91,6 @@ zend_object_value create_wrapped_grpc_call(zend_class_entry *class_type static zend_object_handlers call_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_call */ -static void free_wrapped_grpc_call(zend_object *object) { - wrapped_grpc_call *call = wrapped_grpc_call_from_obj(object); - if (call->owned && call->wrapped != NULL) { - grpc_call_destroy(call->wrapped); - } - zend_object_std_dtor(&call->std); -} - /* Initializes an instance of wrapped_grpc_call to be associated with an * object of a class specified by class_type */ zend_object *create_wrapped_grpc_call(zend_class_entry *class_type) { diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index 29762afb29..aa589b0387 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -53,18 +53,14 @@ zend_class_entry *grpc_ce_call_credentials; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_call_credentials */ -void free_wrapped_grpc_call_credentials(void *object TSRMLS_DC) { - wrapped_grpc_call_credentials *creds = - (wrapped_grpc_call_credentials *)object; - if (creds->wrapped != NULL) { - grpc_call_credentials_release(creds->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call_credentials) + if (p->wrapped != NULL) { + grpc_call_credentials_release(p->wrapped); } - zend_object_std_dtor(&creds->std TSRMLS_CC); - efree(creds); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_call_credentials to be * associated with an object of a class specified by class_type */ @@ -90,16 +86,6 @@ zend_object_value create_wrapped_grpc_call_credentials( static zend_object_handlers call_credentials_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_call_credentials */ -static void free_wrapped_grpc_call_credentials(zend_object *object) { - wrapped_grpc_call_credentials *creds = - wrapped_grpc_call_creds_from_obj(object); - if (creds->wrapped != NULL) { - grpc_call_credentials_release(creds->wrapped); - } - zend_object_std_dtor(&creds->std); -} - /* Initializes an instance of wrapped_grpc_call_credentials to be * associated with an object of a class specified by class_type */ zend_object *create_wrapped_grpc_call_credentials(zend_class_entry diff --git a/src/php/ext/grpc/call_credentials.h b/src/php/ext/grpc/call_credentials.h index 822d077ccb..8014b75c70 100755 --- a/src/php/ext/grpc/call_credentials.h +++ b/src/php/ext/grpc/call_credentials.h @@ -63,7 +63,7 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_call_credentials) #else static inline wrapped_grpc_call_credentials -*wrapped_grpc_call_creds_from_obj(zend_object *obj) { +*wrapped_grpc_call_credentials_from_obj(zend_object *obj) { return (wrapped_grpc_call_credentials*)((char*)(obj) - XtOffsetOf(wrapped_grpc_call_credentials, @@ -71,7 +71,7 @@ static inline wrapped_grpc_call_credentials } #define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \ - wrapped_grpc_call_creds_from_obj(Z_OBJ_P((zv))) + wrapped_grpc_call_credentials_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 18ebcabc26..9c4b265e94 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -57,17 +57,14 @@ zend_class_entry *grpc_ce_channel; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_channel */ -void free_wrapped_grpc_channel(void *object TSRMLS_DC) { - wrapped_grpc_channel *channel = (wrapped_grpc_channel *)object; - if (channel->wrapped != NULL) { - grpc_channel_destroy(channel->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel) + if (p->wrapped != NULL) { + grpc_channel_destroy(p->wrapped); } - zend_object_std_dtor(&channel->std TSRMLS_CC); - efree(channel); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_channel to be associated with an * object of a class specified by class_type */ @@ -90,15 +87,6 @@ zend_object_value create_wrapped_grpc_channel(zend_class_entry *class_type static zend_object_handlers channel_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_channel */ -static void free_wrapped_grpc_channel(zend_object *object) { - wrapped_grpc_channel *channel = wrapped_grpc_channel_from_obj(object); - if (channel->wrapped != NULL) { - grpc_channel_destroy(channel->wrapped); - } - zend_object_std_dtor(&channel->std); -} - /* Initializes an instance of wrapped_grpc_channel to be associated with an * object of a class specified by class_type */ zend_object *create_wrapped_grpc_channel(zend_class_entry *class_type) { diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 1c2ea5ba82..938134cd9c 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -63,18 +63,14 @@ static grpc_ssl_roots_override_result get_ssl_roots_override( return GRPC_SSL_ROOTS_OVERRIDE_OK; } -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_channel_credentials */ -void free_wrapped_grpc_channel_credentials(void *object TSRMLS_DC) { - wrapped_grpc_channel_credentials *creds = - (wrapped_grpc_channel_credentials *)object; - if (creds->wrapped != NULL) { - grpc_channel_credentials_release(creds->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel_credentials) + if (p->wrapped != NULL) { + grpc_channel_credentials_release(p->wrapped); } - zend_object_std_dtor(&creds->std TSRMLS_CC); - efree(creds); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_channel_credentials to be * associated with an object of a class specified by class_type */ @@ -100,16 +96,6 @@ zend_object_value create_wrapped_grpc_channel_credentials( static zend_object_handlers channel_credentials_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_channel_credentials */ -static void free_wrapped_grpc_channel_credentials(zend_object *object) { - wrapped_grpc_channel_credentials *creds = - wrapped_grpc_channel_creds_from_obj(object); - if (creds->wrapped != NULL) { - grpc_channel_credentials_release(creds->wrapped); - } - zend_object_std_dtor(&creds->std); -} - /* Initializes an instance of wrapped_grpc_channel_credentials to be * associated with an object of a class specified by class_type */ zend_object *create_wrapped_grpc_channel_credentials(zend_class_entry diff --git a/src/php/ext/grpc/channel_credentials.h b/src/php/ext/grpc/channel_credentials.h index 21225db5fb..39dc85283d 100755 --- a/src/php/ext/grpc/channel_credentials.h +++ b/src/php/ext/grpc/channel_credentials.h @@ -63,15 +63,14 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_channel_credentials) #else static inline wrapped_grpc_channel_credentials -*wrapped_grpc_channel_creds_from_obj(zend_object *obj) { +*wrapped_grpc_channel_credentials_from_obj(zend_object *obj) { return (wrapped_grpc_channel_credentials *) - ((char*)(obj) - - XtOffsetOf(wrapped_grpc_channel_credentials, std)); + ((char*)(obj) - XtOffsetOf(wrapped_grpc_channel_credentials, std)); } #define Z_WRAPPED_GRPC_CHANNEL_CREDS_P(zv) \ - wrapped_grpc_channel_creds_from_obj(Z_OBJ_P((zv))) + wrapped_grpc_channel_credentials_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 58dffc38dc..868432eb33 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -56,6 +56,14 @@ #define PHP_GRPC_WRAP_OBJECT_END(name) \ } name; +#define PHP_GRPC_FREE_WRAPPED_FUNC_START(klass) \ + void free_##klass(void *object TSRMLS_DC) { \ + klass *p = (klass *)object; +#define PHP_GRPC_FREE_WRAPPED_FUNC_END() \ + zend_object_std_dtor(&p->std TSRMLS_CC); \ + efree(p); \ + } + #else #define php_grpc_int size_t @@ -79,6 +87,16 @@ zend_object std; \ } name; +#define WRAPPED_OBJECT_FROM_OBJ(klass, obj) \ + klass##_from_obj(obj); + +#define PHP_GRPC_FREE_WRAPPED_FUNC_START(klass) \ + static void free_##klass(zend_object *object) { \ + klass *p = WRAPPED_OBJECT_FROM_OBJ(klass, object) +#define PHP_GRPC_FREE_WRAPPED_FUNC_END() \ + zend_object_std_dtor(&p->std); \ + } + #endif /* PHP_MAJOR_VERSION */ #endif /* PHP7_WRAPPER_GRPC_H */ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index 577b707089..dc815f4d7c 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -58,21 +58,18 @@ zend_class_entry *grpc_ce_server; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_server */ -void free_wrapped_grpc_server(void *object TSRMLS_DC) { - wrapped_grpc_server *server = (wrapped_grpc_server *)object; - if (server->wrapped != NULL) { - grpc_server_shutdown_and_notify(server->wrapped, completion_queue, NULL); - grpc_server_cancel_all_calls(server->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server) + if (p->wrapped != NULL) { + grpc_server_shutdown_and_notify(p->wrapped, completion_queue, NULL); + grpc_server_cancel_all_calls(p->wrapped); grpc_completion_queue_pluck(completion_queue, NULL, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_server_destroy(server->wrapped); + grpc_server_destroy(p->wrapped); } - zend_object_std_dtor(&server->std TSRMLS_CC); - efree(server); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ @@ -97,19 +94,6 @@ zend_object_value create_wrapped_grpc_server(zend_class_entry *class_type static zend_object_handlers server_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_server */ -static void free_wrapped_grpc_server(zend_object *object) { - wrapped_grpc_server *server = wrapped_grpc_server_from_obj(object); - if (server->wrapped != NULL) { - grpc_server_shutdown_and_notify(server->wrapped, completion_queue, NULL); - grpc_server_cancel_all_calls(server->wrapped); - grpc_completion_queue_pluck(completion_queue, NULL, - gpr_inf_future(GPR_CLOCK_REALTIME), NULL); - grpc_server_destroy(server->wrapped); - } - zend_object_std_dtor(&server->std); -} - /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ zend_object *create_wrapped_grpc_server(zend_class_entry *class_type) { diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 46416f5b47..b1471d06e2 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -51,18 +51,14 @@ zend_class_entry *grpc_ce_server_credentials; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instace of wrapped_grpc_server_credentials */ -void free_wrapped_grpc_server_credentials(void *object TSRMLS_DC) { - wrapped_grpc_server_credentials *creds = - (wrapped_grpc_server_credentials *)object; - if (creds->wrapped != NULL) { - grpc_server_credentials_release(creds->wrapped); +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server_credentials) + if (p->wrapped != NULL) { + grpc_server_credentials_release(p->wrapped); } - zend_object_std_dtor(&creds->std TSRMLS_CC); - efree(creds); -} +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instace of wrapped_grpc_server_credentials to be associated * with an object of a class specified by class_type */ @@ -88,16 +84,6 @@ zend_object_value create_wrapped_grpc_server_credentials( static zend_object_handlers server_credentials_ce_handlers; -/* Frees and destroys an instace of wrapped_grpc_server_credentials */ -static void free_wrapped_grpc_server_credentials(zend_object *object) { - wrapped_grpc_server_credentials *creds = - wrapped_grpc_server_creds_from_obj(object); - if (creds->wrapped != NULL) { - grpc_server_credentials_release(creds->wrapped); - } - zend_object_std_dtor(&creds->std); -} - /* Initializes an instace of wrapped_grpc_server_credentials to be associated * with an object of a class specified by class_type */ zend_object *create_wrapped_grpc_server_credentials(zend_class_entry diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h index 2a90aa69a2..9551ec6c24 100755 --- a/src/php/ext/grpc/server_credentials.h +++ b/src/php/ext/grpc/server_credentials.h @@ -63,13 +63,13 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_server_credentials) #else static inline wrapped_grpc_server_credentials -*wrapped_grpc_server_creds_from_obj(zend_object *obj) { +*wrapped_grpc_server_credentials_from_obj(zend_object *obj) { return (wrapped_grpc_server_credentials*) ((char*)(obj) - XtOffsetOf(wrapped_grpc_server_credentials, std)); } #define Z_WRAPPED_GRPC_SERVER_CREDS_P(zv) \ - wrapped_grpc_server_creds_from_obj(Z_OBJ_P((zv))) + wrapped_grpc_server_credentials_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 7d1ee2178a..e19bfe1565 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -52,14 +52,11 @@ zend_class_entry *grpc_ce_timeval; -#if PHP_MAJOR_VERSION < 7 - /* Frees and destroys an instance of wrapped_grpc_call */ -void free_wrapped_grpc_timeval(void *object TSRMLS_DC) { - wrapped_grpc_timeval *timeval = (wrapped_grpc_timeval *)object; - zend_object_std_dtor(&timeval->std TSRMLS_CC); - efree(timeval); -} +PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_timeval) +PHP_GRPC_FREE_WRAPPED_FUNC_END() + +#if PHP_MAJOR_VERSION < 7 /* Initializes an instance of wrapped_grpc_timeval to be associated with an * object of a class specified by class_type */ @@ -82,12 +79,6 @@ zend_object_value create_wrapped_grpc_timeval(zend_class_entry *class_type static zend_object_handlers timeval_ce_handlers; -/* Frees and destroys an instance of wrapped_grpc_call */ -static void free_wrapped_grpc_timeval(zend_object *object) { - wrapped_grpc_timeval *timeval = wrapped_grpc_timeval_from_obj(object); - zend_object_std_dtor(&timeval->std); -} - /* Initializes an instance of wrapped_grpc_timeval to be associated with an * object of a class specified by class_type */ zend_object *create_wrapped_grpc_timeval(zend_class_entry *class_type) { -- cgit v1.2.3 From fa30de9b392a29b58bca2065f86b9be8ff8ebaa0 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 26 Jul 2016 19:52:13 -0700 Subject: removed some bits from invalid LR design --- src/core/ext/load_reporting/load_reporting.h | 2 + .../ext/load_reporting/load_reporting_filter.c | 33 +++++------- test/core/end2end/tests/load_reporting_hook.c | 62 +--------------------- 3 files changed, 16 insertions(+), 81 deletions(-) (limited to 'src') diff --git a/src/core/ext/load_reporting/load_reporting.h b/src/core/ext/load_reporting/load_reporting.h index c3161bebb7..e37817d8c2 100644 --- a/src/core/ext/load_reporting/load_reporting.h +++ b/src/core/ext/load_reporting/load_reporting.h @@ -38,9 +38,11 @@ #include "src/core/lib/channel/channel_stack.h" /** Metadata key for initial metadata coming from clients */ +/* TODO(dgq): change to the final value TBD */ #define GRPC_LOAD_REPORTING_INITIAL_MD_KEY "load-reporting-initial" /** Metadata key for trailing metadata from servers */ +/* TODO(dgq): change to the final value TBD */ #define GRPC_LOAD_REPORTING_TRAILING_MD_KEY "load-reporting-trailing" /** Identifiers for the invocation point of the users LR callback */ diff --git a/src/core/ext/load_reporting/load_reporting_filter.c b/src/core/ext/load_reporting/load_reporting_filter.c index 65aba2a650..99b560ae27 100644 --- a/src/core/ext/load_reporting/load_reporting_filter.c +++ b/src/core/ext/load_reporting/load_reporting_filter.c @@ -43,11 +43,6 @@ #include "src/core/lib/profiling/timers.h" #include "src/core/lib/transport/static_metadata.h" -void (*g_load_reporting_fn)(const grpc_load_reporting_call_data *call_data); - -/* The function to be defined */ -void load_reporting_fn(const grpc_load_reporting_call_data *call_data) {} - typedef struct call_data { intptr_t id; /**< an id unique to the call */ char *trailing_md_string; @@ -68,15 +63,6 @@ typedef struct channel_data { intptr_t id; /**< an id unique to the channel */ } channel_data; -static void invoke_lr_fn(grpc_load_reporting_call_data *lr_call_data) { - if (g_load_reporting_fn == NULL) { - g_load_reporting_fn = load_reporting_fn; - } - GPR_TIMER_BEGIN("load_reporting_fn", 0); - g_load_reporting_fn(lr_call_data); - GPR_TIMER_END("load_reporting_fn", 0); -} - typedef struct { grpc_call_element *elem; grpc_exec_ctx *exec_ctx; @@ -91,6 +77,7 @@ static grpc_mdelem *recv_md_filter(void *user_data, grpc_mdelem *md) { calld->service_method = grpc_mdstr_as_c_string(md->value); } else if (md->key == GRPC_MDSTR_LOAD_REPORTING_INITIAL) { calld->initial_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value)); + return NULL; } return md; @@ -122,13 +109,14 @@ static void on_initial_md_ready(grpc_exec_ctx *exec_ctx, void *user_data, /* Constructor for call_data */ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_call_element_args *args) { - channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; memset(calld, 0, sizeof(call_data)); calld->id = (intptr_t)args->call_stack; grpc_closure_init(&calld->on_initial_md_ready, on_initial_md_ready, elem); + /* TODO(dgq): do something with the data + channel_data *chand = elem->channel_data; grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_CREATION, (intptr_t)chand->id, (intptr_t)calld->id, @@ -136,16 +124,17 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, NULL, NULL, NULL}; - invoke_lr_fn(&lr_call_data); + */ } /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, const grpc_call_final_info *final_info, void *ignored) { - channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; + /* TODO(dgq): do something with the data + channel_data *chand = elem->channel_data; grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_DESTRUCTION, (intptr_t)chand->id, (intptr_t)calld->id, @@ -153,8 +142,7 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, calld->initial_md_string, calld->trailing_md_string, calld->service_method}; - - invoke_lr_fn(&lr_call_data); + */ gpr_free(calld->initial_md_string); gpr_free(calld->trailing_md_string); @@ -171,6 +159,7 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx, chand->id = (intptr_t)args->channel_stack; + /* TODO(dgq): do something with the data grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CHANNEL_CREATION, (intptr_t)chand, 0, @@ -178,12 +167,13 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx, NULL, NULL, NULL}; - invoke_lr_fn(&lr_call_data); + */ } /* Destructor for channel data */ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) { + /* TODO(dgq): do something with the data channel_data *chand = elem->channel_data; grpc_load_reporting_call_data lr_call_data = { GRPC_LR_POINT_CHANNEL_DESTRUCTION, @@ -193,7 +183,7 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, NULL, NULL, NULL}; - invoke_lr_fn(&lr_call_data); + */ } static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) { @@ -202,6 +192,7 @@ static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) { if (md->key == GRPC_MDSTR_LOAD_REPORTING_TRAILING) { calld->trailing_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value)); + return NULL; } return md; diff --git a/test/core/end2end/tests/load_reporting_hook.c b/test/core/end2end/tests/load_reporting_hook.c index 40ffa19c3f..2c6519881a 100644 --- a/test/core/end2end/tests/load_reporting_hook.c +++ b/test/core/end2end/tests/load_reporting_hook.c @@ -69,44 +69,6 @@ typedef struct { bool fully_processed; } load_reporting_data; -static load_reporting_data lr_data; - -static void load_reporting_test_fn( - const grpc_load_reporting_call_data *call_data) { - gpr_mu_lock(&lr_data.mu); - switch (call_data->source) { - case GRPC_LR_POINT_CHANNEL_CREATION: - lr_data.channel_id = call_data->channel_id; - break; - case GRPC_LR_POINT_CHANNEL_DESTRUCTION: - break; - case GRPC_LR_POINT_CALL_CREATION: - lr_data.call_id = call_data->call_id; - break; - case GRPC_LR_POINT_CALL_DESTRUCTION: - if (lr_data.initial_md_str == NULL) { - lr_data.initial_md_str = gpr_strdup(call_data->initial_md_string); - } - if (lr_data.trailing_md_str == NULL) { - lr_data.trailing_md_str = gpr_strdup(call_data->trailing_md_string); - } - if (lr_data.method_name == NULL) { - lr_data.method_name = gpr_strdup(call_data->method_name); - } - - lr_data.incoming_bytes = call_data->final_info->stats - .transport_stream_stats.incoming.data_bytes; - lr_data.outgoing_bytes = call_data->final_info->stats - .transport_stream_stats.outgoing.data_bytes; - lr_data.call_final_status = call_data->final_info->final_status; - lr_data.fully_processed = true; - break; - default: - abort(); - } - gpr_mu_unlock(&lr_data.mu); -} - static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config, const char *test_name, grpc_channel_args *client_args, @@ -315,8 +277,8 @@ extern void (*g_load_reporting_fn)( const grpc_load_reporting_call_data *call_data); static void test_load_reporting_hook(grpc_end2end_test_config config) { - gpr_mu_init(&lr_data.mu); - g_load_reporting_fn = load_reporting_test_fn; + /* TODO(dgq): this test is currently a noop until LR is fully defined. + * Leaving the rest here, as it'll likely be reusable. */ /* Introduce load reporting for the server through its arguments */ grpc_arg arg = grpc_load_reporting_enable_arg(); @@ -350,26 +312,6 @@ static void test_load_reporting_hook(grpc_end2end_test_config config) { end_test(&f); grpc_channel_args_destroy(lr_server_args); config.tear_down_data(&f); - - GPR_ASSERT(lr_data.fully_processed); - GPR_ASSERT(lr_data.incoming_bytes == strlen(request_msg)); - GPR_ASSERT(lr_data.outgoing_bytes == strlen(response_msg)); - - GPR_ASSERT(lr_data.call_id > 0); - GPR_ASSERT(lr_data.channel_id > 0); - - GPR_ASSERT(strcmp(lr_data.method_name, "/gRPCFTW") == 0); - - GPR_ASSERT(lr_data.initial_md_str != NULL); - GPR_ASSERT(lr_data.trailing_md_str != NULL); - GPR_ASSERT(strcmp(lr_data.initial_md_str, "client-token") == 0); - GPR_ASSERT(strcmp(lr_data.trailing_md_str, "server-token") == 0); - - GPR_ASSERT(lr_data.call_final_status == GRPC_STATUS_OK); - - gpr_free(lr_data.initial_md_str); - gpr_free(lr_data.trailing_md_str); - gpr_free(lr_data.method_name); } void load_reporting_hook(grpc_end2end_test_config config) { -- cgit v1.2.3 From dba5b0c86afdae8bd1a9e5b022be7656acfa1808 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Wed, 27 Jul 2016 18:39:16 +0800 Subject: add php_grpc_zend_object macro and rename klass --- src/php/ext/grpc/call.c | 35 +++++++++++++--------------------- src/php/ext/grpc/call_credentials.c | 34 ++++++++++++--------------------- src/php/ext/grpc/channel.c | 33 +++++++++++++------------------- src/php/ext/grpc/channel_credentials.c | 34 ++++++++++++--------------------- src/php/ext/grpc/php7_wrapper.h | 18 +++++++++-------- src/php/ext/grpc/server.c | 35 +++++++++++++--------------------- src/php/ext/grpc/server_credentials.c | 34 ++++++++++++--------------------- src/php/ext/grpc/timeval.c | 33 +++++++++++++------------------- 8 files changed, 98 insertions(+), 158 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index add6841039..706c7d8c3a 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -58,6 +58,9 @@ #include "byte_buffer.h" zend_class_entry *grpc_ce_call; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers call_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_call */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call) @@ -66,44 +69,32 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ -zend_object_value create_wrapped_grpc_call(zend_class_entry *class_type - TSRMLS_DC) { - zend_object_value retval; +php_grpc_zend_object create_wrapped_grpc_call(zend_class_entry *class_type + TSRMLS_DC) { wrapped_grpc_call *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_call *)emalloc(sizeof(wrapped_grpc_call)); memset(intern, 0, sizeof(wrapped_grpc_call)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_call) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_call, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers call_ce_handlers; - -/* Initializes an instance of wrapped_grpc_call to be associated with an - * object of a class specified by class_type */ -zend_object *create_wrapped_grpc_call(zend_class_entry *class_type) { - wrapped_grpc_call *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_call) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &call_ce_handlers; return &intern->std; -} - #endif +} /* Creates and returns a PHP array object with the data in a * grpc_metadata_array. Returns NULL on failure */ diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index aa589b0387..0c55745524 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -52,6 +52,9 @@ #include zend_class_entry *grpc_ce_call_credentials; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers call_credentials_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_call_credentials */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call_credentials) @@ -60,46 +63,33 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call_credentials) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_call_credentials to be * associated with an object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_call_credentials( +php_grpc_zend_object create_wrapped_grpc_call_credentials( zend_class_entry *class_type TSRMLS_DC) { - zend_object_value retval; wrapped_grpc_call_credentials *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_call_credentials *)emalloc( sizeof(wrapped_grpc_call_credentials)); memset(intern, 0, sizeof(wrapped_grpc_call_credentials)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_call_credentials) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_call_credentials, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers call_credentials_ce_handlers; - -/* Initializes an instance of wrapped_grpc_call_credentials to be - * associated with an object of a class specified by class_type */ -zend_object *create_wrapped_grpc_call_credentials(zend_class_entry - *class_type) { - wrapped_grpc_call_credentials *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_call_credentials) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &call_credentials_ce_handlers; return &intern->std; -} - #endif +} zval *grpc_php_wrap_call_credentials(grpc_call_credentials *wrapped TSRMLS_DC) { diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 9c4b265e94..69264842f0 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -56,6 +56,9 @@ #include "timeval.h" zend_class_entry *grpc_ce_channel; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers channel_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_channel */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel) @@ -64,42 +67,32 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_channel to be associated with an * object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_channel(zend_class_entry *class_type - TSRMLS_DC) { - zend_object_value retval; +php_grpc_zend_object create_wrapped_grpc_channel(zend_class_entry *class_type + TSRMLS_DC) { wrapped_grpc_channel *intern; +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_channel *)emalloc(sizeof(wrapped_grpc_channel)); memset(intern, 0, sizeof(wrapped_grpc_channel)); +#else + intern = ecalloc(1, sizeof(wrapped_grpc_channel) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_channel, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers channel_ce_handlers; - -/* Initializes an instance of wrapped_grpc_channel to be associated with an - * object of a class specified by class_type */ -zend_object *create_wrapped_grpc_channel(zend_class_entry *class_type) { - wrapped_grpc_channel *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_channel) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &channel_ce_handlers; return &intern->std; -} - #endif +} void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args TSRMLS_DC) { diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 938134cd9c..cef435cc6e 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -52,6 +52,9 @@ #include zend_class_entry *grpc_ce_channel_credentials; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers channel_credentials_ce_handlers; +#endif static char *default_pem_root_certs = NULL; static grpc_ssl_roots_override_result get_ssl_roots_override( @@ -70,46 +73,33 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel_credentials) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_channel_credentials to be * associated with an object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_channel_credentials( +php_grpc_zend_object create_wrapped_grpc_channel_credentials( zend_class_entry *class_type TSRMLS_DC) { - zend_object_value retval; wrapped_grpc_channel_credentials *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_channel_credentials *)emalloc( sizeof(wrapped_grpc_channel_credentials)); memset(intern, 0, sizeof(wrapped_grpc_channel_credentials)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_channel_credentials) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_channel_credentials, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers channel_credentials_ce_handlers; - -/* Initializes an instance of wrapped_grpc_channel_credentials to be - * associated with an object of a class specified by class_type */ -zend_object *create_wrapped_grpc_channel_credentials(zend_class_entry - *class_type) { - wrapped_grpc_channel_credentials *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_channel_credentials) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &channel_credentials_ce_handlers; return &intern->std; -} - #endif +} zval *grpc_php_wrap_channel_credentials(grpc_channel_credentials *wrapped TSRMLS_DC) { diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 868432eb33..7d7470f8a9 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -40,6 +40,7 @@ #define php_grpc_int int #define php_grpc_long long #define php_grpc_ulong ulong +#define php_grpc_zend_object zend_object_value #define php_grpc_add_property_string(arg, name, context, b) \ add_property_string(arg, name, context, b) #define php_grpc_add_property_stringl(res, name, str, len, b) \ @@ -56,9 +57,9 @@ #define PHP_GRPC_WRAP_OBJECT_END(name) \ } name; -#define PHP_GRPC_FREE_WRAPPED_FUNC_START(klass) \ - void free_##klass(void *object TSRMLS_DC) { \ - klass *p = (klass *)object; +#define PHP_GRPC_FREE_WRAPPED_FUNC_START(class_object) \ + void free_##class_object(void *object TSRMLS_DC) { \ + class_object *p = (class_object *)object; #define PHP_GRPC_FREE_WRAPPED_FUNC_END() \ zend_object_std_dtor(&p->std TSRMLS_CC); \ efree(p); \ @@ -69,6 +70,7 @@ #define php_grpc_int size_t #define php_grpc_long zend_long #define php_grpc_ulong zend_ulong +#define php_grpc_zend_object zend_object* #define php_grpc_add_property_string(arg, name, context, b) \ add_property_string(arg, name, context) #define php_grpc_add_property_stringl(res, name, str, len, b) \ @@ -87,12 +89,12 @@ zend_object std; \ } name; -#define WRAPPED_OBJECT_FROM_OBJ(klass, obj) \ - klass##_from_obj(obj); +#define WRAPPED_OBJECT_FROM_OBJ(class_object, obj) \ + class_object##_from_obj(obj); -#define PHP_GRPC_FREE_WRAPPED_FUNC_START(klass) \ - static void free_##klass(zend_object *object) { \ - klass *p = WRAPPED_OBJECT_FROM_OBJ(klass, object) +#define PHP_GRPC_FREE_WRAPPED_FUNC_START(class_object) \ + static void free_##class_object(zend_object *object) { \ + class_object *p = WRAPPED_OBJECT_FROM_OBJ(class_object, object) #define PHP_GRPC_FREE_WRAPPED_FUNC_END() \ zend_object_std_dtor(&p->std); \ } diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index dc815f4d7c..d8ebd4472d 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -57,6 +57,9 @@ #include "timeval.h" zend_class_entry *grpc_ce_server; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers server_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_server */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server) @@ -69,44 +72,32 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ -zend_object_value create_wrapped_grpc_server(zend_class_entry *class_type - TSRMLS_DC) { - zend_object_value retval; +php_grpc_zend_object create_wrapped_grpc_server(zend_class_entry *class_type + TSRMLS_DC) { wrapped_grpc_server *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_server *)emalloc(sizeof(wrapped_grpc_server)); memset(intern, 0, sizeof(wrapped_grpc_server)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_server) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_server, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers server_ce_handlers; - -/* Initializes an instance of wrapped_grpc_call to be associated with an object - * of a class specified by class_type */ -zend_object *create_wrapped_grpc_server(zend_class_entry *class_type) { - wrapped_grpc_server *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_server) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &server_ce_handlers; return &intern->std; -} - #endif +} /** * Constructs a new instance of the Server class diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index b1471d06e2..921436a1bb 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -50,6 +50,9 @@ #include zend_class_entry *grpc_ce_server_credentials; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers server_credentials_ce_handlers; +#endif /* Frees and destroys an instace of wrapped_grpc_server_credentials */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server_credentials) @@ -58,46 +61,33 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server_credentials) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instace of wrapped_grpc_server_credentials to be associated * with an object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_server_credentials( +php_grpc_zend_object create_wrapped_grpc_server_credentials( zend_class_entry *class_type TSRMLS_DC) { - zend_object_value retval; wrapped_grpc_server_credentials *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_server_credentials *)emalloc( sizeof(wrapped_grpc_server_credentials)); memset(intern, 0, sizeof(wrapped_grpc_server_credentials)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_server_credentials) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_server_credentials, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers server_credentials_ce_handlers; - -/* Initializes an instace of wrapped_grpc_server_credentials to be associated - * with an object of a class specified by class_type */ -zend_object *create_wrapped_grpc_server_credentials(zend_class_entry - *class_type) { - wrapped_grpc_server_credentials *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_server_credentials) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &server_credentials_ce_handlers; return &intern->std; -} - #endif +} zval *grpc_php_wrap_server_credentials(grpc_server_credentials *wrapped TSRMLS_DC) { diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index e19bfe1565..33d11f83cc 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -51,47 +51,40 @@ #include zend_class_entry *grpc_ce_timeval; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers timeval_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_call */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_timeval) PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_timeval to be associated with an * object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_timeval(zend_class_entry *class_type - TSRMLS_DC) { - zend_object_value retval; +php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type + TSRMLS_DC) { wrapped_grpc_timeval *intern; +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_timeval *)emalloc(sizeof(wrapped_grpc_timeval)); memset(intern, 0, sizeof(wrapped_grpc_timeval)); +#else + intern = ecalloc(1, sizeof(wrapped_grpc_timeval) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_timeval, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers timeval_ce_handlers; - -/* Initializes an instance of wrapped_grpc_timeval to be associated with an - * object of a class specified by class_type */ -zend_object *create_wrapped_grpc_timeval(zend_class_entry *class_type) { - wrapped_grpc_timeval *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_timeval) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &timeval_ce_handlers; return &intern->std; -} - #endif +} zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) { zval *timeval_object; -- cgit v1.2.3 From 4f8df873b00a2778535fe71a8cb360d3dfd677b6 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Wed, 27 Jul 2016 18:45:37 +0800 Subject: add php_grpc_zend_object macro and rename klass --- src/php/ext/grpc/call.c | 35 +++++++++++++--------------------- src/php/ext/grpc/call_credentials.c | 34 ++++++++++++--------------------- src/php/ext/grpc/channel.c | 33 +++++++++++++------------------- src/php/ext/grpc/channel_credentials.c | 34 ++++++++++++--------------------- src/php/ext/grpc/php7_wrapper.h | 18 +++++++++-------- src/php/ext/grpc/server.c | 35 +++++++++++++--------------------- src/php/ext/grpc/server_credentials.c | 34 ++++++++++++--------------------- src/php/ext/grpc/timeval.c | 33 +++++++++++++------------------- 8 files changed, 98 insertions(+), 158 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index add6841039..706c7d8c3a 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -58,6 +58,9 @@ #include "byte_buffer.h" zend_class_entry *grpc_ce_call; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers call_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_call */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call) @@ -66,44 +69,32 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ -zend_object_value create_wrapped_grpc_call(zend_class_entry *class_type - TSRMLS_DC) { - zend_object_value retval; +php_grpc_zend_object create_wrapped_grpc_call(zend_class_entry *class_type + TSRMLS_DC) { wrapped_grpc_call *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_call *)emalloc(sizeof(wrapped_grpc_call)); memset(intern, 0, sizeof(wrapped_grpc_call)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_call) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_call, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers call_ce_handlers; - -/* Initializes an instance of wrapped_grpc_call to be associated with an - * object of a class specified by class_type */ -zend_object *create_wrapped_grpc_call(zend_class_entry *class_type) { - wrapped_grpc_call *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_call) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &call_ce_handlers; return &intern->std; -} - #endif +} /* Creates and returns a PHP array object with the data in a * grpc_metadata_array. Returns NULL on failure */ diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index aa589b0387..0c55745524 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -52,6 +52,9 @@ #include zend_class_entry *grpc_ce_call_credentials; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers call_credentials_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_call_credentials */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call_credentials) @@ -60,46 +63,33 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call_credentials) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_call_credentials to be * associated with an object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_call_credentials( +php_grpc_zend_object create_wrapped_grpc_call_credentials( zend_class_entry *class_type TSRMLS_DC) { - zend_object_value retval; wrapped_grpc_call_credentials *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_call_credentials *)emalloc( sizeof(wrapped_grpc_call_credentials)); memset(intern, 0, sizeof(wrapped_grpc_call_credentials)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_call_credentials) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_call_credentials, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers call_credentials_ce_handlers; - -/* Initializes an instance of wrapped_grpc_call_credentials to be - * associated with an object of a class specified by class_type */ -zend_object *create_wrapped_grpc_call_credentials(zend_class_entry - *class_type) { - wrapped_grpc_call_credentials *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_call_credentials) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &call_credentials_ce_handlers; return &intern->std; -} - #endif +} zval *grpc_php_wrap_call_credentials(grpc_call_credentials *wrapped TSRMLS_DC) { diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 9c4b265e94..69264842f0 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -56,6 +56,9 @@ #include "timeval.h" zend_class_entry *grpc_ce_channel; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers channel_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_channel */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel) @@ -64,42 +67,32 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_channel to be associated with an * object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_channel(zend_class_entry *class_type - TSRMLS_DC) { - zend_object_value retval; +php_grpc_zend_object create_wrapped_grpc_channel(zend_class_entry *class_type + TSRMLS_DC) { wrapped_grpc_channel *intern; +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_channel *)emalloc(sizeof(wrapped_grpc_channel)); memset(intern, 0, sizeof(wrapped_grpc_channel)); +#else + intern = ecalloc(1, sizeof(wrapped_grpc_channel) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_channel, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers channel_ce_handlers; - -/* Initializes an instance of wrapped_grpc_channel to be associated with an - * object of a class specified by class_type */ -zend_object *create_wrapped_grpc_channel(zend_class_entry *class_type) { - wrapped_grpc_channel *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_channel) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &channel_ce_handlers; return &intern->std; -} - #endif +} void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args TSRMLS_DC) { diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 938134cd9c..cef435cc6e 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -52,6 +52,9 @@ #include zend_class_entry *grpc_ce_channel_credentials; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers channel_credentials_ce_handlers; +#endif static char *default_pem_root_certs = NULL; static grpc_ssl_roots_override_result get_ssl_roots_override( @@ -70,46 +73,33 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_channel_credentials) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_channel_credentials to be * associated with an object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_channel_credentials( +php_grpc_zend_object create_wrapped_grpc_channel_credentials( zend_class_entry *class_type TSRMLS_DC) { - zend_object_value retval; wrapped_grpc_channel_credentials *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_channel_credentials *)emalloc( sizeof(wrapped_grpc_channel_credentials)); memset(intern, 0, sizeof(wrapped_grpc_channel_credentials)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_channel_credentials) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_channel_credentials, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers channel_credentials_ce_handlers; - -/* Initializes an instance of wrapped_grpc_channel_credentials to be - * associated with an object of a class specified by class_type */ -zend_object *create_wrapped_grpc_channel_credentials(zend_class_entry - *class_type) { - wrapped_grpc_channel_credentials *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_channel_credentials) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &channel_credentials_ce_handlers; return &intern->std; -} - #endif +} zval *grpc_php_wrap_channel_credentials(grpc_channel_credentials *wrapped TSRMLS_DC) { diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 868432eb33..7d7470f8a9 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -40,6 +40,7 @@ #define php_grpc_int int #define php_grpc_long long #define php_grpc_ulong ulong +#define php_grpc_zend_object zend_object_value #define php_grpc_add_property_string(arg, name, context, b) \ add_property_string(arg, name, context, b) #define php_grpc_add_property_stringl(res, name, str, len, b) \ @@ -56,9 +57,9 @@ #define PHP_GRPC_WRAP_OBJECT_END(name) \ } name; -#define PHP_GRPC_FREE_WRAPPED_FUNC_START(klass) \ - void free_##klass(void *object TSRMLS_DC) { \ - klass *p = (klass *)object; +#define PHP_GRPC_FREE_WRAPPED_FUNC_START(class_object) \ + void free_##class_object(void *object TSRMLS_DC) { \ + class_object *p = (class_object *)object; #define PHP_GRPC_FREE_WRAPPED_FUNC_END() \ zend_object_std_dtor(&p->std TSRMLS_CC); \ efree(p); \ @@ -69,6 +70,7 @@ #define php_grpc_int size_t #define php_grpc_long zend_long #define php_grpc_ulong zend_ulong +#define php_grpc_zend_object zend_object* #define php_grpc_add_property_string(arg, name, context, b) \ add_property_string(arg, name, context) #define php_grpc_add_property_stringl(res, name, str, len, b) \ @@ -87,12 +89,12 @@ zend_object std; \ } name; -#define WRAPPED_OBJECT_FROM_OBJ(klass, obj) \ - klass##_from_obj(obj); +#define WRAPPED_OBJECT_FROM_OBJ(class_object, obj) \ + class_object##_from_obj(obj); -#define PHP_GRPC_FREE_WRAPPED_FUNC_START(klass) \ - static void free_##klass(zend_object *object) { \ - klass *p = WRAPPED_OBJECT_FROM_OBJ(klass, object) +#define PHP_GRPC_FREE_WRAPPED_FUNC_START(class_object) \ + static void free_##class_object(zend_object *object) { \ + class_object *p = WRAPPED_OBJECT_FROM_OBJ(class_object, object) #define PHP_GRPC_FREE_WRAPPED_FUNC_END() \ zend_object_std_dtor(&p->std); \ } diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index dc815f4d7c..d8ebd4472d 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -57,6 +57,9 @@ #include "timeval.h" zend_class_entry *grpc_ce_server; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers server_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_server */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server) @@ -69,44 +72,32 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_call to be associated with an object * of a class specified by class_type */ -zend_object_value create_wrapped_grpc_server(zend_class_entry *class_type - TSRMLS_DC) { - zend_object_value retval; +php_grpc_zend_object create_wrapped_grpc_server(zend_class_entry *class_type + TSRMLS_DC) { wrapped_grpc_server *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_server *)emalloc(sizeof(wrapped_grpc_server)); memset(intern, 0, sizeof(wrapped_grpc_server)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_server) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_server, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers server_ce_handlers; - -/* Initializes an instance of wrapped_grpc_call to be associated with an object - * of a class specified by class_type */ -zend_object *create_wrapped_grpc_server(zend_class_entry *class_type) { - wrapped_grpc_server *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_server) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &server_ce_handlers; return &intern->std; -} - #endif +} /** * Constructs a new instance of the Server class diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index b1471d06e2..921436a1bb 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -50,6 +50,9 @@ #include zend_class_entry *grpc_ce_server_credentials; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers server_credentials_ce_handlers; +#endif /* Frees and destroys an instace of wrapped_grpc_server_credentials */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server_credentials) @@ -58,46 +61,33 @@ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_server_credentials) } PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instace of wrapped_grpc_server_credentials to be associated * with an object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_server_credentials( +php_grpc_zend_object create_wrapped_grpc_server_credentials( zend_class_entry *class_type TSRMLS_DC) { - zend_object_value retval; wrapped_grpc_server_credentials *intern; - +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_server_credentials *)emalloc( sizeof(wrapped_grpc_server_credentials)); memset(intern, 0, sizeof(wrapped_grpc_server_credentials)); - +#else + intern = ecalloc(1, sizeof(wrapped_grpc_server_credentials) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_server_credentials, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers server_credentials_ce_handlers; - -/* Initializes an instace of wrapped_grpc_server_credentials to be associated - * with an object of a class specified by class_type */ -zend_object *create_wrapped_grpc_server_credentials(zend_class_entry - *class_type) { - wrapped_grpc_server_credentials *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_server_credentials) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &server_credentials_ce_handlers; return &intern->std; -} - #endif +} zval *grpc_php_wrap_server_credentials(grpc_server_credentials *wrapped TSRMLS_DC) { diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index e19bfe1565..33d11f83cc 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -51,47 +51,40 @@ #include zend_class_entry *grpc_ce_timeval; +#if PHP_MAJOR_VERSION >= 7 +static zend_object_handlers timeval_ce_handlers; +#endif /* Frees and destroys an instance of wrapped_grpc_call */ PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_timeval) PHP_GRPC_FREE_WRAPPED_FUNC_END() -#if PHP_MAJOR_VERSION < 7 - /* Initializes an instance of wrapped_grpc_timeval to be associated with an * object of a class specified by class_type */ -zend_object_value create_wrapped_grpc_timeval(zend_class_entry *class_type - TSRMLS_DC) { - zend_object_value retval; +php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type + TSRMLS_DC) { wrapped_grpc_timeval *intern; +#if PHP_MAJOR_VERSION < 7 + zend_object_value retval; intern = (wrapped_grpc_timeval *)emalloc(sizeof(wrapped_grpc_timeval)); memset(intern, 0, sizeof(wrapped_grpc_timeval)); +#else + intern = ecalloc(1, sizeof(wrapped_grpc_timeval) + + zend_object_properties_size(class_type)); +#endif zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); +#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_timeval, NULL TSRMLS_CC); retval.handlers = zend_get_std_object_handlers(); return retval; -} - #else - -static zend_object_handlers timeval_ce_handlers; - -/* Initializes an instance of wrapped_grpc_timeval to be associated with an - * object of a class specified by class_type */ -zend_object *create_wrapped_grpc_timeval(zend_class_entry *class_type) { - wrapped_grpc_timeval *intern; - intern = ecalloc(1, sizeof(wrapped_grpc_timeval) + - zend_object_properties_size(class_type)); - zend_object_std_init(&intern->std, class_type); - object_properties_init(&intern->std, class_type); intern->std.handlers = &timeval_ce_handlers; return &intern->std; -} - #endif +} zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) { zval *timeval_object; -- cgit v1.2.3 From 0b316b041f9e26df523d47906705d10ff931191e Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 27 Jul 2016 11:11:32 -0700 Subject: Ruby Tools: automatically include plugin argument in protoc command --- src/ruby/tools/bin/grpc_tools_ruby_protoc.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb b/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb index 3a2a5b8dc9..dab06e7958 100755 --- a/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb +++ b/src/ruby/tools/bin/grpc_tools_ruby_protoc.rb @@ -32,10 +32,17 @@ require 'rbconfig' require_relative '../os_check' -protoc_name = 'protoc' + RbConfig::CONFIG['EXEEXT'] +ext = RbConfig::CONFIG['EXEEXT'] -protoc_path = File.join(File.dirname(__FILE__), - RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name, - protoc_name) +protoc_name = 'protoc' + ext -exec([ protoc_path, protoc_path ], *ARGV) +plugin_name = 'grpc_ruby_plugin' + ext + +protoc_dir = File.join(File.dirname(__FILE__), + RbConfig::CONFIG['host_cpu'] + '-' + OS.os_name) + +protoc_path = File.join(protoc_dir, protoc_name) + +plugin_path = File.join(protoc_dir, plugin_name) + +exec([ protoc_path, protoc_path ], "--plugin=protoc-gen-grpc=#{plugin_path}", *ARGV) -- cgit v1.2.3 From ba75c013b105362f72c742b57f4cd274e4ea1b70 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 02:30:08 +0800 Subject: add some macro to reduce duplicate code --- src/php/ext/grpc/call.c | 382 ++++++--------------------------- src/php/ext/grpc/call_credentials.c | 11 +- src/php/ext/grpc/channel.c | 100 ++------- src/php/ext/grpc/channel_credentials.c | 11 +- src/php/ext/grpc/php7_wrapper.h | 93 ++++++++ src/php/ext/grpc/server.c | 10 +- src/php/ext/grpc/server_credentials.c | 11 +- src/php/ext/grpc/timeval.c | 10 +- 8 files changed, 184 insertions(+), 444 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 706c7d8c3a..46591d8738 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -73,15 +73,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_call(zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_call *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_call *)emalloc(sizeof(wrapped_grpc_call)); - memset(intern, 0, sizeof(wrapped_grpc_call)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_call) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 @@ -111,11 +103,7 @@ zval *grpc_parse_metadata_array(grpc_metadata_array char *str_key; char *str_val; size_t key_len; -#if PHP_MAJOR_VERSION < 7 - zval **data = NULL; -#else - zval *data; -#endif + zval *data = NULL; array_hash = Z_ARRVAL_P(array); grpc_metadata *elem; @@ -126,14 +114,9 @@ zval *grpc_parse_metadata_array(grpc_metadata_array memcpy(str_key, elem->key, key_len); str_val = ecalloc(elem->value_length + 1, sizeof(char)); memcpy(str_val, elem->value, elem->value_length); -#if PHP_MAJOR_VERSION < 7 - if (zend_hash_find(array_hash, str_key, key_len, (void **)data) == + if (php_grpc_zend_hash_find(array_hash, str_key, key_len, (void **)&data) == SUCCESS) { - if (Z_TYPE_P(*data) != IS_ARRAY) { -#else - if ((data = zend_hash_str_find(array_hash, str_key, key_len)) != NULL) { if (Z_TYPE_P(data) != IS_ARRAY) { -#endif zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Metadata hash somehow contains wrong types.", 1 TSRMLS_CC); @@ -141,13 +124,8 @@ zval *grpc_parse_metadata_array(grpc_metadata_array efree(str_val); return NULL; } -#if PHP_MAJOR_VERSION < 7 - php_grpc_add_next_index_stringl(*data, str_val, elem->value_length, - false); -#else php_grpc_add_next_index_stringl(data, str_val, elem->value_length, false); -#endif } else { PHP_GRPC_MAKE_STD_ZVAL(inner_array); array_init(inner_array); @@ -164,96 +142,48 @@ zval *grpc_parse_metadata_array(grpc_metadata_array bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { HashTable *array_hash; HashTable *inner_array_hash; -#if PHP_MAJOR_VERSION < 7 - zval **inner_array; - zval **value; - HashPosition array_pointer; - HashPosition inner_array_pointer; - char *key; - uint key_len; - ulong index; -#else - zval *inner_array; zval *value; - zend_string *key; -#endif + zval *inner_array; if (Z_TYPE_P(array) != IS_ARRAY) { return false; } grpc_metadata_array_init(metadata); array_hash = Z_ARRVAL_P(array); -#if PHP_MAJOR_VERSION < 7 - for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, (void**)&inner_array, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)) { - if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, - &array_pointer) != HASH_KEY_IS_STRING) { - return false; - } - if (Z_TYPE_P(*inner_array) != IS_ARRAY) { - return false; - } - inner_array_hash = Z_ARRVAL_P(*inner_array); - metadata->capacity += zend_hash_num_elements(inner_array_hash); - } -#else - ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, inner_array) { - if (key == NULL) { + + char *key = NULL; + int key_type; + PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(array_hash, key, key_type, + inner_array) + if (key_type != HASH_KEY_IS_STRING) { return false; } if (Z_TYPE_P(inner_array) != IS_ARRAY) { return false; } - inner_array_hash = HASH_OF(inner_array); + inner_array_hash = Z_ARRVAL_P(inner_array); metadata->capacity += zend_hash_num_elements(inner_array_hash); - } ZEND_HASH_FOREACH_END(); -#endif + PHP_GRPC_HASH_FOREACH_END() metadata->metadata = gpr_malloc(metadata->capacity * sizeof(grpc_metadata)); -#if PHP_MAJOR_VERSION < 7 - for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, (void**)&inner_array, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)) { - if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, - &array_pointer) != HASH_KEY_IS_STRING) { + char *key1 = NULL; + int key_type1; + PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(array_hash, key1, key_type1, + inner_array) + if (key_type1 != HASH_KEY_IS_STRING) { return false; } - inner_array_hash = Z_ARRVAL_P(*inner_array); - for (zend_hash_internal_pointer_reset_ex(inner_array_hash, - &inner_array_pointer); - zend_hash_get_current_data_ex(inner_array_hash, (void**)&value, - &inner_array_pointer) == SUCCESS; - zend_hash_move_forward_ex(inner_array_hash, &inner_array_pointer)) { - if (Z_TYPE_P(*value) != IS_STRING) { - return false; - } - metadata->metadata[metadata->count].key = key; - metadata->metadata[metadata->count].value = Z_STRVAL_P(*value); - metadata->metadata[metadata->count].value_length = Z_STRLEN_P(*value); - metadata->count += 1; - } - } -#else - ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, inner_array) { - if (key == NULL) { - return false; - } - inner_array_hash = HASH_OF(inner_array); - - ZEND_HASH_FOREACH_VAL(inner_array_hash, value) { + inner_array_hash = Z_ARRVAL_P(inner_array); + PHP_GRPC_HASH_FOREACH_VAL_START(inner_array_hash, value) if (Z_TYPE_P(value) != IS_STRING) { return false; } - metadata->metadata[metadata->count].key = ZSTR_VAL(key); + metadata->metadata[metadata->count].key = key1; metadata->metadata[metadata->count].value = Z_STRVAL_P(value); metadata->metadata[metadata->count].value_length = Z_STRLEN_P(value); metadata->count += 1; - } ZEND_HASH_FOREACH_END(); - } ZEND_HASH_FOREACH_END(); -#endif + PHP_GRPC_HASH_FOREACH_END() + PHP_GRPC_HASH_FOREACH_END() return true; } @@ -321,23 +251,13 @@ PHP_METHOD(Call, startBatch) { PHP_GRPC_MAKE_STD_ZVAL(result); object_init(result); php_grpc_ulong index; -#if PHP_MAJOR_VERSION < 7 - zval **value; - zval **inner_value; - HashPosition array_pointer; - zval **message_value; - zval **message_flags; - char *key; - uint key_len; zval *recv_status; -#else + PHP_GRPC_MAKE_STD_ZVAL(recv_status); + object_init(recv_status); zval *value; zval *inner_value; zval *message_value; zval *message_flags; - zend_string *key; - zval recv_status; -#endif wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); grpc_op ops[8]; @@ -371,26 +291,23 @@ PHP_METHOD(Call, startBatch) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "start_batch expects an array", 1 TSRMLS_CC); - goto cleanup; + "start_batch expects an array", 1 TSRMLS_CC); goto cleanup; } -#if PHP_MAJOR_VERSION < 7 - array_hash = Z_ARRVAL_P(array); - for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, (void**)&value, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)) { - if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, - &array_pointer) != HASH_KEY_IS_LONG) { + + char *key = NULL; + int key_type; + PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(array_hash, key, key_type, index, + value) + if (key_type != HASH_KEY_IS_LONG) { zend_throw_exception(spl_ce_InvalidArgumentException, "batch keys must be integers", 1 TSRMLS_CC); goto cleanup; } switch(index) { case GRPC_OP_SEND_INITIAL_METADATA: - if (!create_metadata_array(*value, &metadata)) { + if (!create_metadata_array(value, &metadata)) { zend_throw_exception(spl_ce_InvalidArgumentException, "Bad metadata value given", 1 TSRMLS_CC); goto cleanup; @@ -401,41 +318,41 @@ PHP_METHOD(Call, startBatch) { metadata.metadata; break; case GRPC_OP_SEND_MESSAGE: - if (Z_TYPE_PP(value) != IS_ARRAY) { + if (Z_TYPE_P(value) != IS_ARRAY) { zend_throw_exception(spl_ce_InvalidArgumentException, "Expected an array for send message", 1 TSRMLS_CC); goto cleanup; } - message_hash = Z_ARRVAL_PP(value); - if (zend_hash_find(message_hash, "flags", sizeof("flags"), + message_hash = Z_ARRVAL_P(value); + if (php_grpc_zend_hash_find(message_hash, "flags", sizeof("flags"), (void **)&message_flags) == SUCCESS) { - if (Z_TYPE_PP(message_flags) != IS_LONG) { + if (Z_TYPE_P(message_flags) != IS_LONG) { zend_throw_exception(spl_ce_InvalidArgumentException, "Expected an int for message flags", 1 TSRMLS_CC); } - ops[op_num].flags = Z_LVAL_PP(message_flags) & GRPC_WRITE_USED_MASK; + ops[op_num].flags = Z_LVAL_P(message_flags) & GRPC_WRITE_USED_MASK; } - if (zend_hash_find(message_hash, "message", sizeof("message"), + if (php_grpc_zend_hash_find(message_hash, "message", sizeof("message"), (void **)&message_value) != SUCCESS || - Z_TYPE_PP(message_value) != IS_STRING) { + Z_TYPE_P(message_value) != IS_STRING) { zend_throw_exception(spl_ce_InvalidArgumentException, "Expected a string for send message", 1 TSRMLS_CC); goto cleanup; } ops[op_num].data.send_message = - string_to_byte_buffer(Z_STRVAL_PP(message_value), - Z_STRLEN_PP(message_value)); + string_to_byte_buffer(Z_STRVAL_P(message_value), + Z_STRLEN_P(message_value)); break; case GRPC_OP_SEND_CLOSE_FROM_CLIENT: break; case GRPC_OP_SEND_STATUS_FROM_SERVER: - status_hash = Z_ARRVAL_PP(value); - if (zend_hash_find(status_hash, "metadata", sizeof("metadata"), + status_hash = Z_ARRVAL_P(value); + if (php_grpc_zend_hash_find(status_hash, "metadata", sizeof("metadata"), (void **)&inner_value) == SUCCESS) { - if (!create_metadata_array(*inner_value, &trailing_metadata)) { + if (!create_metadata_array(inner_value, &trailing_metadata)) { zend_throw_exception(spl_ce_InvalidArgumentException, "Bad trailing metadata value given", 1 TSRMLS_CC); @@ -446,32 +363,32 @@ PHP_METHOD(Call, startBatch) { ops[op_num].data.send_status_from_server.trailing_metadata_count = trailing_metadata.count; } - if (zend_hash_find(status_hash, "code", sizeof("code"), + if (php_grpc_zend_hash_find(status_hash, "code", sizeof("code"), (void**)&inner_value) == SUCCESS) { - if (Z_TYPE_PP(inner_value) != IS_LONG) { + if (Z_TYPE_P(inner_value) != IS_LONG) { zend_throw_exception(spl_ce_InvalidArgumentException, "Status code must be an integer", 1 TSRMLS_CC); goto cleanup; } ops[op_num].data.send_status_from_server.status = - Z_LVAL_PP(inner_value); + Z_LVAL_P(inner_value); } else { zend_throw_exception(spl_ce_InvalidArgumentException, "Integer status code is required", 1 TSRMLS_CC); goto cleanup; } - if (zend_hash_find(status_hash, "details", sizeof("details"), + if (php_grpc_zend_hash_find(status_hash, "details", sizeof("details"), (void**)&inner_value) == SUCCESS) { - if (Z_TYPE_PP(inner_value) != IS_STRING) { + if (Z_TYPE_P(inner_value) != IS_STRING) { zend_throw_exception(spl_ce_InvalidArgumentException, "Status details must be a string", 1 TSRMLS_CC); goto cleanup; } ops[op_num].data.send_status_from_server.status_details = - Z_STRVAL_PP(inner_value); + Z_STRVAL_P(inner_value); } else { zend_throw_exception(spl_ce_InvalidArgumentException, "String status details is required", @@ -506,131 +423,7 @@ PHP_METHOD(Call, startBatch) { ops[op_num].flags = 0; ops[op_num].reserved = NULL; op_num++; - } - -#else - - array_hash = HASH_OF(array); - ZEND_HASH_FOREACH_KEY_VAL(array_hash, index, key, value) { - if (key) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "batch keys must be integers", 1); - goto cleanup; - } - - switch(index) { - case GRPC_OP_SEND_INITIAL_METADATA: - if (!create_metadata_array(value, &metadata)) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Bad metadata value given", 1); - goto cleanup; - } - ops[op_num].data.send_initial_metadata.count = metadata.count; - ops[op_num].data.send_initial_metadata.metadata = metadata.metadata; - break; - case GRPC_OP_SEND_MESSAGE: - if (Z_TYPE_P(value) != IS_ARRAY) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Expected an array for send message", 1); - goto cleanup; - } - message_hash = HASH_OF(value); - if ((message_flags = - zend_hash_str_find(message_hash, "flags", - sizeof("flags") - 1)) != NULL) { - if (Z_TYPE_P(message_flags) != IS_LONG) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Expected an int for message flags", 1); - } - ops[op_num].flags = Z_LVAL_P(message_flags) & GRPC_WRITE_USED_MASK; - } - if ((message_value = zend_hash_str_find(message_hash, "message", - sizeof("message") - 1)) - == NULL || Z_TYPE_P(message_value) != IS_STRING) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Expected a string for send message", 1); - goto cleanup; - } - ops[op_num].data.send_message = - string_to_byte_buffer(Z_STRVAL_P(message_value), - Z_STRLEN_P(message_value)); - break; - case GRPC_OP_SEND_CLOSE_FROM_CLIENT: - break; - case GRPC_OP_SEND_STATUS_FROM_SERVER: - status_hash = HASH_OF(value); - if ((inner_value = zend_hash_str_find(status_hash, "metadata", - sizeof("metadata") - 1)) - != NULL) { - if (!create_metadata_array(inner_value, &trailing_metadata)) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Bad trailing metadata value given", 1); - goto cleanup; - } - ops[op_num].data.send_status_from_server.trailing_metadata = - trailing_metadata.metadata; - ops[op_num].data.send_status_from_server.trailing_metadata_count = - trailing_metadata.count; - } - if ((inner_value = zend_hash_str_find(status_hash, "code", - sizeof("code") - 1)) != NULL) { - if (Z_TYPE_P(inner_value) != IS_LONG) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Status code must be an integer", 1); - goto cleanup; - } - ops[op_num].data.send_status_from_server.status = - Z_LVAL_P(inner_value); - } else { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Integer status code is required", 1); - goto cleanup; - } - if ((inner_value = zend_hash_str_find(status_hash, "details", - sizeof("details") - 1)) != NULL) { - if (Z_TYPE_P(inner_value) != IS_STRING) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Status details must be a string", 1); - goto cleanup; - } - ops[op_num].data.send_status_from_server.status_details = - Z_STRVAL_P(inner_value); - } else { - zend_throw_exception(spl_ce_InvalidArgumentException, - "String status details is required", 1); - goto cleanup; - } - break; - case GRPC_OP_RECV_INITIAL_METADATA: - ops[op_num].data.recv_initial_metadata = &recv_metadata; - break; - case GRPC_OP_RECV_MESSAGE: - ops[op_num].data.recv_message = &message; - break; - case GRPC_OP_RECV_STATUS_ON_CLIENT: - ops[op_num].data.recv_status_on_client.trailing_metadata = - &recv_trailing_metadata; - ops[op_num].data.recv_status_on_client.status = &status; - ops[op_num].data.recv_status_on_client.status_details = - &status_details; - ops[op_num].data.recv_status_on_client.status_details_capacity = - &status_details_capacity; - break; - case GRPC_OP_RECV_CLOSE_ON_SERVER: - ops[op_num].data.recv_close_on_server.cancelled = &cancelled; - break; - default: - zend_throw_exception(spl_ce_InvalidArgumentException, - "Unrecognized key in batch", 1); - goto cleanup; - } - ops[op_num].op = (grpc_op_type)index; - ops[op_num].flags = 0; - ops[op_num].reserved = NULL; - op_num++; - } ZEND_HASH_FOREACH_END(); - -#endif + PHP_GRPC_HASH_FOREACH_END() error = grpc_call_start_batch(call->wrapped, ops, op_num, call->wrapped, NULL); @@ -642,7 +435,9 @@ PHP_METHOD(Call, startBatch) { } grpc_completion_queue_pluck(completion_queue, call->wrapped, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); -#if PHP_MAJOR_VERSION < 7 +#if PHP_MAJOR_VERSION >= 7 + zval recv_md; +#endif for (int i = 0; i < op_num; i++) { switch(ops[i].op) { case GRPC_OP_SEND_INITIAL_METADATA: @@ -658,73 +453,37 @@ PHP_METHOD(Call, startBatch) { add_property_bool(result, "send_status", true); break; case GRPC_OP_RECV_INITIAL_METADATA: +#if PHP_MAJOR_VERSION < 7 array = grpc_parse_metadata_array(&recv_metadata TSRMLS_CC); add_property_zval(result, "metadata", array); - Z_DELREF_P(array); - break; - case GRPC_OP_RECV_MESSAGE: - byte_buffer_to_string(message, &message_str, &message_len); - if (message_str == NULL) { - add_property_null(result, "message"); - } else { - add_property_stringl(result, "message", message_str, message_len, - false); - } - break; - case GRPC_OP_RECV_STATUS_ON_CLIENT: - MAKE_STD_ZVAL(recv_status); - object_init(recv_status); - array = grpc_parse_metadata_array(&recv_trailing_metadata TSRMLS_CC); - add_property_zval(recv_status, "metadata", array); - Z_DELREF_P(array); - add_property_long(recv_status, "code", status); - add_property_string(recv_status, "details", status_details, true); - add_property_zval(result, "status", recv_status); - Z_DELREF_P(recv_status); - break; - case GRPC_OP_RECV_CLOSE_ON_SERVER: - add_property_bool(result, "cancelled", cancelled); - break; - default: - break; - } - } #else - zval recv_md; - for (int i = 0; i < op_num; i++) { - switch(ops[i].op) { - case GRPC_OP_SEND_INITIAL_METADATA: - add_property_bool(result, "send_metadata", true); - break; - case GRPC_OP_SEND_MESSAGE: - add_property_bool(result, "send_message", true); - break; - case GRPC_OP_SEND_CLOSE_FROM_CLIENT: - add_property_bool(result, "send_close", true); - break; - case GRPC_OP_SEND_STATUS_FROM_SERVER: - add_property_bool(result, "send_status", true); - break; - case GRPC_OP_RECV_INITIAL_METADATA: recv_md = *grpc_parse_metadata_array(&recv_metadata); add_property_zval(result, "metadata", &recv_md); +#endif + PHP_GRPC_DELREF(array); break; case GRPC_OP_RECV_MESSAGE: byte_buffer_to_string(message, &message_str, &message_len); if (message_str == NULL) { add_property_null(result, "message"); } else { - add_property_stringl(result, "message", message_str, - message_len); + php_grpc_add_property_stringl(result, "message", message_str, + message_len, false); } break; case GRPC_OP_RECV_STATUS_ON_CLIENT: - object_init(&recv_status); +#if PHP_MAJOR_VERSION < 7 + array = grpc_parse_metadata_array(&recv_trailing_metadata TSRMLS_CC); + add_property_zval(recv_status, "metadata", array); +#else recv_md = *grpc_parse_metadata_array(&recv_trailing_metadata); - add_property_zval(&recv_status, "metadata", &recv_md); - add_property_long(&recv_status, "code", status); - add_property_string(&recv_status, "details", status_details); - add_property_zval(result, "status", &recv_status); + add_property_zval(recv_status, "metadata", &recv_md); +#endif + PHP_GRPC_DELREF(array); + add_property_long(recv_status, "code", status); + php_grpc_add_property_string(recv_status, "details", status_details, true); + add_property_zval(result, "status", recv_status); + PHP_GRPC_DELREF(recv_status); break; case GRPC_OP_RECV_CLOSE_ON_SERVER: add_property_bool(result, "cancelled", cancelled); @@ -733,7 +492,6 @@ PHP_METHOD(Call, startBatch) { break; } } -#endif cleanup: grpc_metadata_array_destroy(&metadata); diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index 0c55745524..b7d33d7239 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -67,16 +67,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * associated with an object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_call_credentials( zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_call_credentials *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_call_credentials *)emalloc( - sizeof(wrapped_grpc_call_credentials)); - memset(intern, 0, sizeof(wrapped_grpc_call_credentials)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_call_credentials) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 69264842f0..325e8f495e 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -71,15 +71,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_channel(zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_channel *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_channel *)emalloc(sizeof(wrapped_grpc_channel)); - memset(intern, 0, sizeof(wrapped_grpc_channel)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_channel) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_channel); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 @@ -98,16 +90,6 @@ void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args TSRMLS_DC) { HashTable *array_hash; int args_index; -#if PHP_MAJOR_VERSION < 7 - HashPosition array_pointer; - zval **data; - char *key; - uint key_len; - ulong index; -#else - zval *data; - zend_string *key; -#endif array_hash = Z_ARRVAL_P(args_array); if (!array_hash) { zend_throw_exception(spl_ce_InvalidArgumentException, @@ -118,41 +100,17 @@ void php_grpc_read_args_array(zval *args_array, args->args = ecalloc(args->num_args, sizeof(grpc_arg)); args_index = 0; -#if PHP_MAJOR_VERSION < 7 - for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, (void **)&data, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)) { - if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, - &array_pointer) != HASH_KEY_IS_STRING) { + char *key = NULL; + zval *data; + int key_type; + + PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(array_hash, key, key_type, data) + if (key_type != HASH_KEY_IS_STRING) { zend_throw_exception(spl_ce_InvalidArgumentException, "args keys must be strings", 1 TSRMLS_CC); return; } args->args[args_index].key = key; - switch (Z_TYPE_P(*data)) { - case IS_LONG: - args->args[args_index].value.integer = (int)Z_LVAL_P(*data); - args->args[args_index].type = GRPC_ARG_INTEGER; - break; - case IS_STRING: - args->args[args_index].value.string = Z_STRVAL_P(*data); - args->args[args_index].type = GRPC_ARG_STRING; - break; - default: - zend_throw_exception(spl_ce_InvalidArgumentException, - "args values must be int or string", 1 TSRMLS_CC); - return; - } - args_index++; - } -#else - ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, data) { - if (key == NULL) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "args keys must be strings", 1); - } - args->args[args_index].key = ZSTR_VAL(key); switch (Z_TYPE_P(data)) { case IS_LONG: args->args[args_index].value.integer = (int)Z_LVAL_P(data); @@ -164,12 +122,11 @@ void php_grpc_read_args_array(zval *args_array, break; default: zend_throw_exception(spl_ce_InvalidArgumentException, - "args values must be int or string", 1); + "args values must be int or string", 1 TSRMLS_CC); return; } args_index++; - } ZEND_HASH_FOREACH_END(); -#endif + PHP_GRPC_HASH_FOREACH_END() } /** @@ -181,11 +138,7 @@ void php_grpc_read_args_array(zval *args_array, */ PHP_METHOD(Channel, __construct) { wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis()); -#if PHP_MAJOR_VERSION < 7 - zval **creds_obj = NULL; -#else zval *creds_obj = NULL; -#endif char *target; php_grpc_int target_length; zval *args_array = NULL; @@ -200,43 +153,23 @@ PHP_METHOD(Channel, __construct) { "Channel expects a string and an array", 1 TSRMLS_CC); return; } -#if PHP_MAJOR_VERSION < 7 array_hash = Z_ARRVAL_P(args_array); - if (zend_hash_find(array_hash, "credentials", sizeof("credentials"), + if (php_grpc_zend_hash_find(array_hash, "credentials", sizeof("credentials"), (void **)&creds_obj) == SUCCESS) { - if (Z_TYPE_P(*creds_obj) == IS_NULL) { - creds = NULL; - zend_hash_del(array_hash, "credentials", 12); - } else if (zend_get_class_entry(*creds_obj TSRMLS_CC) != - grpc_ce_channel_credentials) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "credentials must be a ChannelCredentials object", - 1 TSRMLS_CC); - return; - } else { - creds = (wrapped_grpc_channel_credentials *)zend_object_store_get_object( - *creds_obj TSRMLS_CC); - zend_hash_del(array_hash, "credentials", 12); - } - } -#else - array_hash = HASH_OF(args_array); - if ((creds_obj = zend_hash_str_find(array_hash, "credentials", - sizeof("credentials") - 1)) != NULL) { if (Z_TYPE_P(creds_obj) == IS_NULL) { creds = NULL; - zend_hash_str_del(array_hash, "credentials", sizeof("credentials") - 1); - } else if (Z_OBJ_P(creds_obj)->ce != grpc_ce_channel_credentials) { + php_grpc_zend_hash_del(array_hash, "credentials", sizeof("credentials")); + } else if (PHP_GRPC_GET_CLASS_ENTRY(creds_obj) != + grpc_ce_channel_credentials) { zend_throw_exception(spl_ce_InvalidArgumentException, "credentials must be a ChannelCredentials object", - 1); + 1 TSRMLS_CC); return; } else { creds = Z_WRAPPED_GRPC_CHANNEL_CREDS_P(creds_obj); - zend_hash_str_del(array_hash, "credentials", sizeof("credentials") - 1); + php_grpc_zend_hash_del(array_hash, "credentials", sizeof("credentials")); } } -#endif php_grpc_read_args_array(args_array, &args TSRMLS_CC); if (creds == NULL) { channel->wrapped = grpc_insecure_channel_create(target, &args, NULL); @@ -292,8 +225,7 @@ PHP_METHOD(Channel, watchConnectivityState) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lO", &last_state, &deadline_obj, grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "watchConnectivityState expects 1 long 1 timeval", - 1 TSRMLS_CC); + "watchConnectivityState expects 1 long 1 timeval", 1 TSRMLS_CC); return; } diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index cef435cc6e..32f24e5751 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -77,16 +77,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * associated with an object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_channel_credentials( zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_channel_credentials *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_channel_credentials *)emalloc( - sizeof(wrapped_grpc_channel_credentials)); - memset(intern, 0, sizeof(wrapped_grpc_channel_credentials)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_channel_credentials) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_channel_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 7d7470f8a9..ba7f163676 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -50,6 +50,7 @@ #define PHP_GRPC_RETURN_STRING(val, dup) RETURN_STRING(val, dup) #define PHP_GRPC_MAKE_STD_ZVAL(pzv) MAKE_STD_ZVAL(pzv) +#define PHP_GRPC_DELREF(zv) Z_DELREF_P(zv) #define PHP_GRPC_WRAP_OBJECT_START(name) \ typedef struct name { \ @@ -65,6 +66,58 @@ efree(p); \ } +#define PHP_GRPC_ALLOC_CLASS_OBJECT(class_object) \ + class_object *intern; \ + zend_object_value retval; \ + intern = (class_object *)emalloc(sizeof(class_object)); \ + memset(intern, 0, sizeof(class_object)); + +#define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data) \ + zval **tmp_data = NULL; \ + for (zend_hash_internal_pointer_reset(ht); \ + zend_hash_get_current_data(ht, (void**)&tmp_data) == SUCCESS; \ + zend_hash_move_forward(ht)) { \ + data = *tmp_data; + +#define PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(ht, key, key_type, data) \ + zval **tmp##key = NULL; \ + ulong index##key; \ + uint len##key; \ + for (zend_hash_internal_pointer_reset(ht); \ + zend_hash_get_current_data(ht, (void**)&tmp##key) == SUCCESS; \ + zend_hash_move_forward(ht)) { \ + key_type = zend_hash_get_current_key_ex(ht, &key, &len##key, &index##key,\ + 0, NULL); \ + data = *tmp##key; + +#define PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(ht, key, key_type, index,\ + data) \ + zval **tmp##key = NULL; \ + uint len##key; \ + for (zend_hash_internal_pointer_reset(ht); \ + zend_hash_get_current_data(ht, (void**)&tmp##key) == SUCCESS; \ + zend_hash_move_forward(ht)) { \ + key_type = zend_hash_get_current_key_ex(ht, &key, &len##key, &index,\ + 0, NULL); \ + data = *tmp##key; + +#define PHP_GRPC_HASH_FOREACH_END() } + +static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, void **value) { + zval **data = NULL; + if (zend_hash_find(ht, key, len, (void **)&data) == SUCCESS) { + *value = *data; + return SUCCESS; + } else { + *value = NULL; + return FAILURE; + } +} + +#define php_grpc_zend_hash_del zend_hash_del + +#define PHP_GRPC_GET_CLASS_ENTRY(object) zend_get_class_entry(object TSRMLS_CC) + #else #define php_grpc_int size_t @@ -82,6 +135,7 @@ #define PHP_GRPC_MAKE_STD_ZVAL(pzv) \ zval _stack_zval_##pzv; \ pzv = &(_stack_zval_##pzv) +#define PHP_GRPC_DELREF(zv) #define PHP_GRPC_WRAP_OBJECT_START(name) \ typedef struct name { @@ -99,6 +153,45 @@ zend_object_std_dtor(&p->std); \ } +#define PHP_GRPC_ALLOC_CLASS_OBJECT(class_object) \ + class_object *intern; \ + intern = ecalloc(1, sizeof(class_object) + \ + zend_object_properties_size(class_type)); + +#define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data) \ + ZEND_HASH_FOREACH_VAL(ht, data) { + +#define PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(ht, key, key_type, data) \ + zend_string *(zs_##key); \ + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, (zs_##key), data) { \ + if ((zs_##key) == NULL) {key = NULL; key_type = HASH_KEY_IS_LONG;} \ + else {key = (zs_##key)->val; key_type = HASH_KEY_IS_STRING;} + +#define PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(ht, key, key_type, index, \ + data) \ + zend_string *(zs_##key); \ + ZEND_HASH_FOREACH_KEY_VAL(ht, index, zs_##key, data) { \ + if ((zs_##key) == NULL) {key = NULL; key_type = HASH_KEY_IS_LONG;} \ + else {key = (zs_##key)->val; key_type = HASH_KEY_IS_STRING;} + +#define PHP_GRPC_HASH_FOREACH_END() } ZEND_HASH_FOREACH_END(); + +static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, void **value) { + zval *value_tmp = zend_hash_str_find(ht, key, len -1); + if (value_tmp == NULL) { + return FAILURE; + } else { + *value = (void *)value_tmp; + return SUCCESS; + } +} + +static inline int php_grpc_zend_hash_del(HashTable *ht, char *key, int len) { + return zend_hash_str_del(ht, key, len - 1); +} + +#define PHP_GRPC_GET_CLASS_ENTRY(object) Z_OBJ_P(object)->ce + #endif /* PHP_MAJOR_VERSION */ #endif /* PHP7_WRAPPER_GRPC_H */ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index d8ebd4472d..2fc785eb31 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -76,15 +76,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_server(zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_server *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_server *)emalloc(sizeof(wrapped_grpc_server)); - memset(intern, 0, sizeof(wrapped_grpc_server)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_server) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 921436a1bb..4c147e0991 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -65,16 +65,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * with an object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_server_credentials( zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_server_credentials *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_server_credentials *)emalloc( - sizeof(wrapped_grpc_server_credentials)); - memset(intern, 0, sizeof(wrapped_grpc_server_credentials)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_server_credentials) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 33d11f83cc..d0f75bef82 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -63,15 +63,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_timeval *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_timeval *)emalloc(sizeof(wrapped_grpc_timeval)); - memset(intern, 0, sizeof(wrapped_grpc_timeval)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_timeval) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_timeval); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 -- cgit v1.2.3 From eb9c54574662b5f9cc6812ef67d43fe654a3052e Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 02:35:26 +0800 Subject: add some macro to reduce duplicate code --- src/php/ext/grpc/call.c | 382 ++++++--------------------------- src/php/ext/grpc/call_credentials.c | 11 +- src/php/ext/grpc/channel.c | 100 ++------- src/php/ext/grpc/channel_credentials.c | 11 +- src/php/ext/grpc/php7_wrapper.h | 93 ++++++++ src/php/ext/grpc/server.c | 10 +- src/php/ext/grpc/server_credentials.c | 11 +- src/php/ext/grpc/timeval.c | 10 +- 8 files changed, 184 insertions(+), 444 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 706c7d8c3a..46591d8738 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -73,15 +73,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_call(zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_call *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_call *)emalloc(sizeof(wrapped_grpc_call)); - memset(intern, 0, sizeof(wrapped_grpc_call)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_call) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 @@ -111,11 +103,7 @@ zval *grpc_parse_metadata_array(grpc_metadata_array char *str_key; char *str_val; size_t key_len; -#if PHP_MAJOR_VERSION < 7 - zval **data = NULL; -#else - zval *data; -#endif + zval *data = NULL; array_hash = Z_ARRVAL_P(array); grpc_metadata *elem; @@ -126,14 +114,9 @@ zval *grpc_parse_metadata_array(grpc_metadata_array memcpy(str_key, elem->key, key_len); str_val = ecalloc(elem->value_length + 1, sizeof(char)); memcpy(str_val, elem->value, elem->value_length); -#if PHP_MAJOR_VERSION < 7 - if (zend_hash_find(array_hash, str_key, key_len, (void **)data) == + if (php_grpc_zend_hash_find(array_hash, str_key, key_len, (void **)&data) == SUCCESS) { - if (Z_TYPE_P(*data) != IS_ARRAY) { -#else - if ((data = zend_hash_str_find(array_hash, str_key, key_len)) != NULL) { if (Z_TYPE_P(data) != IS_ARRAY) { -#endif zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Metadata hash somehow contains wrong types.", 1 TSRMLS_CC); @@ -141,13 +124,8 @@ zval *grpc_parse_metadata_array(grpc_metadata_array efree(str_val); return NULL; } -#if PHP_MAJOR_VERSION < 7 - php_grpc_add_next_index_stringl(*data, str_val, elem->value_length, - false); -#else php_grpc_add_next_index_stringl(data, str_val, elem->value_length, false); -#endif } else { PHP_GRPC_MAKE_STD_ZVAL(inner_array); array_init(inner_array); @@ -164,96 +142,48 @@ zval *grpc_parse_metadata_array(grpc_metadata_array bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { HashTable *array_hash; HashTable *inner_array_hash; -#if PHP_MAJOR_VERSION < 7 - zval **inner_array; - zval **value; - HashPosition array_pointer; - HashPosition inner_array_pointer; - char *key; - uint key_len; - ulong index; -#else - zval *inner_array; zval *value; - zend_string *key; -#endif + zval *inner_array; if (Z_TYPE_P(array) != IS_ARRAY) { return false; } grpc_metadata_array_init(metadata); array_hash = Z_ARRVAL_P(array); -#if PHP_MAJOR_VERSION < 7 - for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, (void**)&inner_array, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)) { - if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, - &array_pointer) != HASH_KEY_IS_STRING) { - return false; - } - if (Z_TYPE_P(*inner_array) != IS_ARRAY) { - return false; - } - inner_array_hash = Z_ARRVAL_P(*inner_array); - metadata->capacity += zend_hash_num_elements(inner_array_hash); - } -#else - ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, inner_array) { - if (key == NULL) { + + char *key = NULL; + int key_type; + PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(array_hash, key, key_type, + inner_array) + if (key_type != HASH_KEY_IS_STRING) { return false; } if (Z_TYPE_P(inner_array) != IS_ARRAY) { return false; } - inner_array_hash = HASH_OF(inner_array); + inner_array_hash = Z_ARRVAL_P(inner_array); metadata->capacity += zend_hash_num_elements(inner_array_hash); - } ZEND_HASH_FOREACH_END(); -#endif + PHP_GRPC_HASH_FOREACH_END() metadata->metadata = gpr_malloc(metadata->capacity * sizeof(grpc_metadata)); -#if PHP_MAJOR_VERSION < 7 - for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, (void**)&inner_array, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)) { - if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, - &array_pointer) != HASH_KEY_IS_STRING) { + char *key1 = NULL; + int key_type1; + PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(array_hash, key1, key_type1, + inner_array) + if (key_type1 != HASH_KEY_IS_STRING) { return false; } - inner_array_hash = Z_ARRVAL_P(*inner_array); - for (zend_hash_internal_pointer_reset_ex(inner_array_hash, - &inner_array_pointer); - zend_hash_get_current_data_ex(inner_array_hash, (void**)&value, - &inner_array_pointer) == SUCCESS; - zend_hash_move_forward_ex(inner_array_hash, &inner_array_pointer)) { - if (Z_TYPE_P(*value) != IS_STRING) { - return false; - } - metadata->metadata[metadata->count].key = key; - metadata->metadata[metadata->count].value = Z_STRVAL_P(*value); - metadata->metadata[metadata->count].value_length = Z_STRLEN_P(*value); - metadata->count += 1; - } - } -#else - ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, inner_array) { - if (key == NULL) { - return false; - } - inner_array_hash = HASH_OF(inner_array); - - ZEND_HASH_FOREACH_VAL(inner_array_hash, value) { + inner_array_hash = Z_ARRVAL_P(inner_array); + PHP_GRPC_HASH_FOREACH_VAL_START(inner_array_hash, value) if (Z_TYPE_P(value) != IS_STRING) { return false; } - metadata->metadata[metadata->count].key = ZSTR_VAL(key); + metadata->metadata[metadata->count].key = key1; metadata->metadata[metadata->count].value = Z_STRVAL_P(value); metadata->metadata[metadata->count].value_length = Z_STRLEN_P(value); metadata->count += 1; - } ZEND_HASH_FOREACH_END(); - } ZEND_HASH_FOREACH_END(); -#endif + PHP_GRPC_HASH_FOREACH_END() + PHP_GRPC_HASH_FOREACH_END() return true; } @@ -321,23 +251,13 @@ PHP_METHOD(Call, startBatch) { PHP_GRPC_MAKE_STD_ZVAL(result); object_init(result); php_grpc_ulong index; -#if PHP_MAJOR_VERSION < 7 - zval **value; - zval **inner_value; - HashPosition array_pointer; - zval **message_value; - zval **message_flags; - char *key; - uint key_len; zval *recv_status; -#else + PHP_GRPC_MAKE_STD_ZVAL(recv_status); + object_init(recv_status); zval *value; zval *inner_value; zval *message_value; zval *message_flags; - zend_string *key; - zval recv_status; -#endif wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis()); grpc_op ops[8]; @@ -371,26 +291,23 @@ PHP_METHOD(Call, startBatch) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "start_batch expects an array", 1 TSRMLS_CC); - goto cleanup; + "start_batch expects an array", 1 TSRMLS_CC); goto cleanup; } -#if PHP_MAJOR_VERSION < 7 - array_hash = Z_ARRVAL_P(array); - for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, (void**)&value, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)) { - if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, - &array_pointer) != HASH_KEY_IS_LONG) { + + char *key = NULL; + int key_type; + PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(array_hash, key, key_type, index, + value) + if (key_type != HASH_KEY_IS_LONG) { zend_throw_exception(spl_ce_InvalidArgumentException, "batch keys must be integers", 1 TSRMLS_CC); goto cleanup; } switch(index) { case GRPC_OP_SEND_INITIAL_METADATA: - if (!create_metadata_array(*value, &metadata)) { + if (!create_metadata_array(value, &metadata)) { zend_throw_exception(spl_ce_InvalidArgumentException, "Bad metadata value given", 1 TSRMLS_CC); goto cleanup; @@ -401,41 +318,41 @@ PHP_METHOD(Call, startBatch) { metadata.metadata; break; case GRPC_OP_SEND_MESSAGE: - if (Z_TYPE_PP(value) != IS_ARRAY) { + if (Z_TYPE_P(value) != IS_ARRAY) { zend_throw_exception(spl_ce_InvalidArgumentException, "Expected an array for send message", 1 TSRMLS_CC); goto cleanup; } - message_hash = Z_ARRVAL_PP(value); - if (zend_hash_find(message_hash, "flags", sizeof("flags"), + message_hash = Z_ARRVAL_P(value); + if (php_grpc_zend_hash_find(message_hash, "flags", sizeof("flags"), (void **)&message_flags) == SUCCESS) { - if (Z_TYPE_PP(message_flags) != IS_LONG) { + if (Z_TYPE_P(message_flags) != IS_LONG) { zend_throw_exception(spl_ce_InvalidArgumentException, "Expected an int for message flags", 1 TSRMLS_CC); } - ops[op_num].flags = Z_LVAL_PP(message_flags) & GRPC_WRITE_USED_MASK; + ops[op_num].flags = Z_LVAL_P(message_flags) & GRPC_WRITE_USED_MASK; } - if (zend_hash_find(message_hash, "message", sizeof("message"), + if (php_grpc_zend_hash_find(message_hash, "message", sizeof("message"), (void **)&message_value) != SUCCESS || - Z_TYPE_PP(message_value) != IS_STRING) { + Z_TYPE_P(message_value) != IS_STRING) { zend_throw_exception(spl_ce_InvalidArgumentException, "Expected a string for send message", 1 TSRMLS_CC); goto cleanup; } ops[op_num].data.send_message = - string_to_byte_buffer(Z_STRVAL_PP(message_value), - Z_STRLEN_PP(message_value)); + string_to_byte_buffer(Z_STRVAL_P(message_value), + Z_STRLEN_P(message_value)); break; case GRPC_OP_SEND_CLOSE_FROM_CLIENT: break; case GRPC_OP_SEND_STATUS_FROM_SERVER: - status_hash = Z_ARRVAL_PP(value); - if (zend_hash_find(status_hash, "metadata", sizeof("metadata"), + status_hash = Z_ARRVAL_P(value); + if (php_grpc_zend_hash_find(status_hash, "metadata", sizeof("metadata"), (void **)&inner_value) == SUCCESS) { - if (!create_metadata_array(*inner_value, &trailing_metadata)) { + if (!create_metadata_array(inner_value, &trailing_metadata)) { zend_throw_exception(spl_ce_InvalidArgumentException, "Bad trailing metadata value given", 1 TSRMLS_CC); @@ -446,32 +363,32 @@ PHP_METHOD(Call, startBatch) { ops[op_num].data.send_status_from_server.trailing_metadata_count = trailing_metadata.count; } - if (zend_hash_find(status_hash, "code", sizeof("code"), + if (php_grpc_zend_hash_find(status_hash, "code", sizeof("code"), (void**)&inner_value) == SUCCESS) { - if (Z_TYPE_PP(inner_value) != IS_LONG) { + if (Z_TYPE_P(inner_value) != IS_LONG) { zend_throw_exception(spl_ce_InvalidArgumentException, "Status code must be an integer", 1 TSRMLS_CC); goto cleanup; } ops[op_num].data.send_status_from_server.status = - Z_LVAL_PP(inner_value); + Z_LVAL_P(inner_value); } else { zend_throw_exception(spl_ce_InvalidArgumentException, "Integer status code is required", 1 TSRMLS_CC); goto cleanup; } - if (zend_hash_find(status_hash, "details", sizeof("details"), + if (php_grpc_zend_hash_find(status_hash, "details", sizeof("details"), (void**)&inner_value) == SUCCESS) { - if (Z_TYPE_PP(inner_value) != IS_STRING) { + if (Z_TYPE_P(inner_value) != IS_STRING) { zend_throw_exception(spl_ce_InvalidArgumentException, "Status details must be a string", 1 TSRMLS_CC); goto cleanup; } ops[op_num].data.send_status_from_server.status_details = - Z_STRVAL_PP(inner_value); + Z_STRVAL_P(inner_value); } else { zend_throw_exception(spl_ce_InvalidArgumentException, "String status details is required", @@ -506,131 +423,7 @@ PHP_METHOD(Call, startBatch) { ops[op_num].flags = 0; ops[op_num].reserved = NULL; op_num++; - } - -#else - - array_hash = HASH_OF(array); - ZEND_HASH_FOREACH_KEY_VAL(array_hash, index, key, value) { - if (key) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "batch keys must be integers", 1); - goto cleanup; - } - - switch(index) { - case GRPC_OP_SEND_INITIAL_METADATA: - if (!create_metadata_array(value, &metadata)) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Bad metadata value given", 1); - goto cleanup; - } - ops[op_num].data.send_initial_metadata.count = metadata.count; - ops[op_num].data.send_initial_metadata.metadata = metadata.metadata; - break; - case GRPC_OP_SEND_MESSAGE: - if (Z_TYPE_P(value) != IS_ARRAY) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Expected an array for send message", 1); - goto cleanup; - } - message_hash = HASH_OF(value); - if ((message_flags = - zend_hash_str_find(message_hash, "flags", - sizeof("flags") - 1)) != NULL) { - if (Z_TYPE_P(message_flags) != IS_LONG) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Expected an int for message flags", 1); - } - ops[op_num].flags = Z_LVAL_P(message_flags) & GRPC_WRITE_USED_MASK; - } - if ((message_value = zend_hash_str_find(message_hash, "message", - sizeof("message") - 1)) - == NULL || Z_TYPE_P(message_value) != IS_STRING) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Expected a string for send message", 1); - goto cleanup; - } - ops[op_num].data.send_message = - string_to_byte_buffer(Z_STRVAL_P(message_value), - Z_STRLEN_P(message_value)); - break; - case GRPC_OP_SEND_CLOSE_FROM_CLIENT: - break; - case GRPC_OP_SEND_STATUS_FROM_SERVER: - status_hash = HASH_OF(value); - if ((inner_value = zend_hash_str_find(status_hash, "metadata", - sizeof("metadata") - 1)) - != NULL) { - if (!create_metadata_array(inner_value, &trailing_metadata)) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Bad trailing metadata value given", 1); - goto cleanup; - } - ops[op_num].data.send_status_from_server.trailing_metadata = - trailing_metadata.metadata; - ops[op_num].data.send_status_from_server.trailing_metadata_count = - trailing_metadata.count; - } - if ((inner_value = zend_hash_str_find(status_hash, "code", - sizeof("code") - 1)) != NULL) { - if (Z_TYPE_P(inner_value) != IS_LONG) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Status code must be an integer", 1); - goto cleanup; - } - ops[op_num].data.send_status_from_server.status = - Z_LVAL_P(inner_value); - } else { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Integer status code is required", 1); - goto cleanup; - } - if ((inner_value = zend_hash_str_find(status_hash, "details", - sizeof("details") - 1)) != NULL) { - if (Z_TYPE_P(inner_value) != IS_STRING) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "Status details must be a string", 1); - goto cleanup; - } - ops[op_num].data.send_status_from_server.status_details = - Z_STRVAL_P(inner_value); - } else { - zend_throw_exception(spl_ce_InvalidArgumentException, - "String status details is required", 1); - goto cleanup; - } - break; - case GRPC_OP_RECV_INITIAL_METADATA: - ops[op_num].data.recv_initial_metadata = &recv_metadata; - break; - case GRPC_OP_RECV_MESSAGE: - ops[op_num].data.recv_message = &message; - break; - case GRPC_OP_RECV_STATUS_ON_CLIENT: - ops[op_num].data.recv_status_on_client.trailing_metadata = - &recv_trailing_metadata; - ops[op_num].data.recv_status_on_client.status = &status; - ops[op_num].data.recv_status_on_client.status_details = - &status_details; - ops[op_num].data.recv_status_on_client.status_details_capacity = - &status_details_capacity; - break; - case GRPC_OP_RECV_CLOSE_ON_SERVER: - ops[op_num].data.recv_close_on_server.cancelled = &cancelled; - break; - default: - zend_throw_exception(spl_ce_InvalidArgumentException, - "Unrecognized key in batch", 1); - goto cleanup; - } - ops[op_num].op = (grpc_op_type)index; - ops[op_num].flags = 0; - ops[op_num].reserved = NULL; - op_num++; - } ZEND_HASH_FOREACH_END(); - -#endif + PHP_GRPC_HASH_FOREACH_END() error = grpc_call_start_batch(call->wrapped, ops, op_num, call->wrapped, NULL); @@ -642,7 +435,9 @@ PHP_METHOD(Call, startBatch) { } grpc_completion_queue_pluck(completion_queue, call->wrapped, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); -#if PHP_MAJOR_VERSION < 7 +#if PHP_MAJOR_VERSION >= 7 + zval recv_md; +#endif for (int i = 0; i < op_num; i++) { switch(ops[i].op) { case GRPC_OP_SEND_INITIAL_METADATA: @@ -658,73 +453,37 @@ PHP_METHOD(Call, startBatch) { add_property_bool(result, "send_status", true); break; case GRPC_OP_RECV_INITIAL_METADATA: +#if PHP_MAJOR_VERSION < 7 array = grpc_parse_metadata_array(&recv_metadata TSRMLS_CC); add_property_zval(result, "metadata", array); - Z_DELREF_P(array); - break; - case GRPC_OP_RECV_MESSAGE: - byte_buffer_to_string(message, &message_str, &message_len); - if (message_str == NULL) { - add_property_null(result, "message"); - } else { - add_property_stringl(result, "message", message_str, message_len, - false); - } - break; - case GRPC_OP_RECV_STATUS_ON_CLIENT: - MAKE_STD_ZVAL(recv_status); - object_init(recv_status); - array = grpc_parse_metadata_array(&recv_trailing_metadata TSRMLS_CC); - add_property_zval(recv_status, "metadata", array); - Z_DELREF_P(array); - add_property_long(recv_status, "code", status); - add_property_string(recv_status, "details", status_details, true); - add_property_zval(result, "status", recv_status); - Z_DELREF_P(recv_status); - break; - case GRPC_OP_RECV_CLOSE_ON_SERVER: - add_property_bool(result, "cancelled", cancelled); - break; - default: - break; - } - } #else - zval recv_md; - for (int i = 0; i < op_num; i++) { - switch(ops[i].op) { - case GRPC_OP_SEND_INITIAL_METADATA: - add_property_bool(result, "send_metadata", true); - break; - case GRPC_OP_SEND_MESSAGE: - add_property_bool(result, "send_message", true); - break; - case GRPC_OP_SEND_CLOSE_FROM_CLIENT: - add_property_bool(result, "send_close", true); - break; - case GRPC_OP_SEND_STATUS_FROM_SERVER: - add_property_bool(result, "send_status", true); - break; - case GRPC_OP_RECV_INITIAL_METADATA: recv_md = *grpc_parse_metadata_array(&recv_metadata); add_property_zval(result, "metadata", &recv_md); +#endif + PHP_GRPC_DELREF(array); break; case GRPC_OP_RECV_MESSAGE: byte_buffer_to_string(message, &message_str, &message_len); if (message_str == NULL) { add_property_null(result, "message"); } else { - add_property_stringl(result, "message", message_str, - message_len); + php_grpc_add_property_stringl(result, "message", message_str, + message_len, false); } break; case GRPC_OP_RECV_STATUS_ON_CLIENT: - object_init(&recv_status); +#if PHP_MAJOR_VERSION < 7 + array = grpc_parse_metadata_array(&recv_trailing_metadata TSRMLS_CC); + add_property_zval(recv_status, "metadata", array); +#else recv_md = *grpc_parse_metadata_array(&recv_trailing_metadata); - add_property_zval(&recv_status, "metadata", &recv_md); - add_property_long(&recv_status, "code", status); - add_property_string(&recv_status, "details", status_details); - add_property_zval(result, "status", &recv_status); + add_property_zval(recv_status, "metadata", &recv_md); +#endif + PHP_GRPC_DELREF(array); + add_property_long(recv_status, "code", status); + php_grpc_add_property_string(recv_status, "details", status_details, true); + add_property_zval(result, "status", recv_status); + PHP_GRPC_DELREF(recv_status); break; case GRPC_OP_RECV_CLOSE_ON_SERVER: add_property_bool(result, "cancelled", cancelled); @@ -733,7 +492,6 @@ PHP_METHOD(Call, startBatch) { break; } } -#endif cleanup: grpc_metadata_array_destroy(&metadata); diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index 0c55745524..b7d33d7239 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -67,16 +67,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * associated with an object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_call_credentials( zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_call_credentials *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_call_credentials *)emalloc( - sizeof(wrapped_grpc_call_credentials)); - memset(intern, 0, sizeof(wrapped_grpc_call_credentials)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_call_credentials) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 69264842f0..325e8f495e 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -71,15 +71,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_channel(zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_channel *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_channel *)emalloc(sizeof(wrapped_grpc_channel)); - memset(intern, 0, sizeof(wrapped_grpc_channel)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_channel) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_channel); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 @@ -98,16 +90,6 @@ void php_grpc_read_args_array(zval *args_array, grpc_channel_args *args TSRMLS_DC) { HashTable *array_hash; int args_index; -#if PHP_MAJOR_VERSION < 7 - HashPosition array_pointer; - zval **data; - char *key; - uint key_len; - ulong index; -#else - zval *data; - zend_string *key; -#endif array_hash = Z_ARRVAL_P(args_array); if (!array_hash) { zend_throw_exception(spl_ce_InvalidArgumentException, @@ -118,41 +100,17 @@ void php_grpc_read_args_array(zval *args_array, args->args = ecalloc(args->num_args, sizeof(grpc_arg)); args_index = 0; -#if PHP_MAJOR_VERSION < 7 - for (zend_hash_internal_pointer_reset_ex(array_hash, &array_pointer); - zend_hash_get_current_data_ex(array_hash, (void **)&data, - &array_pointer) == SUCCESS; - zend_hash_move_forward_ex(array_hash, &array_pointer)) { - if (zend_hash_get_current_key_ex(array_hash, &key, &key_len, &index, 0, - &array_pointer) != HASH_KEY_IS_STRING) { + char *key = NULL; + zval *data; + int key_type; + + PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(array_hash, key, key_type, data) + if (key_type != HASH_KEY_IS_STRING) { zend_throw_exception(spl_ce_InvalidArgumentException, "args keys must be strings", 1 TSRMLS_CC); return; } args->args[args_index].key = key; - switch (Z_TYPE_P(*data)) { - case IS_LONG: - args->args[args_index].value.integer = (int)Z_LVAL_P(*data); - args->args[args_index].type = GRPC_ARG_INTEGER; - break; - case IS_STRING: - args->args[args_index].value.string = Z_STRVAL_P(*data); - args->args[args_index].type = GRPC_ARG_STRING; - break; - default: - zend_throw_exception(spl_ce_InvalidArgumentException, - "args values must be int or string", 1 TSRMLS_CC); - return; - } - args_index++; - } -#else - ZEND_HASH_FOREACH_STR_KEY_VAL(array_hash, key, data) { - if (key == NULL) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "args keys must be strings", 1); - } - args->args[args_index].key = ZSTR_VAL(key); switch (Z_TYPE_P(data)) { case IS_LONG: args->args[args_index].value.integer = (int)Z_LVAL_P(data); @@ -164,12 +122,11 @@ void php_grpc_read_args_array(zval *args_array, break; default: zend_throw_exception(spl_ce_InvalidArgumentException, - "args values must be int or string", 1); + "args values must be int or string", 1 TSRMLS_CC); return; } args_index++; - } ZEND_HASH_FOREACH_END(); -#endif + PHP_GRPC_HASH_FOREACH_END() } /** @@ -181,11 +138,7 @@ void php_grpc_read_args_array(zval *args_array, */ PHP_METHOD(Channel, __construct) { wrapped_grpc_channel *channel = Z_WRAPPED_GRPC_CHANNEL_P(getThis()); -#if PHP_MAJOR_VERSION < 7 - zval **creds_obj = NULL; -#else zval *creds_obj = NULL; -#endif char *target; php_grpc_int target_length; zval *args_array = NULL; @@ -200,43 +153,23 @@ PHP_METHOD(Channel, __construct) { "Channel expects a string and an array", 1 TSRMLS_CC); return; } -#if PHP_MAJOR_VERSION < 7 array_hash = Z_ARRVAL_P(args_array); - if (zend_hash_find(array_hash, "credentials", sizeof("credentials"), + if (php_grpc_zend_hash_find(array_hash, "credentials", sizeof("credentials"), (void **)&creds_obj) == SUCCESS) { - if (Z_TYPE_P(*creds_obj) == IS_NULL) { - creds = NULL; - zend_hash_del(array_hash, "credentials", 12); - } else if (zend_get_class_entry(*creds_obj TSRMLS_CC) != - grpc_ce_channel_credentials) { - zend_throw_exception(spl_ce_InvalidArgumentException, - "credentials must be a ChannelCredentials object", - 1 TSRMLS_CC); - return; - } else { - creds = (wrapped_grpc_channel_credentials *)zend_object_store_get_object( - *creds_obj TSRMLS_CC); - zend_hash_del(array_hash, "credentials", 12); - } - } -#else - array_hash = HASH_OF(args_array); - if ((creds_obj = zend_hash_str_find(array_hash, "credentials", - sizeof("credentials") - 1)) != NULL) { if (Z_TYPE_P(creds_obj) == IS_NULL) { creds = NULL; - zend_hash_str_del(array_hash, "credentials", sizeof("credentials") - 1); - } else if (Z_OBJ_P(creds_obj)->ce != grpc_ce_channel_credentials) { + php_grpc_zend_hash_del(array_hash, "credentials", sizeof("credentials")); + } else if (PHP_GRPC_GET_CLASS_ENTRY(creds_obj) != + grpc_ce_channel_credentials) { zend_throw_exception(spl_ce_InvalidArgumentException, "credentials must be a ChannelCredentials object", - 1); + 1 TSRMLS_CC); return; } else { creds = Z_WRAPPED_GRPC_CHANNEL_CREDS_P(creds_obj); - zend_hash_str_del(array_hash, "credentials", sizeof("credentials") - 1); + php_grpc_zend_hash_del(array_hash, "credentials", sizeof("credentials")); } } -#endif php_grpc_read_args_array(args_array, &args TSRMLS_CC); if (creds == NULL) { channel->wrapped = grpc_insecure_channel_create(target, &args, NULL); @@ -292,8 +225,7 @@ PHP_METHOD(Channel, watchConnectivityState) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lO", &last_state, &deadline_obj, grpc_ce_timeval) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "watchConnectivityState expects 1 long 1 timeval", - 1 TSRMLS_CC); + "watchConnectivityState expects 1 long 1 timeval", 1 TSRMLS_CC); return; } diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index cef435cc6e..32f24e5751 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -77,16 +77,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * associated with an object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_channel_credentials( zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_channel_credentials *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_channel_credentials *)emalloc( - sizeof(wrapped_grpc_channel_credentials)); - memset(intern, 0, sizeof(wrapped_grpc_channel_credentials)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_channel_credentials) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_channel_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 7d7470f8a9..ba7f163676 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -50,6 +50,7 @@ #define PHP_GRPC_RETURN_STRING(val, dup) RETURN_STRING(val, dup) #define PHP_GRPC_MAKE_STD_ZVAL(pzv) MAKE_STD_ZVAL(pzv) +#define PHP_GRPC_DELREF(zv) Z_DELREF_P(zv) #define PHP_GRPC_WRAP_OBJECT_START(name) \ typedef struct name { \ @@ -65,6 +66,58 @@ efree(p); \ } +#define PHP_GRPC_ALLOC_CLASS_OBJECT(class_object) \ + class_object *intern; \ + zend_object_value retval; \ + intern = (class_object *)emalloc(sizeof(class_object)); \ + memset(intern, 0, sizeof(class_object)); + +#define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data) \ + zval **tmp_data = NULL; \ + for (zend_hash_internal_pointer_reset(ht); \ + zend_hash_get_current_data(ht, (void**)&tmp_data) == SUCCESS; \ + zend_hash_move_forward(ht)) { \ + data = *tmp_data; + +#define PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(ht, key, key_type, data) \ + zval **tmp##key = NULL; \ + ulong index##key; \ + uint len##key; \ + for (zend_hash_internal_pointer_reset(ht); \ + zend_hash_get_current_data(ht, (void**)&tmp##key) == SUCCESS; \ + zend_hash_move_forward(ht)) { \ + key_type = zend_hash_get_current_key_ex(ht, &key, &len##key, &index##key,\ + 0, NULL); \ + data = *tmp##key; + +#define PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(ht, key, key_type, index,\ + data) \ + zval **tmp##key = NULL; \ + uint len##key; \ + for (zend_hash_internal_pointer_reset(ht); \ + zend_hash_get_current_data(ht, (void**)&tmp##key) == SUCCESS; \ + zend_hash_move_forward(ht)) { \ + key_type = zend_hash_get_current_key_ex(ht, &key, &len##key, &index,\ + 0, NULL); \ + data = *tmp##key; + +#define PHP_GRPC_HASH_FOREACH_END() } + +static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, void **value) { + zval **data = NULL; + if (zend_hash_find(ht, key, len, (void **)&data) == SUCCESS) { + *value = *data; + return SUCCESS; + } else { + *value = NULL; + return FAILURE; + } +} + +#define php_grpc_zend_hash_del zend_hash_del + +#define PHP_GRPC_GET_CLASS_ENTRY(object) zend_get_class_entry(object TSRMLS_CC) + #else #define php_grpc_int size_t @@ -82,6 +135,7 @@ #define PHP_GRPC_MAKE_STD_ZVAL(pzv) \ zval _stack_zval_##pzv; \ pzv = &(_stack_zval_##pzv) +#define PHP_GRPC_DELREF(zv) #define PHP_GRPC_WRAP_OBJECT_START(name) \ typedef struct name { @@ -99,6 +153,45 @@ zend_object_std_dtor(&p->std); \ } +#define PHP_GRPC_ALLOC_CLASS_OBJECT(class_object) \ + class_object *intern; \ + intern = ecalloc(1, sizeof(class_object) + \ + zend_object_properties_size(class_type)); + +#define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data) \ + ZEND_HASH_FOREACH_VAL(ht, data) { + +#define PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(ht, key, key_type, data) \ + zend_string *(zs_##key); \ + ZEND_HASH_FOREACH_STR_KEY_VAL(ht, (zs_##key), data) { \ + if ((zs_##key) == NULL) {key = NULL; key_type = HASH_KEY_IS_LONG;} \ + else {key = (zs_##key)->val; key_type = HASH_KEY_IS_STRING;} + +#define PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(ht, key, key_type, index, \ + data) \ + zend_string *(zs_##key); \ + ZEND_HASH_FOREACH_KEY_VAL(ht, index, zs_##key, data) { \ + if ((zs_##key) == NULL) {key = NULL; key_type = HASH_KEY_IS_LONG;} \ + else {key = (zs_##key)->val; key_type = HASH_KEY_IS_STRING;} + +#define PHP_GRPC_HASH_FOREACH_END() } ZEND_HASH_FOREACH_END(); + +static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, void **value) { + zval *value_tmp = zend_hash_str_find(ht, key, len -1); + if (value_tmp == NULL) { + return FAILURE; + } else { + *value = (void *)value_tmp; + return SUCCESS; + } +} + +static inline int php_grpc_zend_hash_del(HashTable *ht, char *key, int len) { + return zend_hash_str_del(ht, key, len - 1); +} + +#define PHP_GRPC_GET_CLASS_ENTRY(object) Z_OBJ_P(object)->ce + #endif /* PHP_MAJOR_VERSION */ #endif /* PHP7_WRAPPER_GRPC_H */ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index d8ebd4472d..2fc785eb31 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -76,15 +76,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_server(zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_server *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_server *)emalloc(sizeof(wrapped_grpc_server)); - memset(intern, 0, sizeof(wrapped_grpc_server)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_server) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 921436a1bb..4c147e0991 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -65,16 +65,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * with an object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_server_credentials( zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_server_credentials *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_server_credentials *)emalloc( - sizeof(wrapped_grpc_server_credentials)); - memset(intern, 0, sizeof(wrapped_grpc_server_credentials)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_server_credentials) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 33d11f83cc..d0f75bef82 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -63,15 +63,7 @@ PHP_GRPC_FREE_WRAPPED_FUNC_END() * object of a class specified by class_type */ php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type TSRMLS_DC) { - wrapped_grpc_timeval *intern; -#if PHP_MAJOR_VERSION < 7 - zend_object_value retval; - intern = (wrapped_grpc_timeval *)emalloc(sizeof(wrapped_grpc_timeval)); - memset(intern, 0, sizeof(wrapped_grpc_timeval)); -#else - intern = ecalloc(1, sizeof(wrapped_grpc_timeval) + - zend_object_properties_size(class_type)); -#endif + PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_timeval); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); #if PHP_MAJOR_VERSION < 7 -- cgit v1.2.3 From 11cb5c53cb15fc91ea51798cf6b8a0f10462ecd1 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 07:29:17 +0800 Subject: fix unused var --- src/php/ext/grpc/call.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 46591d8738..10fc3feb63 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -150,11 +150,11 @@ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { grpc_metadata_array_init(metadata); array_hash = Z_ARRVAL_P(array); - char *key = NULL; + char *key; int key_type; PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(array_hash, key, key_type, inner_array) - if (key_type != HASH_KEY_IS_STRING) { + if (key_type != HASH_KEY_IS_STRING || key == NULL) { return false; } if (Z_TYPE_P(inner_array) != IS_ARRAY) { @@ -291,7 +291,8 @@ PHP_METHOD(Call, startBatch) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "start_batch expects an array", 1 TSRMLS_CC); goto cleanup; + "start_batch expects an array", 1 TSRMLS_CC); + goto cleanup; } array_hash = Z_ARRVAL_P(array); @@ -300,7 +301,7 @@ PHP_METHOD(Call, startBatch) { int key_type; PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(array_hash, key, key_type, index, value) - if (key_type != HASH_KEY_IS_LONG) { + if (key_type != HASH_KEY_IS_LONG || key != NULL) { zend_throw_exception(spl_ce_InvalidArgumentException, "batch keys must be integers", 1 TSRMLS_CC); goto cleanup; -- cgit v1.2.3 From dacb2e3a5c5b07b66aa2d999b2d2df682e4a9b1d Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 08:25:41 +0800 Subject: fix unused var --- src/php/ext/grpc/call.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 46591d8738..10fc3feb63 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -150,11 +150,11 @@ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) { grpc_metadata_array_init(metadata); array_hash = Z_ARRVAL_P(array); - char *key = NULL; + char *key; int key_type; PHP_GRPC_HASH_FOREACH_STR_KEY_VAL_START(array_hash, key, key_type, inner_array) - if (key_type != HASH_KEY_IS_STRING) { + if (key_type != HASH_KEY_IS_STRING || key == NULL) { return false; } if (Z_TYPE_P(inner_array) != IS_ARRAY) { @@ -291,7 +291,8 @@ PHP_METHOD(Call, startBatch) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, - "start_batch expects an array", 1 TSRMLS_CC); goto cleanup; + "start_batch expects an array", 1 TSRMLS_CC); + goto cleanup; } array_hash = Z_ARRVAL_P(array); @@ -300,7 +301,7 @@ PHP_METHOD(Call, startBatch) { int key_type; PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(array_hash, key, key_type, index, value) - if (key_type != HASH_KEY_IS_LONG) { + if (key_type != HASH_KEY_IS_LONG || key != NULL) { zend_throw_exception(spl_ce_InvalidArgumentException, "batch keys must be integers", 1 TSRMLS_CC); goto cleanup; -- cgit v1.2.3 From dc673c5322efffecb6ded692c6f04ce911fe5551 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 09:49:38 +0800 Subject: add PHP_GRPC_FREE_CLASS_OBJECT macro --- src/php/ext/grpc/call.c | 11 +---------- src/php/ext/grpc/call_credentials.c | 12 ++---------- src/php/ext/grpc/channel.c | 11 +---------- src/php/ext/grpc/channel_credentials.c | 12 ++---------- src/php/ext/grpc/php7_wrapper.h | 11 +++++++++++ src/php/ext/grpc/server.c | 11 +---------- src/php/ext/grpc/server_credentials.c | 12 ++---------- src/php/ext/grpc/timeval.c | 5 +++-- 8 files changed, 23 insertions(+), 62 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 10fc3feb63..840ac71364 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -76,16 +76,7 @@ php_grpc_zend_object create_wrapped_grpc_call(zend_class_entry *class_type PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_call, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &call_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_call, call_ce_handlers); } /* Creates and returns a PHP array object with the data in a diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index b7d33d7239..34a88af47f 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -70,16 +70,8 @@ php_grpc_zend_object create_wrapped_grpc_call_credentials( PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_call_credentials, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &call_credentials_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_call_credentials, + call_credentials_ce_handlers); } zval *grpc_php_wrap_call_credentials(grpc_call_credentials diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 325e8f495e..1d3f68af7c 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -74,16 +74,7 @@ php_grpc_zend_object create_wrapped_grpc_channel(zend_class_entry *class_type PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_channel); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_channel, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &channel_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_channel, channel_ce_handlers); } void php_grpc_read_args_array(zval *args_array, diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 32f24e5751..7ef95cc5e2 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -80,16 +80,8 @@ php_grpc_zend_object create_wrapped_grpc_channel_credentials( PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_channel_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_channel_credentials, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &channel_credentials_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_channel_credentials, + channel_credentials_ce_handlers); } zval *grpc_php_wrap_channel_credentials(grpc_channel_credentials diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index ba7f163676..44d6cd8dd7 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -72,6 +72,13 @@ intern = (class_object *)emalloc(sizeof(class_object)); \ memset(intern, 0, sizeof(class_object)); +#define PHP_GRPC_FREE_CLASS_OBJECT(class_object, handler) \ + retval.handle = zend_objects_store_put( \ + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, \ + free_##class_object, NULL TSRMLS_CC); \ + retval.handlers = zend_get_std_object_handlers(); \ + return retval; + #define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data) \ zval **tmp_data = NULL; \ for (zend_hash_internal_pointer_reset(ht); \ @@ -158,6 +165,10 @@ static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, voi intern = ecalloc(1, sizeof(class_object) + \ zend_object_properties_size(class_type)); +#define PHP_GRPC_FREE_CLASS_OBJECT(class_object, handler) \ + intern->std.handlers = &handler; \ + return &intern->std; + #define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data) \ ZEND_HASH_FOREACH_VAL(ht, data) { diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index 2fc785eb31..452ccca3e1 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -79,16 +79,7 @@ php_grpc_zend_object create_wrapped_grpc_server(zend_class_entry *class_type PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_server, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &server_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_server, server_ce_handlers); } /** diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 4c147e0991..61041b4cb3 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -68,16 +68,8 @@ php_grpc_zend_object create_wrapped_grpc_server_credentials( PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_server_credentials, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &server_credentials_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_server_credentials, + server_credentials_ce_handlers); } zval *grpc_php_wrap_server_credentials(grpc_server_credentials diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index d0f75bef82..0d739f1608 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -66,7 +66,8 @@ php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_timeval); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_timeval, timeval_ce_handlers); +/*#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_timeval, NULL TSRMLS_CC); @@ -75,7 +76,7 @@ php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type #else intern->std.handlers = &timeval_ce_handlers; return &intern->std; -#endif +#endif*/ } zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) { -- cgit v1.2.3 From a24a0dd784570d88282a61c6fdd1a4870b8554d8 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 09:51:08 +0800 Subject: add PHP_GRPC_FREE_CLASS_OBJECT macro --- src/php/ext/grpc/call.c | 11 +---------- src/php/ext/grpc/call_credentials.c | 12 ++---------- src/php/ext/grpc/channel.c | 11 +---------- src/php/ext/grpc/channel_credentials.c | 12 ++---------- src/php/ext/grpc/php7_wrapper.h | 11 +++++++++++ src/php/ext/grpc/server.c | 11 +---------- src/php/ext/grpc/server_credentials.c | 12 ++---------- src/php/ext/grpc/timeval.c | 5 +++-- 8 files changed, 23 insertions(+), 62 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 10fc3feb63..840ac71364 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -76,16 +76,7 @@ php_grpc_zend_object create_wrapped_grpc_call(zend_class_entry *class_type PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_call, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &call_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_call, call_ce_handlers); } /* Creates and returns a PHP array object with the data in a diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index b7d33d7239..34a88af47f 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -70,16 +70,8 @@ php_grpc_zend_object create_wrapped_grpc_call_credentials( PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_call_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_call_credentials, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &call_credentials_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_call_credentials, + call_credentials_ce_handlers); } zval *grpc_php_wrap_call_credentials(grpc_call_credentials diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 325e8f495e..1d3f68af7c 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -74,16 +74,7 @@ php_grpc_zend_object create_wrapped_grpc_channel(zend_class_entry *class_type PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_channel); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_channel, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &channel_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_channel, channel_ce_handlers); } void php_grpc_read_args_array(zval *args_array, diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 32f24e5751..7ef95cc5e2 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -80,16 +80,8 @@ php_grpc_zend_object create_wrapped_grpc_channel_credentials( PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_channel_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_channel_credentials, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &channel_credentials_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_channel_credentials, + channel_credentials_ce_handlers); } zval *grpc_php_wrap_channel_credentials(grpc_channel_credentials diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index ba7f163676..44d6cd8dd7 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -72,6 +72,13 @@ intern = (class_object *)emalloc(sizeof(class_object)); \ memset(intern, 0, sizeof(class_object)); +#define PHP_GRPC_FREE_CLASS_OBJECT(class_object, handler) \ + retval.handle = zend_objects_store_put( \ + intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, \ + free_##class_object, NULL TSRMLS_CC); \ + retval.handlers = zend_get_std_object_handlers(); \ + return retval; + #define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data) \ zval **tmp_data = NULL; \ for (zend_hash_internal_pointer_reset(ht); \ @@ -158,6 +165,10 @@ static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, voi intern = ecalloc(1, sizeof(class_object) + \ zend_object_properties_size(class_type)); +#define PHP_GRPC_FREE_CLASS_OBJECT(class_object, handler) \ + intern->std.handlers = &handler; \ + return &intern->std; + #define PHP_GRPC_HASH_FOREACH_VAL_START(ht, data) \ ZEND_HASH_FOREACH_VAL(ht, data) { diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index 2fc785eb31..452ccca3e1 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -79,16 +79,7 @@ php_grpc_zend_object create_wrapped_grpc_server(zend_class_entry *class_type PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_server, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &server_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_server, server_ce_handlers); } /** diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 4c147e0991..61041b4cb3 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -68,16 +68,8 @@ php_grpc_zend_object create_wrapped_grpc_server_credentials( PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_server_credentials); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_server_credentials, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &server_credentials_ce_handlers; - return &intern->std; -#endif + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_server_credentials, + server_credentials_ce_handlers); } zval *grpc_php_wrap_server_credentials(grpc_server_credentials diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index d0f75bef82..0d739f1608 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -66,7 +66,8 @@ php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type PHP_GRPC_ALLOC_CLASS_OBJECT(wrapped_grpc_timeval); zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); -#if PHP_MAJOR_VERSION < 7 + PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_timeval, timeval_ce_handlers); +/*#if PHP_MAJOR_VERSION < 7 retval.handle = zend_objects_store_put( intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, free_wrapped_grpc_timeval, NULL TSRMLS_CC); @@ -75,7 +76,7 @@ php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type #else intern->std.handlers = &timeval_ce_handlers; return &intern->std; -#endif +#endif*/ } zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) { -- cgit v1.2.3 From 514d296a5d463252dccf6d75a2c1cfed385eb07a Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 10:16:45 +0800 Subject: delete commented-code for missing --- src/php/ext/grpc/timeval.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 0d739f1608..28d360f09f 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -67,16 +67,6 @@ php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_timeval, timeval_ce_handlers); -/*#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_timeval, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &timeval_ce_handlers; - return &intern->std; -#endif*/ } zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) { -- cgit v1.2.3 From 3e03e1651ec8c8b4ab23b986f0ad17ded48f9a32 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 10:18:27 +0800 Subject: delete commented-code for missing --- src/php/ext/grpc/timeval.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 0d739f1608..28d360f09f 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -67,16 +67,6 @@ php_grpc_zend_object create_wrapped_grpc_timeval(zend_class_entry *class_type zend_object_std_init(&intern->std, class_type TSRMLS_CC); object_properties_init(&intern->std, class_type); PHP_GRPC_FREE_CLASS_OBJECT(wrapped_grpc_timeval, timeval_ce_handlers); -/*#if PHP_MAJOR_VERSION < 7 - retval.handle = zend_objects_store_put( - intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, - free_wrapped_grpc_timeval, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - return retval; -#else - intern->std.handlers = &timeval_ce_handlers; - return &intern->std; -#endif*/ } zval *grpc_php_wrap_timeval(gpr_timespec wrapped TSRMLS_DC) { -- cgit v1.2.3 From 5dafd82b7ef99952889e0e862aac38b80595b15e Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 22:43:38 +0800 Subject: add macro PHP_GRPC_INIT_HANDLER --- src/php/ext/grpc/call.c | 20 ++++++-------------- src/php/ext/grpc/call_credentials.c | 11 ++--------- src/php/ext/grpc/call_credentials.h | 6 ++---- src/php/ext/grpc/channel.c | 8 +------- src/php/ext/grpc/channel_credentials.c | 11 ++--------- src/php/ext/grpc/channel_credentials.h | 5 ++--- src/php/ext/grpc/php7_wrapper.h | 11 ++++++++++- src/php/ext/grpc/server.c | 9 ++------- src/php/ext/grpc/server.h | 3 +-- src/php/ext/grpc/server_credentials.c | 13 +++---------- src/php/ext/grpc/server_credentials.h | 4 ++-- src/php/ext/grpc/timeval.c | 8 +------- 12 files changed, 34 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 840ac71364..429dbf52d0 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -105,8 +105,8 @@ zval *grpc_parse_metadata_array(grpc_metadata_array memcpy(str_key, elem->key, key_len); str_val = ecalloc(elem->value_length + 1, sizeof(char)); memcpy(str_val, elem->value, elem->value_length); - if (php_grpc_zend_hash_find(array_hash, str_key, key_len, (void **)&data) == - SUCCESS) { + if (php_grpc_zend_hash_find(array_hash, str_key, key_len, (void **)&data) + == SUCCESS) { if (Z_TYPE_P(data) != IS_ARRAY) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Metadata hash somehow contains wrong types.", @@ -271,7 +271,6 @@ PHP_METHOD(Call, startBatch) { char *message_str; size_t message_len; - grpc_metadata_array_init(&metadata); grpc_metadata_array_init(&trailing_metadata); grpc_metadata_array_init(&recv_metadata); @@ -291,7 +290,7 @@ PHP_METHOD(Call, startBatch) { char *key = NULL; int key_type; PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(array_hash, key, key_type, index, - value) + value) if (key_type != HASH_KEY_IS_LONG || key != NULL) { zend_throw_exception(spl_ce_InvalidArgumentException, "batch keys must be integers", 1 TSRMLS_CC); @@ -304,10 +303,8 @@ PHP_METHOD(Call, startBatch) { "Bad metadata value given", 1 TSRMLS_CC); goto cleanup; } - ops[op_num].data.send_initial_metadata.count = - metadata.count; - ops[op_num].data.send_initial_metadata.metadata = - metadata.metadata; + ops[op_num].data.send_initial_metadata.count = metadata.count; + ops[op_num].data.send_initial_metadata.metadata = metadata.metadata; break; case GRPC_OP_SEND_MESSAGE: if (Z_TYPE_P(value) != IS_ARRAY) { @@ -562,10 +559,5 @@ void grpc_init_call(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\Call", call_methods); ce.create_object = create_wrapped_grpc_call; grpc_ce_call = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&call_ce_handlers, zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - call_ce_handlers.offset = XtOffsetOf(wrapped_grpc_call, std); - call_ce_handlers.free_obj = free_wrapped_grpc_call; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_call, call_ce_handlers); } diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index 34a88af47f..6921a5df17 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -235,13 +235,6 @@ void grpc_init_call_credentials(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\CallCredentials", call_credentials_methods); ce.create_object = create_wrapped_grpc_call_credentials; grpc_ce_call_credentials = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&call_credentials_ce_handlers, - zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - call_credentials_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_call_credentials, std); - call_credentials_ce_handlers.free_obj = - free_wrapped_grpc_call_credentials; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_call_credentials, + call_credentials_ce_handlers); } diff --git a/src/php/ext/grpc/call_credentials.h b/src/php/ext/grpc/call_credentials.h index 8014b75c70..c1d85c0fb2 100755 --- a/src/php/ext/grpc/call_credentials.h +++ b/src/php/ext/grpc/call_credentials.h @@ -64,10 +64,8 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_call_credentials) static inline wrapped_grpc_call_credentials *wrapped_grpc_call_credentials_from_obj(zend_object *obj) { - return - (wrapped_grpc_call_credentials*)((char*)(obj) - - XtOffsetOf(wrapped_grpc_call_credentials, - std)); + return (wrapped_grpc_call_credentials*)( + (char*)(obj) - XtOffsetOf(wrapped_grpc_call_credentials, std)); } #define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \ diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 1d3f68af7c..e96ead582f 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -256,11 +256,5 @@ void grpc_init_channel(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\Channel", channel_methods); ce.create_object = create_wrapped_grpc_channel; grpc_ce_channel = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&channel_ce_handlers, zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - channel_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_channel, std); - channel_ce_handlers.free_obj = free_wrapped_grpc_channel; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_channel, channel_ce_handlers); } diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 7ef95cc5e2..0b356aa25f 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -226,13 +226,6 @@ void grpc_init_channel_credentials(TSRMLS_D) { grpc_set_ssl_roots_override_callback(get_ssl_roots_override); ce.create_object = create_wrapped_grpc_channel_credentials; grpc_ce_channel_credentials = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&channel_credentials_ce_handlers, - zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - channel_credentials_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_channel_credentials, std); - channel_credentials_ce_handlers.free_obj = - free_wrapped_grpc_channel_credentials; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_channel_credentials, + channel_credentials_ce_handlers); } diff --git a/src/php/ext/grpc/channel_credentials.h b/src/php/ext/grpc/channel_credentials.h index 39dc85283d..b043d91fa6 100755 --- a/src/php/ext/grpc/channel_credentials.h +++ b/src/php/ext/grpc/channel_credentials.h @@ -64,9 +64,8 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_channel_credentials) static inline wrapped_grpc_channel_credentials *wrapped_grpc_channel_credentials_from_obj(zend_object *obj) { - return - (wrapped_grpc_channel_credentials *) - ((char*)(obj) - XtOffsetOf(wrapped_grpc_channel_credentials, std)); + return (wrapped_grpc_channel_credentials *)( + (char*)(obj) - XtOffsetOf(wrapped_grpc_channel_credentials, std)); } #define Z_WRAPPED_GRPC_CHANNEL_CREDS_P(zv) \ diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 44d6cd8dd7..f2976c26cd 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -125,6 +125,8 @@ static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, voi #define PHP_GRPC_GET_CLASS_ENTRY(object) zend_get_class_entry(object TSRMLS_CC) +#define PHP_GRPC_INIT_HANDLER(class_object, handler_name) + #else #define php_grpc_int size_t @@ -187,7 +189,8 @@ static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, voi #define PHP_GRPC_HASH_FOREACH_END() } ZEND_HASH_FOREACH_END(); -static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, void **value) { +static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, + void **value) { zval *value_tmp = zend_hash_str_find(ht, key, len -1); if (value_tmp == NULL) { return FAILURE; @@ -203,6 +206,12 @@ static inline int php_grpc_zend_hash_del(HashTable *ht, char *key, int len) { #define PHP_GRPC_GET_CLASS_ENTRY(object) Z_OBJ_P(object)->ce +#define PHP_GRPC_INIT_HANDLER(class_object, handler_name) \ + memcpy(&handler_name, zend_get_std_object_handlers(), \ + sizeof(zend_object_handlers)); \ + handler_name.offset = XtOffsetOf(class_object, std); \ + handler_name.free_obj = free_##class_object + #endif /* PHP_MAJOR_VERSION */ #endif /* PHP7_WRAPPER_GRPC_H */ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index 452ccca3e1..fc20c42b16 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -233,7 +233,7 @@ static zend_function_entry server_methods[] = { PHP_ME(Server, addHttp2Port, NULL, ZEND_ACC_PUBLIC) PHP_ME(Server, addSecureHttp2Port, NULL, ZEND_ACC_PUBLIC) PHP_ME(Server, start, NULL, ZEND_ACC_PUBLIC) - PHP_FE_END + PHP_FE_END }; void grpc_init_server(TSRMLS_D) { @@ -241,10 +241,5 @@ void grpc_init_server(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\Server", server_methods); ce.create_object = create_wrapped_grpc_server; grpc_ce_server = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&server_ce_handlers, zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - server_ce_handlers.offset = XtOffsetOf(wrapped_grpc_server, std); - server_ce_handlers.free_obj = free_wrapped_grpc_server; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_server, server_ce_handlers); } diff --git a/src/php/ext/grpc/server.h b/src/php/ext/grpc/server.h index 02ef1f7975..a635bc11df 100755 --- a/src/php/ext/grpc/server.h +++ b/src/php/ext/grpc/server.h @@ -66,8 +66,7 @@ static inline wrapped_grpc_server XtOffsetOf(wrapped_grpc_server, std)); } -#define Z_WRAPPED_GRPC_SERVER_P(zv) \ - wrapped_grpc_server_from_obj(Z_OBJ_P((zv))) +#define Z_WRAPPED_GRPC_SERVER_P(zv) wrapped_grpc_server_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 61041b4cb3..b05896af4a 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -122,7 +122,7 @@ PHP_METHOD(ServerCredentials, createSsl) { static zend_function_entry server_credentials_methods[] = { PHP_ME(ServerCredentials, createSsl, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_FE_END + PHP_FE_END }; void grpc_init_server_credentials(TSRMLS_D) { @@ -130,13 +130,6 @@ void grpc_init_server_credentials(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\ServerCredentials", server_credentials_methods); ce.create_object = create_wrapped_grpc_server_credentials; grpc_ce_server_credentials = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&server_credentials_ce_handlers, - zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - server_credentials_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_server_credentials, std); - server_credentials_ce_handlers.free_obj = - free_wrapped_grpc_server_credentials; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_server_credentials, + server_credentials_ce_handlers); } diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h index 9551ec6c24..6781a614b1 100755 --- a/src/php/ext/grpc/server_credentials.h +++ b/src/php/ext/grpc/server_credentials.h @@ -64,8 +64,8 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_server_credentials) static inline wrapped_grpc_server_credentials *wrapped_grpc_server_credentials_from_obj(zend_object *obj) { - return (wrapped_grpc_server_credentials*) - ((char*)(obj) - XtOffsetOf(wrapped_grpc_server_credentials, std)); + return (wrapped_grpc_server_credentials*)( + (char*)(obj) - XtOffsetOf(wrapped_grpc_server_credentials, std)); } #define Z_WRAPPED_GRPC_SERVER_CREDS_P(zv) \ diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 28d360f09f..e145d96772 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -278,13 +278,7 @@ void grpc_init_timeval(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\Timeval", timeval_methods); ce.create_object = create_wrapped_grpc_timeval; grpc_ce_timeval = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&timeval_ce_handlers, zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - timeval_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_timeval, std); - timeval_ce_handlers.free_obj = free_wrapped_grpc_timeval; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_timeval, timeval_ce_handlers); } void grpc_shutdown_timeval(TSRMLS_D) {} -- cgit v1.2.3 From 6972af492da588a39e64cc13a04ad9a7f0a05097 Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 28 Jul 2016 22:46:07 +0800 Subject: add macro PHP_GRPC_INIT_HANDLER --- src/php/ext/grpc/call.c | 20 ++++++-------------- src/php/ext/grpc/call_credentials.c | 11 ++--------- src/php/ext/grpc/call_credentials.h | 6 ++---- src/php/ext/grpc/channel.c | 8 +------- src/php/ext/grpc/channel_credentials.c | 11 ++--------- src/php/ext/grpc/channel_credentials.h | 5 ++--- src/php/ext/grpc/php7_wrapper.h | 11 ++++++++++- src/php/ext/grpc/server.c | 9 ++------- src/php/ext/grpc/server.h | 3 +-- src/php/ext/grpc/server_credentials.c | 13 +++---------- src/php/ext/grpc/server_credentials.h | 4 ++-- src/php/ext/grpc/timeval.c | 8 +------- 12 files changed, 34 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 840ac71364..429dbf52d0 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -105,8 +105,8 @@ zval *grpc_parse_metadata_array(grpc_metadata_array memcpy(str_key, elem->key, key_len); str_val = ecalloc(elem->value_length + 1, sizeof(char)); memcpy(str_val, elem->value, elem->value_length); - if (php_grpc_zend_hash_find(array_hash, str_key, key_len, (void **)&data) == - SUCCESS) { + if (php_grpc_zend_hash_find(array_hash, str_key, key_len, (void **)&data) + == SUCCESS) { if (Z_TYPE_P(data) != IS_ARRAY) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Metadata hash somehow contains wrong types.", @@ -271,7 +271,6 @@ PHP_METHOD(Call, startBatch) { char *message_str; size_t message_len; - grpc_metadata_array_init(&metadata); grpc_metadata_array_init(&trailing_metadata); grpc_metadata_array_init(&recv_metadata); @@ -291,7 +290,7 @@ PHP_METHOD(Call, startBatch) { char *key = NULL; int key_type; PHP_GRPC_HASH_FOREACH_LONG_KEY_VAL_START(array_hash, key, key_type, index, - value) + value) if (key_type != HASH_KEY_IS_LONG || key != NULL) { zend_throw_exception(spl_ce_InvalidArgumentException, "batch keys must be integers", 1 TSRMLS_CC); @@ -304,10 +303,8 @@ PHP_METHOD(Call, startBatch) { "Bad metadata value given", 1 TSRMLS_CC); goto cleanup; } - ops[op_num].data.send_initial_metadata.count = - metadata.count; - ops[op_num].data.send_initial_metadata.metadata = - metadata.metadata; + ops[op_num].data.send_initial_metadata.count = metadata.count; + ops[op_num].data.send_initial_metadata.metadata = metadata.metadata; break; case GRPC_OP_SEND_MESSAGE: if (Z_TYPE_P(value) != IS_ARRAY) { @@ -562,10 +559,5 @@ void grpc_init_call(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\Call", call_methods); ce.create_object = create_wrapped_grpc_call; grpc_ce_call = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&call_ce_handlers, zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - call_ce_handlers.offset = XtOffsetOf(wrapped_grpc_call, std); - call_ce_handlers.free_obj = free_wrapped_grpc_call; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_call, call_ce_handlers); } diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c index 34a88af47f..6921a5df17 100644 --- a/src/php/ext/grpc/call_credentials.c +++ b/src/php/ext/grpc/call_credentials.c @@ -235,13 +235,6 @@ void grpc_init_call_credentials(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\CallCredentials", call_credentials_methods); ce.create_object = create_wrapped_grpc_call_credentials; grpc_ce_call_credentials = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&call_credentials_ce_handlers, - zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - call_credentials_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_call_credentials, std); - call_credentials_ce_handlers.free_obj = - free_wrapped_grpc_call_credentials; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_call_credentials, + call_credentials_ce_handlers); } diff --git a/src/php/ext/grpc/call_credentials.h b/src/php/ext/grpc/call_credentials.h index 8014b75c70..c1d85c0fb2 100755 --- a/src/php/ext/grpc/call_credentials.h +++ b/src/php/ext/grpc/call_credentials.h @@ -64,10 +64,8 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_call_credentials) static inline wrapped_grpc_call_credentials *wrapped_grpc_call_credentials_from_obj(zend_object *obj) { - return - (wrapped_grpc_call_credentials*)((char*)(obj) - - XtOffsetOf(wrapped_grpc_call_credentials, - std)); + return (wrapped_grpc_call_credentials*)( + (char*)(obj) - XtOffsetOf(wrapped_grpc_call_credentials, std)); } #define Z_WRAPPED_GRPC_CALL_CREDS_P(zv) \ diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 1d3f68af7c..e96ead582f 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -256,11 +256,5 @@ void grpc_init_channel(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\Channel", channel_methods); ce.create_object = create_wrapped_grpc_channel; grpc_ce_channel = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&channel_ce_handlers, zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - channel_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_channel, std); - channel_ce_handlers.free_obj = free_wrapped_grpc_channel; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_channel, channel_ce_handlers); } diff --git a/src/php/ext/grpc/channel_credentials.c b/src/php/ext/grpc/channel_credentials.c index 7ef95cc5e2..0b356aa25f 100644 --- a/src/php/ext/grpc/channel_credentials.c +++ b/src/php/ext/grpc/channel_credentials.c @@ -226,13 +226,6 @@ void grpc_init_channel_credentials(TSRMLS_D) { grpc_set_ssl_roots_override_callback(get_ssl_roots_override); ce.create_object = create_wrapped_grpc_channel_credentials; grpc_ce_channel_credentials = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&channel_credentials_ce_handlers, - zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - channel_credentials_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_channel_credentials, std); - channel_credentials_ce_handlers.free_obj = - free_wrapped_grpc_channel_credentials; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_channel_credentials, + channel_credentials_ce_handlers); } diff --git a/src/php/ext/grpc/channel_credentials.h b/src/php/ext/grpc/channel_credentials.h index 39dc85283d..b043d91fa6 100755 --- a/src/php/ext/grpc/channel_credentials.h +++ b/src/php/ext/grpc/channel_credentials.h @@ -64,9 +64,8 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_channel_credentials) static inline wrapped_grpc_channel_credentials *wrapped_grpc_channel_credentials_from_obj(zend_object *obj) { - return - (wrapped_grpc_channel_credentials *) - ((char*)(obj) - XtOffsetOf(wrapped_grpc_channel_credentials, std)); + return (wrapped_grpc_channel_credentials *)( + (char*)(obj) - XtOffsetOf(wrapped_grpc_channel_credentials, std)); } #define Z_WRAPPED_GRPC_CHANNEL_CREDS_P(zv) \ diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index 44d6cd8dd7..f2976c26cd 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -125,6 +125,8 @@ static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, voi #define PHP_GRPC_GET_CLASS_ENTRY(object) zend_get_class_entry(object TSRMLS_CC) +#define PHP_GRPC_INIT_HANDLER(class_object, handler_name) + #else #define php_grpc_int size_t @@ -187,7 +189,8 @@ static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, voi #define PHP_GRPC_HASH_FOREACH_END() } ZEND_HASH_FOREACH_END(); -static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, void **value) { +static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, + void **value) { zval *value_tmp = zend_hash_str_find(ht, key, len -1); if (value_tmp == NULL) { return FAILURE; @@ -203,6 +206,12 @@ static inline int php_grpc_zend_hash_del(HashTable *ht, char *key, int len) { #define PHP_GRPC_GET_CLASS_ENTRY(object) Z_OBJ_P(object)->ce +#define PHP_GRPC_INIT_HANDLER(class_object, handler_name) \ + memcpy(&handler_name, zend_get_std_object_handlers(), \ + sizeof(zend_object_handlers)); \ + handler_name.offset = XtOffsetOf(class_object, std); \ + handler_name.free_obj = free_##class_object + #endif /* PHP_MAJOR_VERSION */ #endif /* PHP7_WRAPPER_GRPC_H */ diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c index 452ccca3e1..fc20c42b16 100644 --- a/src/php/ext/grpc/server.c +++ b/src/php/ext/grpc/server.c @@ -233,7 +233,7 @@ static zend_function_entry server_methods[] = { PHP_ME(Server, addHttp2Port, NULL, ZEND_ACC_PUBLIC) PHP_ME(Server, addSecureHttp2Port, NULL, ZEND_ACC_PUBLIC) PHP_ME(Server, start, NULL, ZEND_ACC_PUBLIC) - PHP_FE_END + PHP_FE_END }; void grpc_init_server(TSRMLS_D) { @@ -241,10 +241,5 @@ void grpc_init_server(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\Server", server_methods); ce.create_object = create_wrapped_grpc_server; grpc_ce_server = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&server_ce_handlers, zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - server_ce_handlers.offset = XtOffsetOf(wrapped_grpc_server, std); - server_ce_handlers.free_obj = free_wrapped_grpc_server; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_server, server_ce_handlers); } diff --git a/src/php/ext/grpc/server.h b/src/php/ext/grpc/server.h index 02ef1f7975..a635bc11df 100755 --- a/src/php/ext/grpc/server.h +++ b/src/php/ext/grpc/server.h @@ -66,8 +66,7 @@ static inline wrapped_grpc_server XtOffsetOf(wrapped_grpc_server, std)); } -#define Z_WRAPPED_GRPC_SERVER_P(zv) \ - wrapped_grpc_server_from_obj(Z_OBJ_P((zv))) +#define Z_WRAPPED_GRPC_SERVER_P(zv) wrapped_grpc_server_from_obj(Z_OBJ_P((zv))) #endif /* PHP_MAJOR_VERSION */ diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c index 61041b4cb3..b05896af4a 100644 --- a/src/php/ext/grpc/server_credentials.c +++ b/src/php/ext/grpc/server_credentials.c @@ -122,7 +122,7 @@ PHP_METHOD(ServerCredentials, createSsl) { static zend_function_entry server_credentials_methods[] = { PHP_ME(ServerCredentials, createSsl, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_FE_END + PHP_FE_END }; void grpc_init_server_credentials(TSRMLS_D) { @@ -130,13 +130,6 @@ void grpc_init_server_credentials(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\ServerCredentials", server_credentials_methods); ce.create_object = create_wrapped_grpc_server_credentials; grpc_ce_server_credentials = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&server_credentials_ce_handlers, - zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - server_credentials_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_server_credentials, std); - server_credentials_ce_handlers.free_obj = - free_wrapped_grpc_server_credentials; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_server_credentials, + server_credentials_ce_handlers); } diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h index 9551ec6c24..6781a614b1 100755 --- a/src/php/ext/grpc/server_credentials.h +++ b/src/php/ext/grpc/server_credentials.h @@ -64,8 +64,8 @@ PHP_GRPC_WRAP_OBJECT_END(wrapped_grpc_server_credentials) static inline wrapped_grpc_server_credentials *wrapped_grpc_server_credentials_from_obj(zend_object *obj) { - return (wrapped_grpc_server_credentials*) - ((char*)(obj) - XtOffsetOf(wrapped_grpc_server_credentials, std)); + return (wrapped_grpc_server_credentials*)( + (char*)(obj) - XtOffsetOf(wrapped_grpc_server_credentials, std)); } #define Z_WRAPPED_GRPC_SERVER_CREDS_P(zv) \ diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c index 28d360f09f..e145d96772 100644 --- a/src/php/ext/grpc/timeval.c +++ b/src/php/ext/grpc/timeval.c @@ -278,13 +278,7 @@ void grpc_init_timeval(TSRMLS_D) { INIT_CLASS_ENTRY(ce, "Grpc\\Timeval", timeval_methods); ce.create_object = create_wrapped_grpc_timeval; grpc_ce_timeval = zend_register_internal_class(&ce TSRMLS_CC); -#if PHP_MAJOR_VERSION >= 7 - memcpy(&timeval_ce_handlers, zend_get_std_object_handlers(), - sizeof(zend_object_handlers)); - timeval_ce_handlers.offset = - XtOffsetOf(wrapped_grpc_timeval, std); - timeval_ce_handlers.free_obj = free_wrapped_grpc_timeval; -#endif + PHP_GRPC_INIT_HANDLER(wrapped_grpc_timeval, timeval_ce_handlers); } void grpc_shutdown_timeval(TSRMLS_D) {} -- cgit v1.2.3 From 8e565024577512f239bf959e47d6b228d0339c53 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Thu, 28 Jul 2016 10:32:43 -0700 Subject: php: cleanup for GA --- package.xml | 19 ++++- src/php/ext/grpc/call.c | 3 +- src/php/ext/grpc/package.xml | 156 ---------------------------------------- src/php/ext/grpc/php7_wrapper.h | 3 +- templates/package.xml.template | 19 ++++- 5 files changed, 38 insertions(+), 162 deletions(-) delete mode 100644 src/php/ext/grpc/package.xml (limited to 'src') diff --git a/package.xml b/package.xml index 66bd6886bb..f395334745 100644 --- a/package.xml +++ b/package.xml @@ -10,7 +10,7 @@ grpc-packages@google.com yes - 2016-07-21 + 2016-07-28 1.1.0 @@ -22,7 +22,7 @@ BSD -- PHP7 Support #7464 +- PHP7 Support continued, reduce code duplication #7543 @@ -1118,5 +1118,20 @@ Update to wrap gRPC C Core version 0.10.0 - PHP7 Support #7464 + + + 1.0.0RC3 + 1.0.0RC3 + + + stable + stable + + 2016-07-28 + BSD + +- PHP7 Support continued, reduce code duplication #7543 + + diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 429dbf52d0..66ca1513ed 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -470,7 +470,8 @@ PHP_METHOD(Call, startBatch) { #endif PHP_GRPC_DELREF(array); add_property_long(recv_status, "code", status); - php_grpc_add_property_string(recv_status, "details", status_details, true); + php_grpc_add_property_string(recv_status, "details", status_details, + true); add_property_zval(result, "status", recv_status); PHP_GRPC_DELREF(recv_status); break; diff --git a/src/php/ext/grpc/package.xml b/src/php/ext/grpc/package.xml deleted file mode 100644 index daf2ee5a53..0000000000 --- a/src/php/ext/grpc/package.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - grpc - pecl.php.net - A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. - Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2. These libraries enable communication between clients and servers using any combination of the supported languages. - - Stanley Cheung - stanleycheung - grpc-packages@google.com - yes - - 2016-01-13 - - - 0.7.0 - 0.7.0 - - - beta - beta - - BSD - -- Breaking change to Credentials class (removed) #3765 -- Replaced by ChannelCredentials and CallCredentials class #3765 -- New plugin based metadata auth API #4394 -- Explicit ChannelCredentials::createInsecure() call - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5.5.0 - - - 1.4.0 - - - - grpc - - - - - 0.5.0 - 0.5.0 - - - alpha - alpha - - 2015-06-16 - BSD - -First alpha release - - - - - 0.5.1 - 0.5.1 - - - alpha - alpha - - 2015-07-09 - BSD - -Update to wrap gRPC C Core version 0.10.0 - - - - - 0.6.0 - 0.6.0 - - - beta - beta - - 2015-09-24 - BSD - -- support per message compression disable -- expose per-call host override option -- expose connectivity API -- expose channel target and call peer -- add user-agent -- update to wrap gRPC C core library beta version 0.11.0 - - - - - 0.6.1 - 0.6.0 - - - beta - beta - - 2015-10-21 - BSD - -- fixed undefined constant fatal error when run with apache/nginx #2275 - - - - - 0.7.0 - 0.7.0 - - - beta - beta - - 2016-01-13 - BSD - -- Breaking change to Credentials class (removed) #3765 -- Replaced by ChannelCredentials and CallCredentials class #3765 -- New plugin based metadata auth API #4394 -- Explicit ChannelCredentials::createInsecure() call - - - - diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index f2976c26cd..fd8d35636f 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -110,7 +110,8 @@ #define PHP_GRPC_HASH_FOREACH_END() } -static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, void **value) { +static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, + void **value) { zval **data = NULL; if (zend_hash_find(ht, key, len, (void **)&data) == SUCCESS) { *value = *data; diff --git a/templates/package.xml.template b/templates/package.xml.template index 76c6fff7a7..87b1038959 100644 --- a/templates/package.xml.template +++ b/templates/package.xml.template @@ -12,7 +12,7 @@ grpc-packages@google.com yes - 2016-07-21 + 2016-07-28 ${settings.php_version.php()} @@ -24,7 +24,7 @@ BSD - - PHP7 Support #7464 + - PHP7 Support continued, reduce code duplication #7543 @@ -234,5 +234,20 @@ - PHP7 Support #7464 + + + 1.0.0RC3 + 1.0.0RC3 + + + stable + stable + + 2016-07-28 + BSD + + - PHP7 Support continued, reduce code duplication #7543 + + -- cgit v1.2.3 From 526a9f908627d686827f8abb34e16f211a679261 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Thu, 28 Jul 2016 10:32:43 -0700 Subject: php: cleanup for GA --- package.xml | 19 ++++- src/php/ext/grpc/call.c | 3 +- src/php/ext/grpc/package.xml | 156 ---------------------------------------- src/php/ext/grpc/php7_wrapper.h | 3 +- templates/package.xml.template | 19 ++++- 5 files changed, 38 insertions(+), 162 deletions(-) delete mode 100644 src/php/ext/grpc/package.xml (limited to 'src') diff --git a/package.xml b/package.xml index 1392829063..65764e8888 100644 --- a/package.xml +++ b/package.xml @@ -10,7 +10,7 @@ grpc-packages@google.com yes - 2016-07-21 + 2016-07-28 1.0.0 @@ -22,7 +22,7 @@ BSD -- PHP7 Support #7464 +- PHP7 Support continued, reduce code duplication #7543 @@ -1116,5 +1116,20 @@ Update to wrap gRPC C Core version 0.10.0 - PHP7 Support #7464 + + + 1.0.0RC3 + 1.0.0RC3 + + + stable + stable + + 2016-07-28 + BSD + +- PHP7 Support continued, reduce code duplication #7543 + + diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 429dbf52d0..66ca1513ed 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -470,7 +470,8 @@ PHP_METHOD(Call, startBatch) { #endif PHP_GRPC_DELREF(array); add_property_long(recv_status, "code", status); - php_grpc_add_property_string(recv_status, "details", status_details, true); + php_grpc_add_property_string(recv_status, "details", status_details, + true); add_property_zval(result, "status", recv_status); PHP_GRPC_DELREF(recv_status); break; diff --git a/src/php/ext/grpc/package.xml b/src/php/ext/grpc/package.xml deleted file mode 100644 index daf2ee5a53..0000000000 --- a/src/php/ext/grpc/package.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - grpc - pecl.php.net - A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. - Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2. These libraries enable communication between clients and servers using any combination of the supported languages. - - Stanley Cheung - stanleycheung - grpc-packages@google.com - yes - - 2016-01-13 - - - 0.7.0 - 0.7.0 - - - beta - beta - - BSD - -- Breaking change to Credentials class (removed) #3765 -- Replaced by ChannelCredentials and CallCredentials class #3765 -- New plugin based metadata auth API #4394 -- Explicit ChannelCredentials::createInsecure() call - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5.5.0 - - - 1.4.0 - - - - grpc - - - - - 0.5.0 - 0.5.0 - - - alpha - alpha - - 2015-06-16 - BSD - -First alpha release - - - - - 0.5.1 - 0.5.1 - - - alpha - alpha - - 2015-07-09 - BSD - -Update to wrap gRPC C Core version 0.10.0 - - - - - 0.6.0 - 0.6.0 - - - beta - beta - - 2015-09-24 - BSD - -- support per message compression disable -- expose per-call host override option -- expose connectivity API -- expose channel target and call peer -- add user-agent -- update to wrap gRPC C core library beta version 0.11.0 - - - - - 0.6.1 - 0.6.0 - - - beta - beta - - 2015-10-21 - BSD - -- fixed undefined constant fatal error when run with apache/nginx #2275 - - - - - 0.7.0 - 0.7.0 - - - beta - beta - - 2016-01-13 - BSD - -- Breaking change to Credentials class (removed) #3765 -- Replaced by ChannelCredentials and CallCredentials class #3765 -- New plugin based metadata auth API #4394 -- Explicit ChannelCredentials::createInsecure() call - - - - diff --git a/src/php/ext/grpc/php7_wrapper.h b/src/php/ext/grpc/php7_wrapper.h index f2976c26cd..fd8d35636f 100644 --- a/src/php/ext/grpc/php7_wrapper.h +++ b/src/php/ext/grpc/php7_wrapper.h @@ -110,7 +110,8 @@ #define PHP_GRPC_HASH_FOREACH_END() } -static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, void **value) { +static inline int php_grpc_zend_hash_find(HashTable *ht, char *key, int len, + void **value) { zval **data = NULL; if (zend_hash_find(ht, key, len, (void **)&data) == SUCCESS) { *value = *data; diff --git a/templates/package.xml.template b/templates/package.xml.template index 76c6fff7a7..87b1038959 100644 --- a/templates/package.xml.template +++ b/templates/package.xml.template @@ -12,7 +12,7 @@ grpc-packages@google.com yes - 2016-07-21 + 2016-07-28 ${settings.php_version.php()} @@ -24,7 +24,7 @@ BSD - - PHP7 Support #7464 + - PHP7 Support continued, reduce code duplication #7543 @@ -234,5 +234,20 @@ - PHP7 Support #7464 + + + 1.0.0RC3 + 1.0.0RC3 + + + stable + stable + + 2016-07-28 + BSD + + - PHP7 Support continued, reduce code duplication #7543 + + -- cgit v1.2.3 From 161767771bff220f05d4a82b8e2c11df49a70808 Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Thu, 28 Jul 2016 10:32:49 -0700 Subject: update to use new nuget client in tests --- src/csharp/.nuget/packages.config | 6 --- src/csharp/Grpc.Core.Tests/packages.config | 5 +- src/csharp/Grpc.Core.Tests/project.json | 5 +- .../Grpc.Examples.MathClient/packages.config | 3 ++ .../Grpc.Examples.MathServer/packages.config | 3 ++ .../packages.config | 3 ++ .../packages.config | 3 ++ .../csharp/Grpc.Core.Tests/project.json.template | 5 +- tools/run_tests/pre_build_csharp.bat | 55 +++++++++++++++++++++- tools/run_tests/pre_build_csharp.sh | 51 +++++++++++++++++++- 10 files changed, 128 insertions(+), 11 deletions(-) delete mode 100644 src/csharp/.nuget/packages.config create mode 100644 src/csharp/Grpc.Examples.MathClient/packages.config create mode 100644 src/csharp/Grpc.Examples.MathServer/packages.config create mode 100644 src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config create mode 100644 src/csharp/Grpc.IntegrationTesting.StressClient/packages.config (limited to 'src') diff --git a/src/csharp/.nuget/packages.config b/src/csharp/.nuget/packages.config deleted file mode 100644 index 6154b3561f..0000000000 --- a/src/csharp/.nuget/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/csharp/Grpc.Core.Tests/packages.config b/src/csharp/Grpc.Core.Tests/packages.config index aa7d951fdc..6a930c17ee 100644 --- a/src/csharp/Grpc.Core.Tests/packages.config +++ b/src/csharp/Grpc.Core.Tests/packages.config @@ -4,4 +4,7 @@ - \ No newline at end of file + + + + diff --git a/src/csharp/Grpc.Core.Tests/project.json b/src/csharp/Grpc.Core.Tests/project.json index d4c9a2ef31..4a682d927e 100644 --- a/src/csharp/Grpc.Core.Tests/project.json +++ b/src/csharp/Grpc.Core.Tests/project.json @@ -54,7 +54,10 @@ }, "Newtonsoft.Json": "8.0.3", "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "NUnitLite": "3.2.0-*", + "NUnit.ConsoleRunner": "3.2.0", + "OpenCover": "4.6.519", + "ReportGenerator": "2.4.4.0" }, "frameworks": { "net45": { }, diff --git a/src/csharp/Grpc.Examples.MathClient/packages.config b/src/csharp/Grpc.Examples.MathClient/packages.config new file mode 100644 index 0000000000..79ece06bef --- /dev/null +++ b/src/csharp/Grpc.Examples.MathClient/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/src/csharp/Grpc.Examples.MathServer/packages.config b/src/csharp/Grpc.Examples.MathServer/packages.config new file mode 100644 index 0000000000..79ece06bef --- /dev/null +++ b/src/csharp/Grpc.Examples.MathServer/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config b/src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config new file mode 100644 index 0000000000..79ece06bef --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/src/csharp/Grpc.IntegrationTesting.StressClient/packages.config b/src/csharp/Grpc.IntegrationTesting.StressClient/packages.config new file mode 100644 index 0000000000..79ece06bef --- /dev/null +++ b/src/csharp/Grpc.IntegrationTesting.StressClient/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/templates/src/csharp/Grpc.Core.Tests/project.json.template b/templates/src/csharp/Grpc.Core.Tests/project.json.template index bc9fa3e63a..d1ab9316f6 100644 --- a/templates/src/csharp/Grpc.Core.Tests/project.json.template +++ b/templates/src/csharp/Grpc.Core.Tests/project.json.template @@ -8,7 +8,10 @@ }, "Newtonsoft.Json": "8.0.3", "NUnit": "3.2.0", - "NUnitLite": "3.2.0-*" + "NUnitLite": "3.2.0-*", + "NUnit.ConsoleRunner": "3.2.0", + "OpenCover": "4.6.519", + "ReportGenerator": "2.4.4.0" }, "frameworks": { "net45": { }, diff --git a/tools/run_tests/pre_build_csharp.bat b/tools/run_tests/pre_build_csharp.bat index e7131d504c..580d5638fd 100644 --- a/tools/run_tests/pre_build_csharp.bat +++ b/tools/run_tests/pre_build_csharp.bat @@ -38,8 +38,61 @@ cd /d %~dp0\..\.. set NUGET=C:\nuget\nuget.exe if exist %NUGET% ( + @rem Restore Grpc packages by packages since Nuget client 3.4.4 doesnt support restore + @rem by solution + @rem Moving into each directory to let the restores work with both nuget 3.4 and 2.8 %NUGET% restore vsprojects/grpc_csharp_ext.sln || goto :error - %NUGET% restore src/csharp/Grpc.sln || goto :error + + cd src/csharp + + cd Grpc.Auth || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.Core || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.Core.Tests || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.Examples.MathClient || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.Examples.MathServer || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.Examples || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.HealthCheck.Tests || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.HealthCheck || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.IntegrationTesting.Client || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.IntegrationTesting.QpsWorker || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.IntegrationTesting.StressClient || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + cd .. + + cd Grpc.IntegrationTesting || goto :error + %NUGET% restore -PackagesDirectory ../packages || goto :error + + cd /d %~dp0\..\.. || goto :error ) endlocal diff --git a/tools/run_tests/pre_build_csharp.sh b/tools/run_tests/pre_build_csharp.sh index 3ff1a4e5a8..0fd3b92a95 100755 --- a/tools/run_tests/pre_build_csharp.sh +++ b/tools/run_tests/pre_build_csharp.sh @@ -37,5 +37,54 @@ root=`pwd` if [ -x "$(command -v nuget)" ] then - nuget restore Grpc.sln + # Restoring Nuget packages by packages rather than by solution because of + # inability to restore by solution with Nuget client 3.4.4 + # Moving into each directory to let the restores work with nuget 3.4 and 2.8 + cd Grpc.Auth + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.Core.Tests + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.Core + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.Examples.MathClient + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.Examples.MathServer + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.Examples + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.HealthCheck.Tests + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.HealthCheck + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.IntegrationTesting.Client + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.IntegrationTesting.QpsWorker + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.IntegrationTesting.StressClient + nuget restore -PackagesDirectory ../packages + cd .. + + cd Grpc.IntegrationTesting + nuget restore -PackagesDirectory ../packages + cd .. fi -- cgit v1.2.3 From 5dde14ce433ebfb6444e49d31764138a855ac997 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 28 Jul 2016 17:29:27 -0700 Subject: clang-format --- src/core/lib/channel/channel_stack.h | 2 +- src/core/lib/channel/compress_filter.c | 3 +- src/core/lib/channel/http_client_filter.c | 3 +- src/core/lib/channel/http_server_filter.c | 3 +- .../lib/security/transport/client_auth_filter.c | 3 +- .../lib/security/transport/server_auth_filter.c | 3 +- src/core/lib/surface/call.c | 6 +- src/core/lib/surface/server.c | 3 +- src/core/lib/transport/static_metadata.c | 220 +++++++++++---------- src/core/lib/transport/static_metadata.h | 49 +++-- 10 files changed, 161 insertions(+), 134 deletions(-) (limited to 'src') diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h index 6a18c3dc4d..19d18ccf93 100644 --- a/src/core/lib/channel/channel_stack.h +++ b/src/core/lib/channel/channel_stack.h @@ -127,7 +127,7 @@ typedef struct { is complete. \a final_info contains data about the completed call, mainly for reporting purposes. */ void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info* final_info, + const grpc_call_final_info *final_info, void *and_free_memory); /* sizeof(per channel data) */ diff --git a/src/core/lib/channel/compress_filter.c b/src/core/lib/channel/compress_filter.c index b06e8fab67..af21ed794d 100644 --- a/src/core/lib/channel/compress_filter.c +++ b/src/core/lib/channel/compress_filter.c @@ -270,7 +270,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, void *ignored) { + const grpc_call_final_info *final_info, + void *ignored) { /* grab pointers to our data from the call element */ call_data *calld = elem->call_data; gpr_slice_buffer_destroy(&calld->slices); diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c index 3e9e8b0981..f1ed22c0ad 100644 --- a/src/core/lib/channel/http_client_filter.c +++ b/src/core/lib/channel/http_client_filter.c @@ -184,7 +184,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, void *ignored) {} + const grpc_call_final_info *final_info, + void *ignored) {} static grpc_mdelem *scheme_from_args(const grpc_channel_args *args) { unsigned i; diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c index 01509801d9..d52cc7d018 100644 --- a/src/core/lib/channel/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -235,7 +235,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, void *ignored) {} + const grpc_call_final_info *final_info, + void *ignored) {} /* Constructor for channel_data */ static void init_channel_elem(grpc_exec_ctx *exec_ctx, diff --git a/src/core/lib/security/transport/client_auth_filter.c b/src/core/lib/security/transport/client_auth_filter.c index bec9d80ab9..382d30756a 100644 --- a/src/core/lib/security/transport/client_auth_filter.c +++ b/src/core/lib/security/transport/client_auth_filter.c @@ -282,7 +282,8 @@ static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, void *ignored) { + const grpc_call_final_info *final_info, + void *ignored) { call_data *calld = elem->call_data; grpc_call_credentials_unref(calld->creds); if (calld->host != NULL) { diff --git a/src/core/lib/security/transport/server_auth_filter.c b/src/core/lib/security/transport/server_auth_filter.c index 416b0187a2..5f3d0dcd6e 100644 --- a/src/core/lib/security/transport/server_auth_filter.c +++ b/src/core/lib/security/transport/server_auth_filter.c @@ -226,7 +226,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, /* Destructor for call_data */ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, void *ignored) {} + const grpc_call_final_info *final_info, + void *ignored) {} /* Constructor for channel_data */ static void init_channel_elem(grpc_exec_ctx *exec_ctx, diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index dc54978ccd..70c94791f8 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1614,7 +1614,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, bctl->recv_final_op = 1; stream_op.recv_trailing_metadata = &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */]; - stream_op.collect_stats = &call->final_info.stats.transport_stream_stats; + stream_op.collect_stats = + &call->final_info.stats.transport_stream_stats; break; case GRPC_OP_RECV_CLOSE_ON_SERVER: /* Flag validation: currently allow no flags */ @@ -1636,7 +1637,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, bctl->recv_final_op = 1; stream_op.recv_trailing_metadata = &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */]; - stream_op.collect_stats = &call->final_info.stats.transport_stream_stats; + stream_op.collect_stats = + &call->final_info.stats.transport_stream_stats; break; } } diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index 4671d6d09e..32913ad4e8 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -864,7 +864,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, } static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, void *ignored) { + const grpc_call_final_info *final_info, + void *ignored) { channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.c index cd58857a1d..c396c1e0b5 100644 --- a/src/core/lib/transport/static_metadata.c +++ b/src/core/lib/transport/static_metadata.c @@ -1,11 +1,11 @@ /* * Copyright 2015, Google Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -15,7 +15,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -31,10 +31,10 @@ /* * WARNING: Auto-generated code. - * + * * To make changes to this file, change * tools/codegen/core/gen_static_metadata.py, and then re-run it. - * + * * See metadata.h for an explanation of the interface here, and metadata.c for * an explanation of what's going on. */ @@ -45,109 +45,115 @@ grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT]; uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,6,2,4,8,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 8, 6, 2, 4, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; -const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT*2] = { -11,35,10,35,12,35,12,49,13,35,14,35,15,35,16,35,17,35,19,35,20,35,21,35,24,35,25,35,26,35,27,35,28,35,29,35,30,18,30,35,31,35,32,35,36,35,37,35,38,35,39,35,42,33,42,34,42,48,42,53,42,54,42,55,42,56,43,33,43,48,43,53,46,0,46,1,46,2,50,35,57,35,58,35,59,35,60,35,61,35,62,35,63,35,64,35,65,35,66,35,67,35,68,40,68,70,68,73,69,81,69,82,71,35,72,35,74,35,75,35,76,35,77,35,78,41,78,51,78,52,79,35,80,35,83,3,83,4,83,5,83,6,83,7,83,8,83,9,84,35,85,86,87,35,88,35,89,35,90,35,91,35 -}; +const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2] = + {11, 35, 10, 35, 12, 35, 12, 49, 13, 35, 14, 35, 15, 35, 16, 35, 17, 35, + 19, 35, 20, 35, 21, 35, 24, 35, 25, 35, 26, 35, 27, 35, 28, 35, 29, 35, + 30, 18, 30, 35, 31, 35, 32, 35, 36, 35, 37, 35, 38, 35, 39, 35, 42, 33, + 42, 34, 42, 48, 42, 53, 42, 54, 42, 55, 42, 56, 43, 33, 43, 48, 43, 53, + 46, 0, 46, 1, 46, 2, 50, 35, 57, 35, 58, 35, 59, 35, 60, 35, 61, 35, + 62, 35, 63, 35, 64, 35, 65, 35, 66, 35, 67, 35, 68, 40, 68, 70, 68, 73, + 69, 81, 69, 82, 71, 35, 72, 35, 74, 35, 75, 35, 76, 35, 77, 35, 78, 41, + 78, 51, 78, 52, 79, 35, 80, 35, 83, 3, 83, 4, 83, 5, 83, 6, 83, 7, + 83, 8, 83, 9, 84, 35, 85, 86, 87, 35, 88, 35, 89, 35, 90, 35, 91, 35}; const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = { - "0", - "1", - "2", - "200", - "204", - "206", - "304", - "400", - "404", - "500", - "accept", - "accept-charset", - "accept-encoding", - "accept-language", - "accept-ranges", - "access-control-allow-origin", - "age", - "allow", - "application/grpc", - ":authority", - "authorization", - "cache-control", - "census-bin", - "census-binary-bin", - "content-disposition", - "content-encoding", - "content-language", - "content-length", - "content-location", - "content-range", - "content-type", - "cookie", - "date", - "deflate", - "deflate,gzip", - "", - "etag", - "expect", - "expires", - "from", - "GET", - "grpc", - "grpc-accept-encoding", - "grpc-encoding", - "grpc-internal-encoding-request", - "grpc-message", - "grpc-status", - "grpc-timeout", - "gzip", - "gzip, deflate", - "host", - "http", - "https", - "identity", - "identity,deflate", - "identity,deflate,gzip", - "identity,gzip", - "if-match", - "if-modified-since", - "if-none-match", - "if-range", - "if-unmodified-since", - "last-modified", - "link", - "load-reporting-initial", - "load-reporting-trailing", - "location", - "max-forwards", - ":method", - ":path", - "POST", - "proxy-authenticate", - "proxy-authorization", - "PUT", - "range", - "referer", - "refresh", - "retry-after", - ":scheme", - "server", - "set-cookie", - "/", - "/index.html", - ":status", - "strict-transport-security", - "te", - "trailers", - "transfer-encoding", - "user-agent", - "vary", - "via", - "www-authenticate" -}; - -const uint8_t grpc_static_accept_encoding_metadata[8] = { -0,29,26,30,28,32,27,31 -}; + "0", + "1", + "2", + "200", + "204", + "206", + "304", + "400", + "404", + "500", + "accept", + "accept-charset", + "accept-encoding", + "accept-language", + "accept-ranges", + "access-control-allow-origin", + "age", + "allow", + "application/grpc", + ":authority", + "authorization", + "cache-control", + "census-bin", + "census-binary-bin", + "content-disposition", + "content-encoding", + "content-language", + "content-length", + "content-location", + "content-range", + "content-type", + "cookie", + "date", + "deflate", + "deflate,gzip", + "", + "etag", + "expect", + "expires", + "from", + "GET", + "grpc", + "grpc-accept-encoding", + "grpc-encoding", + "grpc-internal-encoding-request", + "grpc-message", + "grpc-status", + "grpc-timeout", + "gzip", + "gzip, deflate", + "host", + "http", + "https", + "identity", + "identity,deflate", + "identity,deflate,gzip", + "identity,gzip", + "if-match", + "if-modified-since", + "if-none-match", + "if-range", + "if-unmodified-since", + "last-modified", + "link", + "load-reporting-initial", + "load-reporting-trailing", + "location", + "max-forwards", + ":method", + ":path", + "POST", + "proxy-authenticate", + "proxy-authorization", + "PUT", + "range", + "referer", + "refresh", + "retry-after", + ":scheme", + "server", + "set-cookie", + "/", + "/index.html", + ":status", + "strict-transport-security", + "te", + "trailers", + "transfer-encoding", + "user-agent", + "vary", + "via", + "www-authenticate"}; +const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 29, 26, 30, + 28, 32, 27, 31}; diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index 1b6bfc1018..491c8cf125 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -1,11 +1,11 @@ /* * Copyright 2015, Google Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -15,7 +15,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -31,10 +31,10 @@ /* * WARNING: Auto-generated code. - * + * * To make changes to this file, change * tools/codegen/core/gen_static_metadata.py, and then re-run it. - * + * * See metadata.h for an explanation of the interface here, and metadata.c for * an explanation of what's going on. */ @@ -157,7 +157,8 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; /* "identity,deflate" */ #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (&grpc_static_mdstr_table[54]) /* "identity,deflate,gzip" */ -#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP (&grpc_static_mdstr_table[55]) +#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ + (&grpc_static_mdstr_table[55]) /* "identity,gzip" */ #define GRPC_MDSTR_IDENTITY_COMMA_GZIP (&grpc_static_mdstr_table[56]) /* "if-match" */ @@ -241,13 +242,15 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "accept-encoding": "" */ #define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY (&grpc_static_mdelem_table[2]) /* "accept-encoding": "gzip, deflate" */ -#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE (&grpc_static_mdelem_table[3]) +#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE \ + (&grpc_static_mdelem_table[3]) /* "accept-language": "" */ #define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY (&grpc_static_mdelem_table[4]) /* "accept-ranges": "" */ #define GRPC_MDELEM_ACCEPT_RANGES_EMPTY (&grpc_static_mdelem_table[5]) /* "access-control-allow-origin": "" */ -#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY (&grpc_static_mdelem_table[6]) +#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY \ + (&grpc_static_mdelem_table[6]) /* "age": "" */ #define GRPC_MDELEM_AGE_EMPTY (&grpc_static_mdelem_table[7]) /* "allow": "" */ @@ -271,7 +274,8 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "content-range": "" */ #define GRPC_MDELEM_CONTENT_RANGE_EMPTY (&grpc_static_mdelem_table[17]) /* "content-type": "application/grpc" */ -#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC (&grpc_static_mdelem_table[18]) +#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \ + (&grpc_static_mdelem_table[18]) /* "content-type": "" */ #define GRPC_MDELEM_CONTENT_TYPE_EMPTY (&grpc_static_mdelem_table[19]) /* "cookie": "" */ @@ -289,17 +293,22 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "grpc-accept-encoding": "deflate" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE (&grpc_static_mdelem_table[26]) /* "grpc-accept-encoding": "deflate,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP (&grpc_static_mdelem_table[27]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \ + (&grpc_static_mdelem_table[27]) /* "grpc-accept-encoding": "gzip" */ #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP (&grpc_static_mdelem_table[28]) /* "grpc-accept-encoding": "identity" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY (&grpc_static_mdelem_table[29]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \ + (&grpc_static_mdelem_table[29]) /* "grpc-accept-encoding": "identity,deflate" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE (&grpc_static_mdelem_table[30]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \ + (&grpc_static_mdelem_table[30]) /* "grpc-accept-encoding": "identity,deflate,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP (&grpc_static_mdelem_table[31]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ + (&grpc_static_mdelem_table[31]) /* "grpc-accept-encoding": "identity,gzip" */ -#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP (&grpc_static_mdelem_table[32]) +#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \ + (&grpc_static_mdelem_table[32]) /* "grpc-encoding": "deflate" */ #define GRPC_MDELEM_GRPC_ENCODING_DEFLATE (&grpc_static_mdelem_table[33]) /* "grpc-encoding": "gzip" */ @@ -331,7 +340,8 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "load-reporting-initial": "" */ #define GRPC_MDELEM_LOAD_REPORTING_INITIAL_EMPTY (&grpc_static_mdelem_table[47]) /* "load-reporting-trailing": "" */ -#define GRPC_MDELEM_LOAD_REPORTING_TRAILING_EMPTY (&grpc_static_mdelem_table[48]) +#define GRPC_MDELEM_LOAD_REPORTING_TRAILING_EMPTY \ + (&grpc_static_mdelem_table[48]) /* "location": "" */ #define GRPC_MDELEM_LOCATION_EMPTY (&grpc_static_mdelem_table[49]) /* "max-forwards": "" */ @@ -383,7 +393,8 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* ":status": "500" */ #define GRPC_MDELEM_STATUS_500 (&grpc_static_mdelem_table[73]) /* "strict-transport-security": "" */ -#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY (&grpc_static_mdelem_table[74]) +#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \ + (&grpc_static_mdelem_table[74]) /* "te": "trailers" */ #define GRPC_MDELEM_TE_TRAILERS (&grpc_static_mdelem_table[75]) /* "transfer-encoding": "" */ @@ -397,8 +408,10 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; /* "www-authenticate": "" */ #define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (&grpc_static_mdelem_table[80]) -extern const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT*2]; +extern const uint8_t + grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2]; extern const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT]; extern const uint8_t grpc_static_accept_encoding_metadata[8]; -#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) (&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]]) +#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) \ + (&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]]) #endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */ -- cgit v1.2.3 From 5a363258961e01fc53c28955141d16fcdf8bcd38 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Thu, 28 Jul 2016 18:28:17 -0700 Subject: Merge pull request #7502 from dgquintas/cpp_compression_level C++ Compression Level set properly --- include/grpc++/impl/codegen/async_stream.h | 27 +++++++++++++++++++++++ include/grpc++/impl/codegen/async_unary_call.h | 9 ++++++++ include/grpc++/impl/codegen/call.h | 12 +++++++--- include/grpc++/impl/codegen/method_handler_impl.h | 15 +++++++++++++ include/grpc++/impl/codegen/server_context.h | 9 +++++++- include/grpc++/impl/codegen/sync_stream.h | 15 +++++++++++++ src/cpp/server/server_context.cc | 15 ++++--------- 7 files changed, 87 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/include/grpc++/impl/codegen/async_stream.h b/include/grpc++/impl/codegen/async_stream.h index e96d224ddb..70533aa4d9 100644 --- a/include/grpc++/impl/codegen/async_stream.h +++ b/include/grpc++/impl/codegen/async_stream.h @@ -330,6 +330,9 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface { meta_ops_.set_output_tag(tag); meta_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_.PerformOps(&meta_ops_); } @@ -345,6 +348,9 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface { if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } // The response is dropped if the status is not OK. @@ -363,6 +369,9 @@ class ServerAsyncReader GRPC_FINAL : public ServerAsyncReaderInterface { if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); @@ -400,6 +409,9 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface { meta_ops_.set_output_tag(tag); meta_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_.PerformOps(&meta_ops_); } @@ -409,6 +421,9 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface { if (!ctx_->sent_initial_metadata_) { write_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + write_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } // TODO(ctiller): don't assert @@ -421,6 +436,9 @@ class ServerAsyncWriter GRPC_FINAL : public ServerAsyncWriterInterface { if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); @@ -459,6 +477,9 @@ class ServerAsyncReaderWriter GRPC_FINAL meta_ops_.set_output_tag(tag); meta_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_.PerformOps(&meta_ops_); } @@ -474,6 +495,9 @@ class ServerAsyncReaderWriter GRPC_FINAL if (!ctx_->sent_initial_metadata_) { write_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + write_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } // TODO(ctiller): don't assert @@ -486,6 +510,9 @@ class ServerAsyncReaderWriter GRPC_FINAL if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_ops_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); diff --git a/include/grpc++/impl/codegen/async_unary_call.h b/include/grpc++/impl/codegen/async_unary_call.h index 47ac5bee92..544dace32b 100644 --- a/include/grpc++/impl/codegen/async_unary_call.h +++ b/include/grpc++/impl/codegen/async_unary_call.h @@ -126,6 +126,9 @@ class ServerAsyncResponseWriter GRPC_FINAL meta_buf_.set_output_tag(tag); meta_buf_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + meta_buf_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_.PerformOps(&meta_buf_); } @@ -135,6 +138,9 @@ class ServerAsyncResponseWriter GRPC_FINAL if (!ctx_->sent_initial_metadata_) { finish_buf_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } // The response is dropped if the status is not OK. @@ -153,6 +159,9 @@ class ServerAsyncResponseWriter GRPC_FINAL if (!ctx_->sent_initial_metadata_) { finish_buf_.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + finish_buf_.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } finish_buf_.ServerSendStatus(ctx_->trailing_metadata_, status); diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h index fab85d1517..dfac177970 100644 --- a/include/grpc++/impl/codegen/call.h +++ b/include/grpc++/impl/codegen/call.h @@ -180,17 +180,23 @@ class CallNoOp { class CallOpSendInitialMetadata { public: - CallOpSendInitialMetadata() : send_(false) {} + CallOpSendInitialMetadata() : send_(false) { + maybe_compression_level_.is_set = false; + } void SendInitialMetadata( const std::multimap& metadata, uint32_t flags) { + maybe_compression_level_.is_set = false; send_ = true; flags_ = flags; initial_metadata_count_ = metadata.size(); initial_metadata_ = FillMetadataArray(metadata); - // TODO(dgq): expose compression level in API so it can be properly set. - maybe_compression_level_.is_set = false; + } + + void set_compression_level(grpc_compression_level level) { + maybe_compression_level_.is_set = true; + maybe_compression_level_.level = level; } protected: diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h index 21ac6c4fb5..2f4be644ba 100644 --- a/include/grpc++/impl/codegen/method_handler_impl.h +++ b/include/grpc++/impl/codegen/method_handler_impl.h @@ -65,6 +65,9 @@ class RpcMethodHandler : public MethodHandler { ops; ops.SendInitialMetadata(param.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); + if (param.server_context->compression_level_set()) { + ops.set_compression_level(param.server_context->compression_level()); + } if (status.ok()) { status = ops.SendMessage(rsp); } @@ -104,6 +107,9 @@ class ClientStreamingHandler : public MethodHandler { ops; ops.SendInitialMetadata(param.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); + if (param.server_context->compression_level_set()) { + ops.set_compression_level(param.server_context->compression_level()); + } if (status.ok()) { status = ops.SendMessage(rsp); } @@ -144,6 +150,9 @@ class ServerStreamingHandler : public MethodHandler { if (!param.server_context->sent_initial_metadata_) { ops.SendInitialMetadata(param.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); + if (param.server_context->compression_level_set()) { + ops.set_compression_level(param.server_context->compression_level()); + } } ops.ServerSendStatus(param.server_context->trailing_metadata_, status); param.call->PerformOps(&ops); @@ -177,6 +186,9 @@ class BidiStreamingHandler : public MethodHandler { if (!param.server_context->sent_initial_metadata_) { ops.SendInitialMetadata(param.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); + if (param.server_context->compression_level_set()) { + ops.set_compression_level(param.server_context->compression_level()); + } } ops.ServerSendStatus(param.server_context->trailing_metadata_, status); param.call->PerformOps(&ops); @@ -199,6 +211,9 @@ class UnknownMethodHandler : public MethodHandler { if (!context->sent_initial_metadata_) { ops->SendInitialMetadata(context->initial_metadata_, context->initial_metadata_flags()); + if (context->compression_level_set()) { + ops->set_compression_level(context->compression_level()); + } context->sent_initial_metadata_ = true; } ops->ServerSendStatus(context->trailing_metadata_, status); diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h index cea13a513f..08212af861 100644 --- a/include/grpc++/impl/codegen/server_context.h +++ b/include/grpc++/impl/codegen/server_context.h @@ -130,7 +130,13 @@ class ServerContext { grpc_compression_level compression_level() const { return compression_level_; } - void set_compression_level(grpc_compression_level level); + + void set_compression_level(grpc_compression_level level) { + compression_level_set_ = true; + compression_level_ = level; + } + + bool compression_level_set() const { return compression_level_set_; } grpc_compression_algorithm compression_algorithm() const { return compression_algorithm_; @@ -217,6 +223,7 @@ class ServerContext { std::multimap initial_metadata_; std::multimap trailing_metadata_; + bool compression_level_set_; grpc_compression_level compression_level_; grpc_compression_algorithm compression_algorithm_; }; diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index cbfa410699..b2b972760d 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -347,6 +347,9 @@ class ServerReader GRPC_FINAL : public ReaderInterface { CallOpSet ops; ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_->PerformOps(&ops); call_->cq()->Pluck(&ops); @@ -375,6 +378,9 @@ class ServerWriter GRPC_FINAL : public WriterInterface { CallOpSet ops; ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_->PerformOps(&ops); call_->cq()->Pluck(&ops); @@ -389,6 +395,9 @@ class ServerWriter GRPC_FINAL : public WriterInterface { if (!ctx_->sent_initial_metadata_) { ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } call_->PerformOps(&ops); @@ -413,6 +422,9 @@ class ServerReaderWriter GRPC_FINAL : public WriterInterface, CallOpSet ops; ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; call_->PerformOps(&ops); call_->cq()->Pluck(&ops); @@ -434,6 +446,9 @@ class ServerReaderWriter GRPC_FINAL : public WriterInterface, if (!ctx_->sent_initial_metadata_) { ops.SendInitialMetadata(ctx_->initial_metadata_, ctx_->initial_metadata_flags()); + if (ctx_->compression_level_set()) { + ops.set_compression_level(ctx_->compression_level()); + } ctx_->sent_initial_metadata_ = true; } call_->PerformOps(&ops); diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 43117fd1e9..1ca6a2b906 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -129,7 +129,8 @@ ServerContext::ServerContext() deadline_(gpr_inf_future(GPR_CLOCK_REALTIME)), call_(nullptr), cq_(nullptr), - sent_initial_metadata_(false) {} + sent_initial_metadata_(false), + compression_level_set_(false) {} ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata, size_t metadata_count) @@ -139,7 +140,8 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata, deadline_(deadline), call_(nullptr), cq_(nullptr), - sent_initial_metadata_(false) { + sent_initial_metadata_(false), + compression_level_set_(false) { for (size_t i = 0; i < metadata_count; i++) { client_metadata_.insert(std::pair( metadata[i].key, @@ -194,15 +196,6 @@ bool ServerContext::IsCancelled() const { } } -void ServerContext::set_compression_level(grpc_compression_level level) { - // TODO(dgq): get rid of grpc_call_compression_for_level and propagate the - // compression level by adding a new argument to - // CallOpSendInitialMetadata::SendInitialMetadata. - const grpc_compression_algorithm algorithm_for_level = - grpc_call_compression_for_level(call_, level); - set_compression_algorithm(algorithm_for_level); -} - void ServerContext::set_compression_algorithm( grpc_compression_algorithm algorithm) { char* algorithm_name = NULL; -- cgit v1.2.3 From 40e84865731a429dbf4f090ec6378df1768706a5 Mon Sep 17 00:00:00 2001 From: Alex Polcyn Date: Thu, 28 Jul 2016 23:48:50 -0700 Subject: compare test config as objects instead of strings --- src/csharp/Grpc.Core.Tests/SanityTest.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/csharp/Grpc.Core.Tests/SanityTest.cs b/src/csharp/Grpc.Core.Tests/SanityTest.cs index 501992c569..9d069fa432 100644 --- a/src/csharp/Grpc.Core.Tests/SanityTest.cs +++ b/src/csharp/Grpc.Core.Tests/SanityTest.cs @@ -58,10 +58,11 @@ namespace Grpc.Core.Tests [Test] public void TestsJsonUpToDate() { - var discoveredTests = DiscoverAllTestClasses(); - string discoveredTestsJson = JsonConvert.SerializeObject(discoveredTests, Formatting.Indented); + Dictionary> discoveredTests = DiscoverAllTestClasses(); + Dictionary> testsFromFile + = JsonConvert.DeserializeObject>>(ReadTestsJson()); - Assert.AreEqual(discoveredTestsJson, ReadTestsJson()); + Assert.AreEqual(discoveredTests, testsFromFile); } /// -- cgit v1.2.3 From 8f76df40a935e33eb738c697d453ac1bf59ce81f Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Fri, 29 Jul 2016 08:31:20 -0700 Subject: Some compilers don't like big stack frames. There is no need for this to be a power of 2, so let's just shrink it a little. --- src/core/lib/iomgr/tcp_posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/lib/iomgr/tcp_posix.c b/src/core/lib/iomgr/tcp_posix.c index ec21e03944..974d5ae479 100644 --- a/src/core/lib/iomgr/tcp_posix.c +++ b/src/core/lib/iomgr/tcp_posix.c @@ -284,7 +284,7 @@ static void tcp_read(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep, } /* returns true if done, false if pending; if returning true, *error is set */ -#define MAX_WRITE_IOVEC 1024 +#define MAX_WRITE_IOVEC 1000 static bool tcp_flush(grpc_tcp *tcp, grpc_error **error) { struct msghdr msg; struct iovec iov[MAX_WRITE_IOVEC]; -- cgit v1.2.3 From c1f25fb199a076b129dc283f51acbe1e1e7ba60c Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Fri, 29 Jul 2016 13:41:22 -0700 Subject: php: missed a macro; --- src/php/ext/grpc/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index e96ead582f..b5a2c9f6ba 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -84,7 +84,7 @@ void php_grpc_read_args_array(zval *args_array, array_hash = Z_ARRVAL_P(args_array); if (!array_hash) { zend_throw_exception(spl_ce_InvalidArgumentException, - "array_hash is NULL", 1); + "array_hash is NULL", 1 TSRMLS_CC); return; } args->num_args = zend_hash_num_elements(array_hash); -- cgit v1.2.3 From 54fe31a779f82da4c2731c2d91d6c5831b1fe985 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 1 Aug 2016 14:56:26 -0700 Subject: clang-format --- src/core/ext/load_reporting/load_reporting.c | 1 - test/core/channel/channel_stack_test.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/ext/load_reporting/load_reporting.c b/src/core/ext/load_reporting/load_reporting.c index 592625496d..df1ea0ec9a 100644 --- a/src/core/ext/load_reporting/load_reporting.c +++ b/src/core/ext/load_reporting/load_reporting.c @@ -42,7 +42,6 @@ #include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/surface/channel_init.h" - static bool is_load_reporting_enabled(const grpc_channel_args *a) { if (a == NULL) return false; for (size_t i = 0; i < a->num_args; i++) { diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c index 78ec16c5fe..806fd0a6cc 100644 --- a/test/core/channel/channel_stack_test.c +++ b/test/core/channel/channel_stack_test.c @@ -63,7 +63,8 @@ static void channel_destroy_func(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) {} static void call_destroy_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, - const grpc_call_final_info *final_info, void *ignored) { + const grpc_call_final_info *final_info, + void *ignored) { ++*(int *)(elem->channel_data); } -- cgit v1.2.3