Merge branch 'master' of github.com:grpc/grpc into grpclb_v0

pull/6924/head
David Garcia Quintas 9 years ago
commit 52c54e3c3b
  1. 44
      Makefile
  2. 4
      src/core/ext/census/grpc_filter.c
  3. 2
      src/core/ext/client_config/client_channel.c
  4. 60
      src/core/ext/load_reporting/load_reporting.c
  5. 61
      src/core/ext/load_reporting/load_reporting.h
  6. 153
      src/core/ext/load_reporting/load_reporting_filter.c
  7. 1
      src/core/ext/load_reporting/load_reporting_filter.h
  8. 6
      src/core/ext/transport/chttp2/transport/writing.c
  9. 4
      src/core/lib/channel/channel_stack.c
  10. 18
      src/core/lib/channel/channel_stack.h
  11. 3
      src/core/lib/channel/compress_filter.c
  12. 2
      src/core/lib/channel/connected_channel.c
  13. 3
      src/core/lib/channel/http_client_filter.c
  14. 3
      src/core/lib/channel/http_server_filter.c
  15. 3
      src/core/lib/security/transport/client_auth_filter.c
  16. 3
      src/core/lib/security/transport/server_auth_filter.c
  17. 54
      src/core/lib/surface/call.c
  18. 2
      src/core/lib/surface/lame_client.c
  19. 3
      src/core/lib/surface/server.c
  20. 19
      src/core/lib/transport/static_metadata.c
  21. 133
      src/core/lib/transport/static_metadata.h
  22. 3
      test/core/channel/channel_stack_test.c
  23. 8
      test/core/end2end/end2end_nosec_tests.c
  24. 8
      test/core/end2end/end2end_tests.c
  25. 95
      test/core/end2end/fixtures/h2_load_reporting.c
  26. 6
      test/core/end2end/fuzzers/hpack.dictionary
  27. 3
      test/core/end2end/gen_build_yaml.py
  28. 2
      test/core/end2end/tests/filter_causes_close.c
  29. 321
      test/core/end2end/tests/load_reporting_hook.c
  30. 3
      tools/codegen/core/gen_static_metadata.py
  31. 4
      tools/run_tests/build_python.sh
  32. 10
      tools/run_tests/sources_and_headers.json
  33. 787
      tools/run_tests/tests.json
  34. 68
      vsprojects/buildtests_c.sln
  35. 8
      vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj
  36. 10
      vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_nosec_test/h2_load_reporting_nosec_test.vcxproj.filters
  37. 8
      vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj
  38. 10
      vsprojects/vcxproj/test/end2end/fixtures/h2_load_reporting_test/h2_load_reporting_test.vcxproj.filters
  39. 2
      vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj
  40. 3
      vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj.filters
  41. 2
      vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj
  42. 3
      vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj.filters

@ -1133,7 +1133,7 @@ h2_fd_test: $(BINDIR)/$(CONFIG)/h2_fd_test
h2_full_test: $(BINDIR)/$(CONFIG)/h2_full_test h2_full_test: $(BINDIR)/$(CONFIG)/h2_full_test
h2_full+pipe_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_test h2_full+pipe_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_test
h2_full+trace_test: $(BINDIR)/$(CONFIG)/h2_full+trace_test h2_full+trace_test: $(BINDIR)/$(CONFIG)/h2_full+trace_test
h2_loadreporting_test: $(BINDIR)/$(CONFIG)/h2_loadreporting_test h2_load_reporting_test: $(BINDIR)/$(CONFIG)/h2_load_reporting_test
h2_oauth2_test: $(BINDIR)/$(CONFIG)/h2_oauth2_test h2_oauth2_test: $(BINDIR)/$(CONFIG)/h2_oauth2_test
h2_proxy_test: $(BINDIR)/$(CONFIG)/h2_proxy_test h2_proxy_test: $(BINDIR)/$(CONFIG)/h2_proxy_test
h2_sockpair_test: $(BINDIR)/$(CONFIG)/h2_sockpair_test h2_sockpair_test: $(BINDIR)/$(CONFIG)/h2_sockpair_test
@ -1149,7 +1149,7 @@ h2_fd_nosec_test: $(BINDIR)/$(CONFIG)/h2_fd_nosec_test
h2_full_nosec_test: $(BINDIR)/$(CONFIG)/h2_full_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+pipe_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test
h2_full+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+trace_nosec_test h2_full+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_full+trace_nosec_test
h2_loadreporting_nosec_test: $(BINDIR)/$(CONFIG)/h2_loadreporting_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_proxy_nosec_test: $(BINDIR)/$(CONFIG)/h2_proxy_nosec_test
h2_sockpair_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test h2_sockpair_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test
h2_sockpair+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test h2_sockpair+trace_nosec_test: $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test
@ -1349,7 +1349,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/h2_full_test \ $(BINDIR)/$(CONFIG)/h2_full_test \
$(BINDIR)/$(CONFIG)/h2_full+pipe_test \ $(BINDIR)/$(CONFIG)/h2_full+pipe_test \
$(BINDIR)/$(CONFIG)/h2_full+trace_test \ $(BINDIR)/$(CONFIG)/h2_full+trace_test \
$(BINDIR)/$(CONFIG)/h2_loadreporting_test \ $(BINDIR)/$(CONFIG)/h2_load_reporting_test \
$(BINDIR)/$(CONFIG)/h2_oauth2_test \ $(BINDIR)/$(CONFIG)/h2_oauth2_test \
$(BINDIR)/$(CONFIG)/h2_proxy_test \ $(BINDIR)/$(CONFIG)/h2_proxy_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_test \ $(BINDIR)/$(CONFIG)/h2_sockpair_test \
@ -1365,7 +1365,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/h2_full_nosec_test \ $(BINDIR)/$(CONFIG)/h2_full_nosec_test \
$(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test \ $(BINDIR)/$(CONFIG)/h2_full+pipe_nosec_test \
$(BINDIR)/$(CONFIG)/h2_full+trace_nosec_test \ $(BINDIR)/$(CONFIG)/h2_full+trace_nosec_test \
$(BINDIR)/$(CONFIG)/h2_loadreporting_nosec_test \ $(BINDIR)/$(CONFIG)/h2_load_reporting_nosec_test \
$(BINDIR)/$(CONFIG)/h2_proxy_nosec_test \ $(BINDIR)/$(CONFIG)/h2_proxy_nosec_test \
$(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test \ $(BINDIR)/$(CONFIG)/h2_sockpair_nosec_test \
$(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test \ $(BINDIR)/$(CONFIG)/h2_sockpair+trace_nosec_test \
@ -6525,6 +6525,7 @@ LIBEND2END_TESTS_SRC = \
test/core/end2end/tests/idempotent_request.c \ test/core/end2end/tests/idempotent_request.c \
test/core/end2end/tests/invoke_large_request.c \ test/core/end2end/tests/invoke_large_request.c \
test/core/end2end/tests/large_metadata.c \ test/core/end2end/tests/large_metadata.c \
test/core/end2end/tests/load_reporting_hook.c \
test/core/end2end/tests/max_concurrent_streams.c \ test/core/end2end/tests/max_concurrent_streams.c \
test/core/end2end/tests/max_message_length.c \ test/core/end2end/tests/max_message_length.c \
test/core/end2end/tests/negative_deadline.c \ test/core/end2end/tests/negative_deadline.c \
@ -6603,6 +6604,7 @@ LIBEND2END_NOSEC_TESTS_SRC = \
test/core/end2end/tests/idempotent_request.c \ test/core/end2end/tests/idempotent_request.c \
test/core/end2end/tests/invoke_large_request.c \ test/core/end2end/tests/invoke_large_request.c \
test/core/end2end/tests/large_metadata.c \ test/core/end2end/tests/large_metadata.c \
test/core/end2end/tests/load_reporting_hook.c \
test/core/end2end/tests/max_concurrent_streams.c \ test/core/end2end/tests/max_concurrent_streams.c \
test/core/end2end/tests/max_message_length.c \ test/core/end2end/tests/max_message_length.c \
test/core/end2end/tests/negative_deadline.c \ test/core/end2end/tests/negative_deadline.c \
@ -14161,34 +14163,34 @@ endif
endif endif
H2_LOADREPORTING_TEST_SRC = \ H2_LOAD_REPORTING_TEST_SRC = \
test/core/end2end/fixtures/h2_loadreporting.c \ test/core/end2end/fixtures/h2_load_reporting.c \
H2_LOADREPORTING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOADREPORTING_TEST_SRC)))) H2_LOAD_REPORTING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOAD_REPORTING_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL. # You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/h2_loadreporting_test: openssl_dep_error $(BINDIR)/$(CONFIG)/h2_load_reporting_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/h2_loadreporting_test: $(H2_LOADREPORTING_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 $(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 $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_LOADREPORTING_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_loadreporting_test $(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 endif
$(OBJDIR)/$(CONFIG)/test/core/end2end/fixtures/h2_loadreporting.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 $(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_loadreporting_test: $(H2_LOADREPORTING_TEST_OBJS:.o=.dep) deps_h2_load_reporting_test: $(H2_LOAD_REPORTING_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true) ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true) ifneq ($(NO_DEPS),true)
-include $(H2_LOADREPORTING_TEST_OBJS:.o=.dep) -include $(H2_LOAD_REPORTING_TEST_OBJS:.o=.dep)
endif endif
endif endif
@ -14601,23 +14603,23 @@ ifneq ($(NO_DEPS),true)
endif endif
H2_LOADREPORTING_NOSEC_TEST_SRC = \ H2_LOAD_REPORTING_NOSEC_TEST_SRC = \
test/core/end2end/fixtures/h2_loadreporting.c \ test/core/end2end/fixtures/h2_load_reporting.c \
H2_LOADREPORTING_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOADREPORTING_NOSEC_TEST_SRC)))) H2_LOAD_REPORTING_NOSEC_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(H2_LOAD_REPORTING_NOSEC_TEST_SRC))))
$(BINDIR)/$(CONFIG)/h2_loadreporting_nosec_test: $(H2_LOADREPORTING_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 $(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 $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(H2_LOADREPORTING_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_loadreporting_nosec_test $(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_loadreporting.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 $(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_loadreporting_nosec_test: $(H2_LOADREPORTING_NOSEC_TEST_OBJS:.o=.dep) deps_h2_load_reporting_nosec_test: $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS:.o=.dep)
ifneq ($(NO_DEPS),true) ifneq ($(NO_DEPS),true)
-include $(H2_LOADREPORTING_NOSEC_TEST_OBJS:.o=.dep) -include $(H2_LOAD_REPORTING_NOSEC_TEST_OBJS:.o=.dep)
endif endif

@ -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, static void client_destroy_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem, grpc_call_element *elem,
const grpc_call_stats *stats, const grpc_call_final_info *final_info,
void *ignored) { void *ignored) {
call_data *d = elem->call_data; call_data *d = elem->call_data;
GPR_ASSERT(d != NULL); 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, static void server_destroy_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem, grpc_call_element *elem,
const grpc_call_stats *stats, const grpc_call_final_info *final_info,
void *ignored) { void *ignored) {
call_data *d = elem->call_data; call_data *d = elem->call_data;
GPR_ASSERT(d != NULL); GPR_ASSERT(d != NULL);

@ -444,7 +444,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
/* Destructor for call_data */ /* Destructor for call_data */
static void destroy_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, const grpc_call_final_info *final_info,
void *and_free_memory) { void *and_free_memory) {
grpc_subchannel_call_holder_destroy(exec_ctx, elem->call_data); grpc_subchannel_call_holder_destroy(exec_ctx, elem->call_data);
gpr_free(and_free_memory); gpr_free(and_free_memory);

@ -42,42 +42,12 @@
#include "src/core/lib/channel/channel_stack_builder.h" #include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/surface/channel_init.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 *lrc =
gpr_malloc(sizeof(grpc_load_reporting_config));
lrc->fn = fn;
lrc->user_data = user_data;
return lrc;
}
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 *lrc) {
gpr_free(lrc);
}
void grpc_load_reporting_config_call(
grpc_load_reporting_config *lrc,
const grpc_load_reporting_call_data *call_data) {
lrc->fn(call_data, lrc->user_data);
}
static bool is_load_reporting_enabled(const grpc_channel_args *a) { static bool is_load_reporting_enabled(const grpc_channel_args *a) {
if (a == NULL) return false; if (a == NULL) return false;
for (size_t i = 0; i < a->num_args; i++) { for (size_t i = 0; i < a->num_args; i++) {
if (0 == strcmp(a->args[i].key, GRPC_ARG_ENABLE_LOAD_REPORTING)) { if (0 == strcmp(a->args[i].key, GRPC_ARG_ENABLE_LOAD_REPORTING)) {
return a->args[i].type == GRPC_ARG_POINTER && return a->args[i].type == GRPC_ARG_INTEGER &&
a->args[i].value.pointer.p != NULL; a->args[i].value.integer != 0;
} }
} }
return false; return false;
@ -94,37 +64,17 @@ static bool maybe_add_load_reporting_filter(grpc_channel_stack_builder *builder,
return true; return true;
} }
static void lrd_arg_destroy(void *p) { grpc_load_reporting_config_destroy(p); } grpc_arg grpc_load_reporting_enable_arg() {
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 *lrc) {
grpc_arg arg; grpc_arg arg;
arg.type = GRPC_ARG_POINTER; arg.type = GRPC_ARG_INTEGER;
arg.key = GRPC_ARG_ENABLE_LOAD_REPORTING; arg.key = GRPC_ARG_ENABLE_LOAD_REPORTING;
arg.value.pointer.p = lrc; arg.value.integer = 1;
arg.value.pointer.vtable = &lrd_ptr_vtable;
return arg; return arg;
} }
/* Plugin registration */ /* Plugin registration */
void grpc_load_reporting_plugin_init(void) { 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, grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX,
maybe_add_load_reporting_filter, maybe_add_load_reporting_filter,
(void *)&grpc_load_reporting_filter); (void *)&grpc_load_reporting_filter);

@ -34,42 +34,47 @@
#ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H #ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H
#define 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 <grpc/impl/codegen/grpc_types.h>
#include "src/core/lib/surface/call.h" #include "src/core/lib/channel/channel_stack.h"
typedef struct grpc_load_reporting_config grpc_load_reporting_config; /** 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"
/** Call information to be passed to the provided load reporting function upon /** Metadata key for trailing metadata from servers */
* completion of the call */ /* TODO(dgq): change to the final value TBD */
typedef struct grpc_load_reporting_call_data { #define GRPC_LOAD_REPORTING_TRAILING_MD_KEY "load-reporting-trailing"
const grpc_call_stats *stats; /**< Stats for the call */
const char *trailing_md_string; /**< LR trailing metadata info */
} grpc_load_reporting_call_data;
/** Custom function to be called by the load reporting filter. */ /** Identifiers for the invocation point of the users LR callback */
typedef void (*grpc_load_reporting_fn)( typedef enum grpc_load_reporting_source {
const grpc_load_reporting_call_data *call_data, void *user_data); 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;
/** Register \a fn as the function to be invoked by the load reporting filter. /** Call information to be passed to the provided LR callback. */
* \a fn will be invoked at the beginning and at the end of the call. typedef struct grpc_load_reporting_call_data {
* const grpc_load_reporting_source source; /**< point of last data update. */
* For the first invocation, \a fn's first argument
* (grpc_load_reporting_call_data*) will be NULL. \a user_data is always passed /** Unique identifier for the channel associated with the data */
* as-is. */ intptr_t channel_id;
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( /** Unique identifier for the call associated with the data. If the call
grpc_load_reporting_config *src); * hasn't been created yet, it'll have a value of zero. */
intptr_t call_id;
void grpc_load_reporting_config_destroy(grpc_load_reporting_config *lrc); /** 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;
/** Invoke the function registered by \a grpc_load_reporting_init. */ const char *initial_md_string; /**< value string for LR's initial md key */
void grpc_load_reporting_config_call( const char *trailing_md_string; /**< value string for LR's trailing md key */
grpc_load_reporting_config *lrc, const char *method_name; /**< Corresponds to :path header */
const grpc_load_reporting_call_data *call_data); } grpc_load_reporting_call_data;
/** Return a \a grpc_arg enabling load reporting */ /** Return a \a grpc_arg enabling load reporting */
grpc_arg grpc_load_reporting_config_create_arg(grpc_load_reporting_config *lrc); grpc_arg grpc_load_reporting_enable_arg();
#endif /* GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H */ #endif /* GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_H */

@ -31,6 +31,7 @@
* *
*/ */
#include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
@ -42,17 +43,67 @@
#include "src/core/lib/profiling/timers.h" #include "src/core/lib/profiling/timers.h"
#include "src/core/lib/transport/static_metadata.h" #include "src/core/lib/transport/static_metadata.h"
typedef struct call_data { const char *trailing_md_string; } call_data; typedef struct call_data {
intptr_t id; /**< an id unique to the call */
char *trailing_md_string;
char *initial_md_string;
const char *service_method;
/* 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 { typedef struct channel_data {
gpr_mu mu; intptr_t id; /**< an id unique to the channel */
grpc_load_reporting_config *lrc;
} channel_data; } channel_data;
static void invoke_lr_fn_locked(grpc_load_reporting_config *lrc, typedef struct {
grpc_load_reporting_call_data *lr_call_data) { grpc_call_element *elem;
GPR_TIMER_BEGIN("load_reporting_config_fn", 0); grpc_exec_ctx *exec_ctx;
grpc_load_reporting_config_call(lrc, lr_call_data); } recv_md_filter_args;
GPR_TIMER_END("load_reporting_config_fn", 0);
static grpc_mdelem *recv_md_filter(void *user_data, grpc_mdelem *md) {
recv_md_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) {
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);
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 */ /* Constructor for call_data */
@ -60,20 +111,41 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_call_element_args *args) { grpc_call_element_args *args) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
memset(calld, 0, sizeof(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,
NULL,
NULL,
NULL,
NULL};
*/
} }
/* Destructor for call_data */ /* Destructor for call_data */
static void destroy_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,
channel_data *chand = elem->channel_data; void *ignored) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
grpc_load_reporting_call_data lr_call_data = {stats, /* TODO(dgq): do something with the data
calld->trailing_md_string}; channel_data *chand = elem->channel_data;
grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CALL_DESTRUCTION,
gpr_mu_lock(&chand->mu); (intptr_t)chand->id,
invoke_lr_fn_locked(chand->lrc, &lr_call_data); (intptr_t)calld->id,
gpr_mu_unlock(&chand->mu); final_info,
calld->initial_md_string,
calld->trailing_md_string,
calld->service_method};
*/
gpr_free(calld->initial_md_string);
gpr_free(calld->trailing_md_string);
} }
/* Constructor for channel_data */ /* Constructor for channel_data */
@ -85,37 +157,40 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx,
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
memset(chand, 0, sizeof(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, /* TODO(dgq): do something with the data
GRPC_ARG_ENABLE_LOAD_REPORTING)) { grpc_load_reporting_call_data lr_call_data = {GRPC_LR_POINT_CHANNEL_CREATION,
grpc_load_reporting_config *arg_lrc = (intptr_t)chand,
args->channel_args->args[i].value.pointer.p; 0,
chand->lrc = grpc_load_reporting_config_copy(arg_lrc); NULL,
GPR_ASSERT(chand->lrc != NULL); NULL,
break; NULL,
} NULL};
} */
GPR_ASSERT(chand->lrc != NULL); /* arg actually found */
gpr_mu_lock(&chand->mu);
invoke_lr_fn_locked(chand->lrc, NULL);
gpr_mu_unlock(&chand->mu);
} }
/* Destructor for channel data */ /* Destructor for channel data */
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) { grpc_channel_element *elem) {
/* TODO(dgq): do something with the data
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
gpr_mu_destroy(&chand->mu); grpc_load_reporting_call_data lr_call_data = {
grpc_load_reporting_config_destroy(chand->lrc); GRPC_LR_POINT_CHANNEL_DESTRUCTION,
(intptr_t)chand->id,
0,
NULL,
NULL,
NULL,
NULL};
*/
} }
static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) { static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) {
grpc_call_element *elem = user_data; grpc_call_element *elem = user_data;
call_data *calld = elem->call_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)); calld->trailing_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value));
return NULL; return NULL;
} }
@ -127,8 +202,14 @@ static void lr_start_transport_stream_op(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem, grpc_call_element *elem,
grpc_transport_stream_op *op) { grpc_transport_stream_op *op) {
GPR_TIMER_BEGIN("lr_start_transport_stream_op", 0); 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) {
calld->recv_initial_metadata = op->recv_initial_metadata;
/* 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, grpc_metadata_batch_filter(op->send_trailing_metadata,
lr_trailing_md_filter, elem); lr_trailing_md_filter, elem);
} }

@ -34,6 +34,7 @@
#ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H #ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H
#define 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" #include "src/core/lib/channel/channel_stack.h"
extern const grpc_channel_filter grpc_load_reporting_filter; extern const grpc_channel_filter grpc_load_reporting_filter;

@ -202,6 +202,7 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx,
GPR_TIMER_BEGIN("finalize_outbuf", 0); GPR_TIMER_BEGIN("finalize_outbuf", 0);
bool is_first_data_frame = true;
while ( while (
grpc_chttp2_list_pop_writing_stream(transport_writing, &stream_writing)) { grpc_chttp2_list_pop_writing_stream(transport_writing, &stream_writing)) {
uint32_t max_outgoing = uint32_t max_outgoing =
@ -266,6 +267,11 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx,
stream_writing->id, &stream_writing->flow_controlled_buffer, stream_writing->id, &stream_writing->flow_controlled_buffer,
send_bytes, is_last_frame, &stream_writing->stats, send_bytes, is_last_frame, &stream_writing->stats,
&transport_writing->outbuf); &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;
}
GRPC_CHTTP2_FLOW_DEBIT_STREAM("write", transport_writing, GRPC_CHTTP2_FLOW_DEBIT_STREAM("write", transport_writing,
stream_writing, outgoing_window, stream_writing, outgoing_window,
send_bytes); send_bytes);

@ -217,7 +217,7 @@ void grpc_call_stack_ignore_set_pollset_or_pollset_set(
grpc_polling_entity *pollent) {} grpc_polling_entity *pollent) {}
void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *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) { void *and_free_memory) {
grpc_call_element *elems = CALL_ELEMS_FROM_STACK(stack); grpc_call_element *elems = CALL_ELEMS_FROM_STACK(stack);
size_t count = stack->count; 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 */ /* destroy per-filter data */
for (i = 0; i < count; i++) { 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); i == count - 1 ? and_free_memory : NULL);
} }
} }

@ -75,9 +75,14 @@ typedef struct {
typedef struct { typedef struct {
grpc_transport_stream_stats transport_stream_stats; grpc_transport_stream_stats transport_stream_stats;
gpr_timespec latency; /* From call creating to enqueing of received status */ gpr_timespec latency; /* From call creating to enqueing of received status */
grpc_status_code final_status;
} grpc_call_stats; } grpc_call_stats;
/** Information about the call upon completion. */
typedef struct {
grpc_call_stats stats;
grpc_status_code final_status;
} grpc_call_final_info;
/* Channel filters specify: /* Channel filters specify:
1. the amount of memory needed in the channel & call (via the sizeof_XXX 1. the amount of memory needed in the channel & call (via the sizeof_XXX
members) members)
@ -119,16 +124,17 @@ typedef struct {
The filter does not need to do any chaining. The filter does not need to do any chaining.
The bottom filter of a stack will be passed a non-NULL pointer to 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 \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 call, mainly
for reporting purposes. */
void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, 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); void *and_free_memory);
/* sizeof(per channel data) */ /* sizeof(per channel data) */
size_t sizeof_channel_data; size_t sizeof_channel_data;
/* Initialize per-channel data. /* Initialize per-channel data.
elem is initialized at the start of the call, and elem->channel_data is elem is initialized at the creating of the channel, and elem->channel_data
what needs initializing. is what needs initializing.
is_first, is_last designate this elements position in the stack, and are is_first, is_last designate this elements position in the stack, and are
useful for asserting correct configuration by upper layer code. useful for asserting correct configuration by upper layer code.
The filter does not need to do any chaining */ The filter does not need to do any chaining */
@ -243,7 +249,7 @@ void grpc_call_stack_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
/* Destroy a call stack */ /* Destroy a call stack */
void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *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); void *and_free_memory);
/* Ignore set pollset{_set} - used by filters if they don't care about pollsets /* Ignore set pollset{_set} - used by filters if they don't care about pollsets

@ -270,7 +270,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
/* Destructor for call_data */ /* Destructor for call_data */
static void destroy_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) {
/* grab pointers to our data from the call element */ /* grab pointers to our data from the call element */
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
gpr_slice_buffer_destroy(&calld->slices); gpr_slice_buffer_destroy(&calld->slices);

@ -104,7 +104,7 @@ static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
/* Destructor for call_data */ /* Destructor for call_data */
static void destroy_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, const grpc_call_final_info *final_info,
void *and_free_memory) { void *and_free_memory) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;

@ -184,7 +184,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
/* Destructor for call_data */ /* Destructor for call_data */
static void destroy_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) {}
static grpc_mdelem *scheme_from_args(const grpc_channel_args *args) { static grpc_mdelem *scheme_from_args(const grpc_channel_args *args) {
unsigned i; unsigned i;

@ -235,7 +235,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
/* Destructor for call_data */ /* Destructor for call_data */
static void destroy_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) {}
/* Constructor for channel_data */ /* Constructor for channel_data */
static void init_channel_elem(grpc_exec_ctx *exec_ctx, static void init_channel_elem(grpc_exec_ctx *exec_ctx,

@ -282,7 +282,8 @@ static void set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
/* Destructor for call_data */ /* Destructor for call_data */
static void destroy_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) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
grpc_call_credentials_unref(calld->creds); grpc_call_credentials_unref(calld->creds);
if (calld->host != NULL) { if (calld->host != NULL) {

@ -226,7 +226,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
/* Destructor for call_data */ /* Destructor for call_data */
static void destroy_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) {}
/* Constructor for channel_data */ /* Constructor for channel_data */
static void init_channel_elem(grpc_exec_ctx *exec_ctx, static void init_channel_elem(grpc_exec_ctx *exec_ctx,

@ -154,8 +154,9 @@ struct grpc_call {
/* Received call statuses from various sources */ /* Received call statuses from various sources */
received_status status[STATUS_SOURCE_COUNT]; received_status status[STATUS_SOURCE_COUNT];
/* Call stats: only valid after trailing metadata received */ /* Call data useful used for reporting. Only valid after the call has
grpc_call_stats stats; * completed */
grpc_call_final_info final_info;
/* Compression algorithm for *incoming* data */ /* Compression algorithm for *incoming* data */
grpc_compression_algorithm incoming_compression_algorithm; grpc_compression_algorithm incoming_compression_algorithm;
@ -361,6 +362,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); 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, static void destroy_call(grpc_exec_ctx *exec_ctx, void *call,
grpc_error *error) { grpc_error *error) {
size_t i; size_t i;
@ -392,7 +412,11 @@ static void destroy_call(grpc_exec_ctx *exec_ctx, void *call,
GRPC_CQ_INTERNAL_UNREF(c->cq, "bind"); GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
} }
grpc_channel *channel = c->channel; 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"); GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, "call");
GPR_TIMER_END("destroy_call", 0); GPR_TIMER_END("destroy_call", 0);
} }
@ -414,24 +438,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, static void set_status_from_error(grpc_call *call, status_source source,
grpc_error *error) { grpc_error *error) {
intptr_t status; intptr_t status;
@ -1608,7 +1614,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
bctl->recv_final_op = 1; bctl->recv_final_op = 1;
stream_op.recv_trailing_metadata = stream_op.recv_trailing_metadata =
&call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */]; &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; break;
case GRPC_OP_RECV_CLOSE_ON_SERVER: case GRPC_OP_RECV_CLOSE_ON_SERVER:
/* Flag validation: currently allow no flags */ /* Flag validation: currently allow no flags */
@ -1630,7 +1637,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
bctl->recv_final_op = 1; bctl->recv_final_op = 1;
stream_op.recv_trailing_metadata = stream_op.recv_trailing_metadata =
&call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */]; &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; break;
} }
} }

@ -111,7 +111,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_call_element_args *args) {} grpc_call_element_args *args) {}
static void destroy_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, const grpc_call_final_info *final_info,
void *and_free_memory) { void *and_free_memory) {
gpr_free(and_free_memory); gpr_free(and_free_memory);
} }

@ -872,7 +872,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, 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; channel_data *chand = elem->channel_data;
call_data *calld = elem->call_data; call_data *calld = elem->call_data;

@ -45,10 +45,10 @@ grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT];
grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT]; grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];
uintptr_t grpc_static_mdelem_user_data[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, 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, 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, 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] = 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, {11, 35, 10, 35, 12, 35, 12, 49, 13, 35, 14, 35, 15, 35, 16, 35, 17, 35,
@ -56,10 +56,10 @@ const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2] =
30, 18, 30, 35, 31, 35, 32, 35, 36, 35, 37, 35, 38, 35, 39, 35, 42, 33, 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, 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, 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, 62, 35, 63, 35, 64, 35, 65, 35, 66, 35, 67, 35, 68, 40, 68, 70, 68, 73,
68, 81, 70, 35, 71, 35, 73, 35, 74, 35, 75, 35, 76, 35, 77, 41, 77, 51, 69, 81, 69, 82, 71, 35, 72, 35, 74, 35, 75, 35, 76, 35, 77, 35, 78, 41,
77, 52, 78, 35, 79, 35, 82, 3, 82, 4, 82, 5, 82, 6, 82, 7, 82, 8, 78, 51, 78, 52, 79, 35, 80, 35, 83, 3, 83, 4, 83, 5, 83, 6, 83, 7,
82, 9, 83, 35, 84, 85, 86, 35, 87, 35, 88, 35, 89, 35, 90, 35}; 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] = { const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = {
"0", "0",
@ -126,7 +126,8 @@ const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = {
"if-unmodified-since", "if-unmodified-since",
"last-modified", "last-modified",
"link", "link",
"load-reporting", "load-reporting-initial",
"load-reporting-trailing",
"location", "location",
"max-forwards", "max-forwards",
":method", ":method",

@ -44,7 +44,7 @@
#include "src/core/lib/transport/metadata.h" #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]; extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT];
/* "0" */ /* "0" */
#define GRPC_MDSTR_0 (&grpc_static_mdstr_table[0]) #define GRPC_MDSTR_0 (&grpc_static_mdstr_table[0])
@ -175,62 +175,64 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT];
#define GRPC_MDSTR_LAST_MODIFIED (&grpc_static_mdstr_table[62]) #define GRPC_MDSTR_LAST_MODIFIED (&grpc_static_mdstr_table[62])
/* "link" */ /* "link" */
#define GRPC_MDSTR_LINK (&grpc_static_mdstr_table[63]) #define GRPC_MDSTR_LINK (&grpc_static_mdstr_table[63])
/* "load-reporting" */ /* "load-reporting-initial" */
#define GRPC_MDSTR_LOAD_REPORTING (&grpc_static_mdstr_table[64]) #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" */ /* "location" */
#define GRPC_MDSTR_LOCATION (&grpc_static_mdstr_table[65]) #define GRPC_MDSTR_LOCATION (&grpc_static_mdstr_table[66])
/* "max-forwards" */ /* "max-forwards" */
#define GRPC_MDSTR_MAX_FORWARDS (&grpc_static_mdstr_table[66]) #define GRPC_MDSTR_MAX_FORWARDS (&grpc_static_mdstr_table[67])
/* ":method" */ /* ":method" */
#define GRPC_MDSTR_METHOD (&grpc_static_mdstr_table[67]) #define GRPC_MDSTR_METHOD (&grpc_static_mdstr_table[68])
/* ":path" */ /* ":path" */
#define GRPC_MDSTR_PATH (&grpc_static_mdstr_table[68]) #define GRPC_MDSTR_PATH (&grpc_static_mdstr_table[69])
/* "POST" */ /* "POST" */
#define GRPC_MDSTR_POST (&grpc_static_mdstr_table[69]) #define GRPC_MDSTR_POST (&grpc_static_mdstr_table[70])
/* "proxy-authenticate" */ /* "proxy-authenticate" */
#define GRPC_MDSTR_PROXY_AUTHENTICATE (&grpc_static_mdstr_table[70]) #define GRPC_MDSTR_PROXY_AUTHENTICATE (&grpc_static_mdstr_table[71])
/* "proxy-authorization" */ /* "proxy-authorization" */
#define GRPC_MDSTR_PROXY_AUTHORIZATION (&grpc_static_mdstr_table[71]) #define GRPC_MDSTR_PROXY_AUTHORIZATION (&grpc_static_mdstr_table[72])
/* "PUT" */ /* "PUT" */
#define GRPC_MDSTR_PUT (&grpc_static_mdstr_table[72]) #define GRPC_MDSTR_PUT (&grpc_static_mdstr_table[73])
/* "range" */ /* "range" */
#define GRPC_MDSTR_RANGE (&grpc_static_mdstr_table[73]) #define GRPC_MDSTR_RANGE (&grpc_static_mdstr_table[74])
/* "referer" */ /* "referer" */
#define GRPC_MDSTR_REFERER (&grpc_static_mdstr_table[74]) #define GRPC_MDSTR_REFERER (&grpc_static_mdstr_table[75])
/* "refresh" */ /* "refresh" */
#define GRPC_MDSTR_REFRESH (&grpc_static_mdstr_table[75]) #define GRPC_MDSTR_REFRESH (&grpc_static_mdstr_table[76])
/* "retry-after" */ /* "retry-after" */
#define GRPC_MDSTR_RETRY_AFTER (&grpc_static_mdstr_table[76]) #define GRPC_MDSTR_RETRY_AFTER (&grpc_static_mdstr_table[77])
/* ":scheme" */ /* ":scheme" */
#define GRPC_MDSTR_SCHEME (&grpc_static_mdstr_table[77]) #define GRPC_MDSTR_SCHEME (&grpc_static_mdstr_table[78])
/* "server" */ /* "server" */
#define GRPC_MDSTR_SERVER (&grpc_static_mdstr_table[78]) #define GRPC_MDSTR_SERVER (&grpc_static_mdstr_table[79])
/* "set-cookie" */ /* "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" */ /* "/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" */ /* ":status" */
#define GRPC_MDSTR_STATUS (&grpc_static_mdstr_table[82]) #define GRPC_MDSTR_STATUS (&grpc_static_mdstr_table[83])
/* "strict-transport-security" */ /* "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" */ /* "te" */
#define GRPC_MDSTR_TE (&grpc_static_mdstr_table[84]) #define GRPC_MDSTR_TE (&grpc_static_mdstr_table[85])
/* "trailers" */ /* "trailers" */
#define GRPC_MDSTR_TRAILERS (&grpc_static_mdstr_table[85]) #define GRPC_MDSTR_TRAILERS (&grpc_static_mdstr_table[86])
/* "transfer-encoding" */ /* "transfer-encoding" */
#define GRPC_MDSTR_TRANSFER_ENCODING (&grpc_static_mdstr_table[86]) #define GRPC_MDSTR_TRANSFER_ENCODING (&grpc_static_mdstr_table[87])
/* "user-agent" */ /* "user-agent" */
#define GRPC_MDSTR_USER_AGENT (&grpc_static_mdstr_table[87]) #define GRPC_MDSTR_USER_AGENT (&grpc_static_mdstr_table[88])
/* "vary" */ /* "vary" */
#define GRPC_MDSTR_VARY (&grpc_static_mdstr_table[88]) #define GRPC_MDSTR_VARY (&grpc_static_mdstr_table[89])
/* "via" */ /* "via" */
#define GRPC_MDSTR_VIA (&grpc_static_mdstr_table[89]) #define GRPC_MDSTR_VIA (&grpc_static_mdstr_table[90])
/* "www-authenticate" */ /* "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 grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];
extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];
/* "accept-charset": "" */ /* "accept-charset": "" */
@ -335,73 +337,76 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];
#define GRPC_MDELEM_LAST_MODIFIED_EMPTY (&grpc_static_mdelem_table[45]) #define GRPC_MDELEM_LAST_MODIFIED_EMPTY (&grpc_static_mdelem_table[45])
/* "link": "" */ /* "link": "" */
#define GRPC_MDELEM_LINK_EMPTY (&grpc_static_mdelem_table[46]) #define GRPC_MDELEM_LINK_EMPTY (&grpc_static_mdelem_table[46])
/* "load-reporting": "" */ /* "load-reporting-initial": "" */
#define GRPC_MDELEM_LOAD_REPORTING_EMPTY (&grpc_static_mdelem_table[47]) #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": "" */ /* "location": "" */
#define GRPC_MDELEM_LOCATION_EMPTY (&grpc_static_mdelem_table[48]) #define GRPC_MDELEM_LOCATION_EMPTY (&grpc_static_mdelem_table[49])
/* "max-forwards": "" */ /* "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" */ /* ":method": "GET" */
#define GRPC_MDELEM_METHOD_GET (&grpc_static_mdelem_table[50]) #define GRPC_MDELEM_METHOD_GET (&grpc_static_mdelem_table[51])
/* ":method": "POST" */ /* ":method": "POST" */
#define GRPC_MDELEM_METHOD_POST (&grpc_static_mdelem_table[51]) #define GRPC_MDELEM_METHOD_POST (&grpc_static_mdelem_table[52])
/* ":method": "PUT" */ /* ":method": "PUT" */
#define GRPC_MDELEM_METHOD_PUT (&grpc_static_mdelem_table[52]) #define GRPC_MDELEM_METHOD_PUT (&grpc_static_mdelem_table[53])
/* ":path": "/" */ /* ":path": "/" */
#define GRPC_MDELEM_PATH_SLASH (&grpc_static_mdelem_table[53]) #define GRPC_MDELEM_PATH_SLASH (&grpc_static_mdelem_table[54])
/* ":path": "/index.html" */ /* ":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": "" */ /* "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": "" */ /* "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": "" */ /* "range": "" */
#define GRPC_MDELEM_RANGE_EMPTY (&grpc_static_mdelem_table[57]) #define GRPC_MDELEM_RANGE_EMPTY (&grpc_static_mdelem_table[58])
/* "referer": "" */ /* "referer": "" */
#define GRPC_MDELEM_REFERER_EMPTY (&grpc_static_mdelem_table[58]) #define GRPC_MDELEM_REFERER_EMPTY (&grpc_static_mdelem_table[59])
/* "refresh": "" */ /* "refresh": "" */
#define GRPC_MDELEM_REFRESH_EMPTY (&grpc_static_mdelem_table[59]) #define GRPC_MDELEM_REFRESH_EMPTY (&grpc_static_mdelem_table[60])
/* "retry-after": "" */ /* "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" */ /* ":scheme": "grpc" */
#define GRPC_MDELEM_SCHEME_GRPC (&grpc_static_mdelem_table[61]) #define GRPC_MDELEM_SCHEME_GRPC (&grpc_static_mdelem_table[62])
/* ":scheme": "http" */ /* ":scheme": "http" */
#define GRPC_MDELEM_SCHEME_HTTP (&grpc_static_mdelem_table[62]) #define GRPC_MDELEM_SCHEME_HTTP (&grpc_static_mdelem_table[63])
/* ":scheme": "https" */ /* ":scheme": "https" */
#define GRPC_MDELEM_SCHEME_HTTPS (&grpc_static_mdelem_table[63]) #define GRPC_MDELEM_SCHEME_HTTPS (&grpc_static_mdelem_table[64])
/* "server": "" */ /* "server": "" */
#define GRPC_MDELEM_SERVER_EMPTY (&grpc_static_mdelem_table[64]) #define GRPC_MDELEM_SERVER_EMPTY (&grpc_static_mdelem_table[65])
/* "set-cookie": "" */ /* "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" */ /* ":status": "200" */
#define GRPC_MDELEM_STATUS_200 (&grpc_static_mdelem_table[66]) #define GRPC_MDELEM_STATUS_200 (&grpc_static_mdelem_table[67])
/* ":status": "204" */ /* ":status": "204" */
#define GRPC_MDELEM_STATUS_204 (&grpc_static_mdelem_table[67]) #define GRPC_MDELEM_STATUS_204 (&grpc_static_mdelem_table[68])
/* ":status": "206" */ /* ":status": "206" */
#define GRPC_MDELEM_STATUS_206 (&grpc_static_mdelem_table[68]) #define GRPC_MDELEM_STATUS_206 (&grpc_static_mdelem_table[69])
/* ":status": "304" */ /* ":status": "304" */
#define GRPC_MDELEM_STATUS_304 (&grpc_static_mdelem_table[69]) #define GRPC_MDELEM_STATUS_304 (&grpc_static_mdelem_table[70])
/* ":status": "400" */ /* ":status": "400" */
#define GRPC_MDELEM_STATUS_400 (&grpc_static_mdelem_table[70]) #define GRPC_MDELEM_STATUS_400 (&grpc_static_mdelem_table[71])
/* ":status": "404" */ /* ":status": "404" */
#define GRPC_MDELEM_STATUS_404 (&grpc_static_mdelem_table[71]) #define GRPC_MDELEM_STATUS_404 (&grpc_static_mdelem_table[72])
/* ":status": "500" */ /* ":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": "" */ /* "strict-transport-security": "" */
#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \ #define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \
(&grpc_static_mdelem_table[73]) (&grpc_static_mdelem_table[74])
/* "te": "trailers" */ /* "te": "trailers" */
#define GRPC_MDELEM_TE_TRAILERS (&grpc_static_mdelem_table[74]) #define GRPC_MDELEM_TE_TRAILERS (&grpc_static_mdelem_table[75])
/* "transfer-encoding": "" */ /* "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": "" */ /* "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": "" */ /* "vary": "" */
#define GRPC_MDELEM_VARY_EMPTY (&grpc_static_mdelem_table[77]) #define GRPC_MDELEM_VARY_EMPTY (&grpc_static_mdelem_table[78])
/* "via": "" */ /* "via": "" */
#define GRPC_MDELEM_VIA_EMPTY (&grpc_static_mdelem_table[78]) #define GRPC_MDELEM_VIA_EMPTY (&grpc_static_mdelem_table[79])
/* "www-authenticate": "" */ /* "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 extern const uint8_t
grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2]; grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2];

@ -63,7 +63,8 @@ static void channel_destroy_func(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {} grpc_channel_element *elem) {}
static void call_destroy_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, static void call_destroy_func(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) {
++*(int *)(elem->channel_data); ++*(int *)(elem->channel_data);
} }

@ -83,6 +83,8 @@ extern void invoke_large_request(grpc_end2end_test_config config);
extern void invoke_large_request_pre_init(void); extern void invoke_large_request_pre_init(void);
extern void large_metadata(grpc_end2end_test_config config); extern void large_metadata(grpc_end2end_test_config config);
extern void large_metadata_pre_init(void); extern void large_metadata_pre_init(void);
extern void load_reporting_hook(grpc_end2end_test_config config);
extern void load_reporting_hook_pre_init(void);
extern void max_concurrent_streams(grpc_end2end_test_config config); extern void max_concurrent_streams(grpc_end2end_test_config config);
extern void max_concurrent_streams_pre_init(void); extern void max_concurrent_streams_pre_init(void);
extern void max_message_length(grpc_end2end_test_config config); extern void max_message_length(grpc_end2end_test_config config);
@ -145,6 +147,7 @@ void grpc_end2end_tests_pre_init(void) {
idempotent_request_pre_init(); idempotent_request_pre_init();
invoke_large_request_pre_init(); invoke_large_request_pre_init();
large_metadata_pre_init(); large_metadata_pre_init();
load_reporting_hook_pre_init();
max_concurrent_streams_pre_init(); max_concurrent_streams_pre_init();
max_message_length_pre_init(); max_message_length_pre_init();
negative_deadline_pre_init(); negative_deadline_pre_init();
@ -193,6 +196,7 @@ void grpc_end2end_tests(int argc, char **argv,
idempotent_request(config); idempotent_request(config);
invoke_large_request(config); invoke_large_request(config);
large_metadata(config); large_metadata(config);
load_reporting_hook(config);
max_concurrent_streams(config); max_concurrent_streams(config);
max_message_length(config); max_message_length(config);
negative_deadline(config); negative_deadline(config);
@ -296,6 +300,10 @@ void grpc_end2end_tests(int argc, char **argv,
large_metadata(config); large_metadata(config);
continue; continue;
} }
if (0 == strcmp("load_reporting_hook", argv[i])) {
load_reporting_hook(config);
continue;
}
if (0 == strcmp("max_concurrent_streams", argv[i])) { if (0 == strcmp("max_concurrent_streams", argv[i])) {
max_concurrent_streams(config); max_concurrent_streams(config);
continue; continue;

@ -85,6 +85,8 @@ extern void invoke_large_request(grpc_end2end_test_config config);
extern void invoke_large_request_pre_init(void); extern void invoke_large_request_pre_init(void);
extern void large_metadata(grpc_end2end_test_config config); extern void large_metadata(grpc_end2end_test_config config);
extern void large_metadata_pre_init(void); extern void large_metadata_pre_init(void);
extern void load_reporting_hook(grpc_end2end_test_config config);
extern void load_reporting_hook_pre_init(void);
extern void max_concurrent_streams(grpc_end2end_test_config config); extern void max_concurrent_streams(grpc_end2end_test_config config);
extern void max_concurrent_streams_pre_init(void); extern void max_concurrent_streams_pre_init(void);
extern void max_message_length(grpc_end2end_test_config config); extern void max_message_length(grpc_end2end_test_config config);
@ -148,6 +150,7 @@ void grpc_end2end_tests_pre_init(void) {
idempotent_request_pre_init(); idempotent_request_pre_init();
invoke_large_request_pre_init(); invoke_large_request_pre_init();
large_metadata_pre_init(); large_metadata_pre_init();
load_reporting_hook_pre_init();
max_concurrent_streams_pre_init(); max_concurrent_streams_pre_init();
max_message_length_pre_init(); max_message_length_pre_init();
negative_deadline_pre_init(); negative_deadline_pre_init();
@ -197,6 +200,7 @@ void grpc_end2end_tests(int argc, char **argv,
idempotent_request(config); idempotent_request(config);
invoke_large_request(config); invoke_large_request(config);
large_metadata(config); large_metadata(config);
load_reporting_hook(config);
max_concurrent_streams(config); max_concurrent_streams(config);
max_message_length(config); max_message_length(config);
negative_deadline(config); negative_deadline(config);
@ -304,6 +308,10 @@ void grpc_end2end_tests(int argc, char **argv,
large_metadata(config); large_metadata(config);
continue; continue;
} }
if (0 == strcmp("load_reporting_hook", argv[i])) {
load_reporting_hook(config);
continue;
}
if (0 == strcmp("max_concurrent_streams", argv[i])) { if (0 == strcmp("max_concurrent_streams", argv[i])) {
max_concurrent_streams(config); max_concurrent_streams(config);
continue; continue;

@ -52,18 +52,16 @@
#include "test/core/util/port.h" #include "test/core/util/port.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
static grpc_load_reporting_config *g_client_lrc; typedef struct load_reporting_fixture_data {
static grpc_load_reporting_config *g_server_lrc;
typedef struct fullstack_fixture_data {
char *localaddr; char *localaddr;
} fullstack_fixture_data; } load_reporting_fixture_data;
static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting(
grpc_channel_args *client_args, grpc_channel_args *server_args) { grpc_channel_args *client_args, grpc_channel_args *server_args) {
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
fullstack_fixture_data *ffd = gpr_malloc(sizeof(fullstack_fixture_data)); load_reporting_fixture_data *ffd =
gpr_malloc(sizeof(load_reporting_fixture_data));
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
@ -74,47 +72,20 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
return f; return f;
} }
typedef struct { void chttp2_init_client_load_reporting(grpc_end2end_test_fixture *f,
int64_t total_bytes; grpc_channel_args *client_args) {
bool fully_processed; load_reporting_fixture_data *ffd = f->fixture_data;
uint32_t initial_token;
uint32_t final_token;
} 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;
if (call_data == NULL) {
/* initial invocation */
custom_stats->initial_token = 0xDEADBEEF;
} else {
/* final invocation */
custom_stats->total_bytes =
(int64_t)(call_data->stats->transport_stream_stats.outgoing.data_bytes +
call_data->stats->transport_stream_stats.incoming.data_bytes);
custom_stats->final_token = 0xCAFED00D;
custom_stats->fully_processed = true;
}
}
void chttp2_init_client_fullstack(grpc_end2end_test_fixture *f,
grpc_channel_args *client_args) {
fullstack_fixture_data *ffd = f->fixture_data;
grpc_arg arg = grpc_load_reporting_config_create_arg(g_client_lrc);
client_args = grpc_channel_args_copy_and_add(client_args, &arg, 1);
f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL); f->client = grpc_insecure_channel_create(ffd->localaddr, client_args, NULL);
grpc_channel_args_destroy(client_args);
GPR_ASSERT(f->client); GPR_ASSERT(f->client);
} }
void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f, void chttp2_init_server_load_reporting(grpc_end2end_test_fixture *f,
grpc_channel_args *server_args) { grpc_channel_args *server_args) {
fullstack_fixture_data *ffd = f->fixture_data; load_reporting_fixture_data *ffd = f->fixture_data;
grpc_arg arg = grpc_load_reporting_enable_arg();
if (f->server) { if (f->server) {
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
} }
grpc_arg arg = grpc_load_reporting_config_create_arg(g_server_lrc);
server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1); server_args = grpc_channel_args_copy_and_add(server_args, &arg, 1);
f->server = grpc_server_create(server_args, NULL); f->server = grpc_server_create(server_args, NULL);
grpc_channel_args_destroy(server_args); grpc_channel_args_destroy(server_args);
@ -123,36 +94,23 @@ void chttp2_init_server_fullstack(grpc_end2end_test_fixture *f,
grpc_server_start(f->server); grpc_server_start(f->server);
} }
void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { void chttp2_tear_down_load_reporting(grpc_end2end_test_fixture *f) {
fullstack_fixture_data *ffd = f->fixture_data; load_reporting_fixture_data *ffd = f->fixture_data;
gpr_free(ffd->localaddr); gpr_free(ffd->localaddr);
gpr_free(ffd); gpr_free(ffd);
} }
/* All test configurations */ /* All test configurations */
static grpc_end2end_test_config configs[] = { static grpc_end2end_test_config configs[] = {
{"chttp2/fullstack+loadreporting", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION, {"chttp2/fullstack+load_reporting",
chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION,
chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, 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) { int main(int argc, char **argv) {
size_t i; size_t i;
aggregated_bw_stats *aggr_stats_client =
gpr_malloc(sizeof(aggregated_bw_stats));
aggr_stats_client->total_bytes = -1;
aggr_stats_client->fully_processed = false;
aggregated_bw_stats *aggr_stats_server =
gpr_malloc(sizeof(aggregated_bw_stats));
aggr_stats_server->total_bytes = -1;
aggr_stats_server->fully_processed = false;
g_client_lrc =
grpc_load_reporting_config_create(sample_fn, aggr_stats_client);
g_server_lrc =
grpc_load_reporting_config_create(sample_fn, aggr_stats_server);
grpc_test_init(argc, argv); grpc_test_init(argc, argv);
grpc_end2end_tests_pre_init(); grpc_end2end_tests_pre_init();
grpc_init(); grpc_init();
@ -163,22 +121,5 @@ int main(int argc, char **argv) {
grpc_shutdown(); grpc_shutdown();
grpc_load_reporting_config_destroy(g_client_lrc);
grpc_load_reporting_config_destroy(g_server_lrc);
if (aggr_stats_client->fully_processed) {
GPR_ASSERT(aggr_stats_client->total_bytes >= 0);
GPR_ASSERT(aggr_stats_client->initial_token == 0xDEADBEEF);
GPR_ASSERT(aggr_stats_client->final_token == 0xCAFED00D);
}
if (aggr_stats_server->fully_processed) {
GPR_ASSERT(aggr_stats_server->total_bytes >= 0);
GPR_ASSERT(aggr_stats_server->initial_token == 0xDEADBEEF);
GPR_ASSERT(aggr_stats_server->final_token == 0xCAFED00D);
}
gpr_free(aggr_stats_client);
gpr_free(aggr_stats_server);
return 0; return 0;
} }

@ -63,7 +63,8 @@
"\x13if-unmodified-since" "\x13if-unmodified-since"
"\x0Dlast-modified" "\x0Dlast-modified"
"\x04link" "\x04link"
"\x0Eload-reporting" "\x16load-reporting-initial"
"\x17load-reporting-trailing"
"\x08location" "\x08location"
"\x0Cmax-forwards" "\x0Cmax-forwards"
"\x07:method" "\x07:method"
@ -137,7 +138,8 @@
"\x00\x13if-unmodified-since\x00" "\x00\x13if-unmodified-since\x00"
"\x00\x0Dlast-modified\x00" "\x00\x0Dlast-modified\x00"
"\x00\x04link\x00" "\x00\x04link\x00"
"\x00\x0Eload-reporting\x00" "\x00\x16load-reporting-initial\x00"
"\x00\x17load-reporting-trailing\x00"
"\x00\x08location\x00" "\x00\x08location\x00"
"\x00\x0Cmax-forwards\x00" "\x00\x0Cmax-forwards\x00"
"\x00\x07:method\x03GET" "\x00\x07:method\x03GET"

@ -53,13 +53,13 @@ fd_unsecure_fixture_options = default_unsecure_fixture_options._replace(
END2END_FIXTURES = { END2END_FIXTURES = {
'h2_compress': default_unsecure_fixture_options, 'h2_compress': default_unsecure_fixture_options,
'h2_census': 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_fakesec': default_secure_fixture_options._replace(ci_mac=False),
'h2_fd': fd_unsecure_fixture_options, 'h2_fd': fd_unsecure_fixture_options,
'h2_full': default_unsecure_fixture_options, 'h2_full': default_unsecure_fixture_options,
'h2_full+pipe': default_unsecure_fixture_options._replace( 'h2_full+pipe': default_unsecure_fixture_options._replace(
platforms=['linux']), platforms=['linux']),
'h2_full+trace': default_unsecure_fixture_options._replace(tracing=True), 'h2_full+trace': default_unsecure_fixture_options._replace(tracing=True),
'h2_loadreporting': default_unsecure_fixture_options,
'h2_oauth2': default_secure_fixture_options._replace(ci_mac=False), 'h2_oauth2': default_secure_fixture_options._replace(ci_mac=False),
'h2_proxy': default_unsecure_fixture_options._replace(includes_proxy=True, 'h2_proxy': default_unsecure_fixture_options._replace(includes_proxy=True,
ci_mac=False), ci_mac=False),
@ -115,6 +115,7 @@ END2END_TESTS = {
'network_status_change': default_test_options, 'network_status_change': default_test_options,
'no_op': default_test_options, 'no_op': default_test_options,
'payload': default_test_options, 'payload': default_test_options,
'load_reporting_hook': default_test_options,
'ping_pong_streaming': default_test_options, 'ping_pong_streaming': default_test_options,
'ping': connectivity_test_options._replace(proxyable=False), 'ping': connectivity_test_options._replace(proxyable=False),
'registered_call': default_test_options, 'registered_call': default_test_options,

@ -237,7 +237,7 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_call_element_args *args) {} grpc_call_element_args *args) {}
static void destroy_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, const grpc_call_final_info *final_info,
void *and_free_memory) {} void *and_free_memory) {}
static void init_channel_elem(grpc_exec_ctx *exec_ctx, static void init_channel_elem(grpc_exec_ctx *exec_ctx,

@ -0,0 +1,321 @@
/*
*
* 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 <string.h>
#include <grpc/byte_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#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"
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;
char *initial_md_str;
char *trailing_md_str;
char *method_name;
uint64_t incoming_bytes;
uint64_t outgoing_bytes;
grpc_status_code call_final_status;
bool fully_processed;
} load_reporting_data;
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,
const char *test_name,
grpc_channel_args *client_args,
grpc_channel_args *server_args) {
grpc_end2end_test_fixture f;
gpr_log(GPR_INFO, "%s/%s", test_name, config.name);
f = config.create_fixture(client_args, server_args);
config.init_server(&f, server_args);
config.init_client(&f, client_args);
return f;
}
static gpr_timespec n_seconds_time(int n) {
return GRPC_TIMEOUT_SECONDS_TO_DEADLINE(n);
}
static gpr_timespec five_seconds_time(void) { return n_seconds_time(5); }
static void drain_cq(grpc_completion_queue *cq) {
grpc_event ev;
do {
ev = grpc_completion_queue_next(cq, five_seconds_time(), NULL);
} while (ev.type != GRPC_QUEUE_SHUTDOWN);
}
static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck(
f->cq, tag(1000), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL)
.type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server);
f->server = NULL;
}
static void shutdown_client(grpc_end2end_test_fixture *f) {
if (!f->client) return;
grpc_channel_destroy(f->client);
f->client = NULL;
}
static void end_test(grpc_end2end_test_fixture *f) {
shutdown_server(f);
shutdown_client(f);
grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq);
}
static void request_response_with_payload(grpc_end2end_test_fixture f,
const char *method_name,
const char *request_msg,
const char *response_msg,
grpc_metadata *initial_lr_metadata,
grpc_metadata *trailing_lr_metadata) {
gpr_slice request_payload_slice = gpr_slice_from_static_string(request_msg);
gpr_slice response_payload_slice = gpr_slice_from_static_string(response_msg);
grpc_call *c;
grpc_call *s;
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
grpc_byte_buffer *response_payload =
grpc_raw_byte_buffer_create(&response_payload_slice, 1);
gpr_timespec deadline = five_seconds_time();
cq_verifier *cqv = cq_verifier_create(f.cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
grpc_metadata_array trailing_metadata_recv;
grpc_metadata_array request_metadata_recv;
grpc_byte_buffer *request_payload_recv = NULL;
grpc_byte_buffer *response_payload_recv = NULL;
grpc_call_details call_details;
grpc_status_code status;
grpc_call_error error;
char *details = NULL;
size_t details_capacity = 0;
int was_cancelled = 2;
c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq,
method_name, "foo.test.google.fr", deadline,
NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
grpc_metadata_array_init(&trailing_metadata_recv);
grpc_metadata_array_init(&request_metadata_recv);
grpc_call_details_init(&call_details);
memset(ops, 0, sizeof(ops));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
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++;
op->op = GRPC_OP_SEND_MESSAGE;
op->data.send_message = request_payload;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata = &initial_metadata_recv;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &response_payload_recv;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status;
op->data.recv_status_on_client.status_details = &details;
op->data.recv_status_on_client.status_details_capacity = &details_capacity;
op->flags = 0;
op->reserved = NULL;
op++;
error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL);
GPR_ASSERT(GRPC_CALL_OK == error);
error =
grpc_server_request_call(f.server, &s, &call_details,
&request_metadata_recv, f.cq, f.cq, tag(101));
GPR_ASSERT(GRPC_CALL_OK == error);
cq_expect_completion(cqv, tag(101), 1);
cq_verify(cqv);
memset(ops, 0, sizeof(ops));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 0;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &request_payload_recv;
op->flags = 0;
op->reserved = NULL;
op++;
error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL);
GPR_ASSERT(GRPC_CALL_OK == error);
cq_expect_completion(cqv, tag(102), 1);
cq_verify(cqv);
memset(ops, 0, sizeof(ops));
op = ops;
op->op = GRPC_OP_RECV_CLOSE_ON_SERVER;
op->data.recv_close_on_server.cancelled = &was_cancelled;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_MESSAGE;
op->data.send_message = response_payload;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_STATUS_FROM_SERVER;
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;
op->reserved = NULL;
op++;
error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(103), NULL);
GPR_ASSERT(GRPC_CALL_OK == error);
cq_expect_completion(cqv, tag(103), 1);
cq_expect_completion(cqv, tag(1), 1);
cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_OK);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
grpc_metadata_array_destroy(&trailing_metadata_recv);
grpc_metadata_array_destroy(&request_metadata_recv);
grpc_call_details_destroy(&call_details);
grpc_call_destroy(c);
grpc_call_destroy(s);
cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload);
grpc_byte_buffer_destroy(request_payload_recv);
grpc_byte_buffer_destroy(response_payload_recv);
}
/* override the default for testing purposes */
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) {
/* 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();
grpc_channel_args *lr_server_args =
grpc_channel_args_copy_and_add(NULL, &arg, 1);
grpc_end2end_test_fixture f =
begin_test(config, "test_load_reporting_hook", NULL, lr_server_args);
const char *method_name = "/gRPCFTW";
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);
}
void load_reporting_hook(grpc_end2end_test_config config) {
test_load_reporting_hook(config);
}
void load_reporting_hook_pre_init(void) {}

@ -108,7 +108,8 @@ CONFIG = [
('if-range', ''), ('if-range', ''),
('if-unmodified-since', ''), ('if-unmodified-since', ''),
('last-modified', ''), ('last-modified', ''),
('load-reporting', ''), ('load-reporting-initial', ''),
('load-reporting-trailing', ''),
('link', ''), ('link', ''),
('location', ''), ('location', ''),
('max-forwards', ''), ('max-forwards', ''),

@ -155,7 +155,9 @@ pip_install_dir() {
cd $PWD cd $PWD
} }
$VENV_PYTHON -m pip install --upgrade pip setuptools $VENV_PYTHON -m pip install --upgrade pip
# TODO(https://github.com/pypa/setuptools/issues/709) get the latest setuptools
$VENV_PYTHON -m pip install setuptools==25.1.1
$VENV_PYTHON -m pip install cython $VENV_PYTHON -m pip install cython
pip_install_dir $ROOT pip_install_dir $ROOT
$VENV_PYTHON $ROOT/tools/distrib/python/make_grpcio_tools.py $VENV_PYTHON $ROOT/tools/distrib/python/make_grpcio_tools.py

@ -3631,9 +3631,9 @@
], ],
"headers": [], "headers": [],
"language": "c", "language": "c",
"name": "h2_loadreporting_test", "name": "h2_load_reporting_test",
"src": [ "src": [
"test/core/end2end/fixtures/h2_loadreporting.c" "test/core/end2end/fixtures/h2_load_reporting.c"
], ],
"third_party": false, "third_party": false,
"type": "target" "type": "target"
@ -3903,9 +3903,9 @@
], ],
"headers": [], "headers": [],
"language": "c", "language": "c",
"name": "h2_loadreporting_nosec_test", "name": "h2_load_reporting_nosec_test",
"src": [ "src": [
"test/core/end2end/fixtures/h2_loadreporting.c" "test/core/end2end/fixtures/h2_load_reporting.c"
], ],
"third_party": false, "third_party": false,
"type": "target" "type": "target"
@ -5414,6 +5414,7 @@
"test/core/end2end/tests/idempotent_request.c", "test/core/end2end/tests/idempotent_request.c",
"test/core/end2end/tests/invoke_large_request.c", "test/core/end2end/tests/invoke_large_request.c",
"test/core/end2end/tests/large_metadata.c", "test/core/end2end/tests/large_metadata.c",
"test/core/end2end/tests/load_reporting_hook.c",
"test/core/end2end/tests/max_concurrent_streams.c", "test/core/end2end/tests/max_concurrent_streams.c",
"test/core/end2end/tests/max_message_length.c", "test/core/end2end/tests/max_message_length.c",
"test/core/end2end/tests/negative_deadline.c", "test/core/end2end/tests/negative_deadline.c",
@ -5474,6 +5475,7 @@
"test/core/end2end/tests/idempotent_request.c", "test/core/end2end/tests/idempotent_request.c",
"test/core/end2end/tests/invoke_large_request.c", "test/core/end2end/tests/invoke_large_request.c",
"test/core/end2end/tests/large_metadata.c", "test/core/end2end/tests/large_metadata.c",
"test/core/end2end/tests/load_reporting_hook.c",
"test/core/end2end/tests/max_concurrent_streams.c", "test/core/end2end/tests/max_concurrent_streams.c",
"test/core/end2end/tests/max_message_length.c", "test/core/end2end/tests/max_message_length.c",
"test/core/end2end/tests/negative_deadline.c", "test/core/end2end/tests/negative_deadline.c",

File diff suppressed because it is too large Load Diff

@ -748,7 +748,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "h2_full_test", "vcxproj\tes
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "h2_loadreporting_nosec_test", "vcxproj\test/end2end/fixtures\h2_loadreporting_nosec_test\h2_loadreporting_nosec_test.vcxproj", "{679EA55C-7399-53E8-79F0-82FBDB3DDE07}" 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 ProjectSection(myProperties) = preProject
lib = "False" lib = "False"
EndProjectSection EndProjectSection
@ -760,7 +760,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "h2_loadreporting_nosec_test
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "h2_loadreporting_test", "vcxproj\test/end2end/fixtures\h2_loadreporting_test\h2_loadreporting_test.vcxproj", "{B107130E-EA33-C114-9CB6-78A18C929F64}" 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 ProjectSection(myProperties) = preProject
lib = "False" lib = "False"
EndProjectSection EndProjectSection
@ -2607,38 +2607,38 @@ Global
{EEBEFA75-C625-C823-FE96-9AD64887B57D}.Release-DLL|Win32.Build.0 = Release|Win32 {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.ActiveCfg = Release|x64
{EEBEFA75-C625-C823-FE96-9AD64887B57D}.Release-DLL|x64.Build.0 = Release|x64 {EEBEFA75-C625-C823-FE96-9AD64887B57D}.Release-DLL|x64.Build.0 = Release|x64
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Debug|Win32.ActiveCfg = Debug|Win32 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug|Win32.ActiveCfg = Debug|Win32
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Debug|x64.ActiveCfg = Debug|x64 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug|x64.ActiveCfg = Debug|x64
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Release|Win32.ActiveCfg = Release|Win32 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release|Win32.ActiveCfg = Release|Win32
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Release|x64.ActiveCfg = Release|x64 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release|x64.ActiveCfg = Release|x64
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Debug|Win32.Build.0 = Debug|Win32 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug|Win32.Build.0 = Debug|Win32
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Debug|x64.Build.0 = Debug|x64 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug|x64.Build.0 = Debug|x64
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Release|Win32.Build.0 = Release|Win32 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release|Win32.Build.0 = Release|Win32
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Release|x64.Build.0 = Release|x64 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release|x64.Build.0 = Release|x64
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Debug-DLL|Win32.Build.0 = Debug|Win32 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug-DLL|Win32.Build.0 = Debug|Win32
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Debug-DLL|x64.ActiveCfg = Debug|x64 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug-DLL|x64.ActiveCfg = Debug|x64
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Debug-DLL|x64.Build.0 = Debug|x64 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Debug-DLL|x64.Build.0 = Debug|x64
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Release-DLL|Win32.ActiveCfg = Release|Win32 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release-DLL|Win32.ActiveCfg = Release|Win32
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Release-DLL|Win32.Build.0 = Release|Win32 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release-DLL|Win32.Build.0 = Release|Win32
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Release-DLL|x64.ActiveCfg = Release|x64 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release-DLL|x64.ActiveCfg = Release|x64
{679EA55C-7399-53E8-79F0-82FBDB3DDE07}.Release-DLL|x64.Build.0 = Release|x64 {4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}.Release-DLL|x64.Build.0 = Release|x64
{B107130E-EA33-C114-9CB6-78A18C929F64}.Debug|Win32.ActiveCfg = Debug|Win32 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug|Win32.ActiveCfg = Debug|Win32
{B107130E-EA33-C114-9CB6-78A18C929F64}.Debug|x64.ActiveCfg = Debug|x64 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug|x64.ActiveCfg = Debug|x64
{B107130E-EA33-C114-9CB6-78A18C929F64}.Release|Win32.ActiveCfg = Release|Win32 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release|Win32.ActiveCfg = Release|Win32
{B107130E-EA33-C114-9CB6-78A18C929F64}.Release|x64.ActiveCfg = Release|x64 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release|x64.ActiveCfg = Release|x64
{B107130E-EA33-C114-9CB6-78A18C929F64}.Debug|Win32.Build.0 = Debug|Win32 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug|Win32.Build.0 = Debug|Win32
{B107130E-EA33-C114-9CB6-78A18C929F64}.Debug|x64.Build.0 = Debug|x64 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug|x64.Build.0 = Debug|x64
{B107130E-EA33-C114-9CB6-78A18C929F64}.Release|Win32.Build.0 = Release|Win32 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release|Win32.Build.0 = Release|Win32
{B107130E-EA33-C114-9CB6-78A18C929F64}.Release|x64.Build.0 = Release|x64 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release|x64.Build.0 = Release|x64
{B107130E-EA33-C114-9CB6-78A18C929F64}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
{B107130E-EA33-C114-9CB6-78A18C929F64}.Debug-DLL|Win32.Build.0 = Debug|Win32 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug-DLL|Win32.Build.0 = Debug|Win32
{B107130E-EA33-C114-9CB6-78A18C929F64}.Debug-DLL|x64.ActiveCfg = Debug|x64 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug-DLL|x64.ActiveCfg = Debug|x64
{B107130E-EA33-C114-9CB6-78A18C929F64}.Debug-DLL|x64.Build.0 = Debug|x64 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Debug-DLL|x64.Build.0 = Debug|x64
{B107130E-EA33-C114-9CB6-78A18C929F64}.Release-DLL|Win32.ActiveCfg = Release|Win32 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release-DLL|Win32.ActiveCfg = Release|Win32
{B107130E-EA33-C114-9CB6-78A18C929F64}.Release-DLL|Win32.Build.0 = Release|Win32 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release-DLL|Win32.Build.0 = Release|Win32
{B107130E-EA33-C114-9CB6-78A18C929F64}.Release-DLL|x64.ActiveCfg = Release|x64 {F0A06723-2E3E-FE97-34B7-A2BA26D98B83}.Release-DLL|x64.ActiveCfg = Release|x64
{B107130E-EA33-C114-9CB6-78A18C929F64}.Release-DLL|x64.Build.0 = 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|Win32.ActiveCfg = Debug|Win32
{0F761FF3-342A-C429-711F-F76181BAA52D}.Debug|x64.ActiveCfg = Debug|x64 {0F761FF3-342A-C429-711F-F76181BAA52D}.Debug|x64.ActiveCfg = Debug|x64
{0F761FF3-342A-C429-711F-F76181BAA52D}.Release|Win32.ActiveCfg = Release|Win32 {0F761FF3-342A-C429-711F-F76181BAA52D}.Release|Win32.ActiveCfg = Release|Win32

@ -20,7 +20,7 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{679EA55C-7399-53E8-79F0-82FBDB3DDE07}</ProjectGuid> <ProjectGuid>{4B9EBBAE-D838-EC09-0B10-2D4520FBC0FF}</ProjectGuid>
<IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected>
<IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
@ -60,14 +60,14 @@
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> <PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>h2_loadreporting_nosec_test</TargetName> <TargetName>h2_load_reporting_nosec_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> <Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl> <Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'"> <PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>h2_loadreporting_nosec_test</TargetName> <TargetName>h2_load_reporting_nosec_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib> <Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
@ -158,7 +158,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\fixtures\h2_loadreporting.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\fixtures\h2_load_reporting.c">
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\fixtures\h2_loadreporting.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\fixtures\h2_load_reporting.c">
<Filter>test\core\end2end\fixtures</Filter> <Filter>test\core\end2end\fixtures</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="test"> <Filter Include="test">
<UniqueIdentifier>{8f73760a-74dc-05ef-65e1-fa8c44ccf918}</UniqueIdentifier> <UniqueIdentifier>{abff9aef-586e-65d2-beb8-e6392ecf7440}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core"> <Filter Include="test\core">
<UniqueIdentifier>{a280079e-b626-333e-0636-8fe6eb788ca1}</UniqueIdentifier> <UniqueIdentifier>{fd31cbf1-8cff-2e6a-618d-a01855997839}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core\end2end"> <Filter Include="test\core\end2end">
<UniqueIdentifier>{c1aa73d6-503a-06c0-42b2-0793a4805e96}</UniqueIdentifier> <UniqueIdentifier>{c6cc113f-ddb4-733b-5c10-8f98aa2d7d22}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core\end2end\fixtures"> <Filter Include="test\core\end2end\fixtures">
<UniqueIdentifier>{3e738e89-dc27-f929-cc8f-1aa94c24345b}</UniqueIdentifier> <UniqueIdentifier>{2cd15a3b-a7e6-b847-b6c4-7c6cc03eacc2}</UniqueIdentifier>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -20,7 +20,7 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{B107130E-EA33-C114-9CB6-78A18C929F64}</ProjectGuid> <ProjectGuid>{F0A06723-2E3E-FE97-34B7-A2BA26D98B83}</ProjectGuid>
<IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected>
<IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
@ -60,14 +60,14 @@
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> <PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>h2_loadreporting_test</TargetName> <TargetName>h2_load_reporting_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> <Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl> <Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'"> <PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>h2_loadreporting_test</TargetName> <TargetName>h2_load_reporting_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> <Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib> <Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> <Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
@ -158,7 +158,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\fixtures\h2_loadreporting.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\fixtures\h2_load_reporting.c">
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\fixtures\h2_loadreporting.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\fixtures\h2_load_reporting.c">
<Filter>test\core\end2end\fixtures</Filter> <Filter>test\core\end2end\fixtures</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="test"> <Filter Include="test">
<UniqueIdentifier>{8adc89fb-e447-77bc-c462-3dba6abcf344}</UniqueIdentifier> <UniqueIdentifier>{467ceaa9-3a51-d5df-0556-1ef8e91f5d7d}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core"> <Filter Include="test\core">
<UniqueIdentifier>{3c2c01f5-2a18-1bee-6ee0-217d415e2a95}</UniqueIdentifier> <UniqueIdentifier>{1ec29254-9064-0338-78ca-94d8cfdbd95c}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core\end2end"> <Filter Include="test\core\end2end">
<UniqueIdentifier>{3efa0f41-5802-6a8e-36ee-f246a201a1a5}</UniqueIdentifier> <UniqueIdentifier>{58fc84e1-7dc9-a517-359e-7d7e1c417432}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="test\core\end2end\fixtures"> <Filter Include="test\core\end2end\fixtures">
<UniqueIdentifier>{366eb24f-49e9-d57f-e20f-729d1e0fb892}</UniqueIdentifier> <UniqueIdentifier>{92ef09e0-592b-0ca5-4d79-5929ae159ed5}</UniqueIdentifier>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -193,6 +193,8 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\large_metadata.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\large_metadata.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\load_reporting_hook.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_concurrent_streams.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_concurrent_streams.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_message_length.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_message_length.c">

@ -64,6 +64,9 @@
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\large_metadata.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\large_metadata.c">
<Filter>test\core\end2end\tests</Filter> <Filter>test\core\end2end\tests</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\load_reporting_hook.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_concurrent_streams.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_concurrent_streams.c">
<Filter>test\core\end2end\tests</Filter> <Filter>test\core\end2end\tests</Filter>
</ClCompile> </ClCompile>

@ -195,6 +195,8 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\large_metadata.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\large_metadata.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\load_reporting_hook.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_concurrent_streams.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_concurrent_streams.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_message_length.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_message_length.c">

@ -67,6 +67,9 @@
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\large_metadata.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\large_metadata.c">
<Filter>test\core\end2end\tests</Filter> <Filter>test\core\end2end\tests</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\load_reporting_hook.c">
<Filter>test\core\end2end\tests</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_concurrent_streams.c"> <ClCompile Include="$(SolutionDir)\..\test\core\end2end\tests\max_concurrent_streams.c">
<Filter>test\core\end2end\tests</Filter> <Filter>test\core\end2end\tests</Filter>
</ClCompile> </ClCompile>

Loading…
Cancel
Save