Merge github.com:grpc/grpc into secsvr

pull/4344/head
Craig Tiller 9 years ago
commit 7c223ca5a4
  1. 6
      BUILD
  2. 36
      Makefile
  3. 1
      binding.gyp
  4. 10
      build.yaml
  5. 3
      gRPC.podspec
  6. 14
      include/grpc/support/alloc.h
  7. 1
      src/core/census/grpc_filter.c
  8. 118
      src/core/channel/noop_filter.c
  9. 10
      src/core/iomgr/tcp_server_posix.c
  10. 20
      src/core/support/alloc.c
  11. 1
      src/core/surface/init.c
  12. 4
      src/core/transport/chttp2/frame_settings.c
  13. 11
      src/csharp/Grpc.Core.Tests/ChannelTest.cs
  14. 12
      src/csharp/Grpc.Core.Tests/ClientServerTest.cs
  15. 1
      src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj
  16. 7
      src/csharp/Grpc.Core.Tests/MockServiceHelper.cs
  17. 101
      src/csharp/Grpc.Core.Tests/UserAgentStringTest.cs
  18. 42
      src/csharp/Grpc.Core/Channel.cs
  19. 7
      src/csharp/Grpc.Core/ChannelOptions.cs
  20. 10
      test/core/bad_client/tests/initial_settings_frame.c
  21. 6
      test/core/client_config/lb_policies_test.c
  22. 46
      test/core/support/alloc_test.c
  23. 20
      test/core/transport/metadata_test.c
  24. 2
      tools/doxygen/Doxyfile.core.internal
  25. 18
      tools/run_tests/sources_and_headers.json
  26. 18
      tools/run_tests/tests.json
  27. 25
      vsprojects/buildtests_c.sln
  28. 3
      vsprojects/vcxproj/grpc/grpc.vcxproj
  29. 6
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  30. 3
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  31. 6
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
  32. 178
      vsprojects/vcxproj/test/alloc_test/alloc_test.vcxproj
  33. 21
      vsprojects/vcxproj/test/alloc_test/alloc_test.vcxproj.filters

@ -161,7 +161,6 @@ cc_library(
"src/core/channel/context.h", "src/core/channel/context.h",
"src/core/channel/http_client_filter.h", "src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h", "src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.h", "src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.h", "src/core/client_config/client_config.h",
"src/core/client_config/connector.h", "src/core/client_config/connector.h",
@ -299,7 +298,6 @@ cc_library(
"src/core/channel/connected_channel.c", "src/core/channel/connected_channel.c",
"src/core/channel/http_client_filter.c", "src/core/channel/http_client_filter.c",
"src/core/channel/http_server_filter.c", "src/core/channel/http_server_filter.c",
"src/core/channel/noop_filter.c",
"src/core/channel/subchannel_call_holder.c", "src/core/channel/subchannel_call_holder.c",
"src/core/client_config/client_config.c", "src/core/client_config/client_config.c",
"src/core/client_config/connector.c", "src/core/client_config/connector.c",
@ -453,7 +451,6 @@ cc_library(
"src/core/channel/context.h", "src/core/channel/context.h",
"src/core/channel/http_client_filter.h", "src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h", "src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.h", "src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.h", "src/core/client_config/client_config.h",
"src/core/client_config/connector.h", "src/core/client_config/connector.h",
@ -571,7 +568,6 @@ cc_library(
"src/core/channel/connected_channel.c", "src/core/channel/connected_channel.c",
"src/core/channel/http_client_filter.c", "src/core/channel/http_client_filter.c",
"src/core/channel/http_server_filter.c", "src/core/channel/http_server_filter.c",
"src/core/channel/noop_filter.c",
"src/core/channel/subchannel_call_holder.c", "src/core/channel/subchannel_call_holder.c",
"src/core/client_config/client_config.c", "src/core/client_config/client_config.c",
"src/core/client_config/connector.c", "src/core/client_config/connector.c",
@ -1105,7 +1101,6 @@ objc_library(
"src/core/channel/connected_channel.c", "src/core/channel/connected_channel.c",
"src/core/channel/http_client_filter.c", "src/core/channel/http_client_filter.c",
"src/core/channel/http_server_filter.c", "src/core/channel/http_server_filter.c",
"src/core/channel/noop_filter.c",
"src/core/channel/subchannel_call_holder.c", "src/core/channel/subchannel_call_holder.c",
"src/core/client_config/client_config.c", "src/core/client_config/client_config.c",
"src/core/client_config/connector.c", "src/core/client_config/connector.c",
@ -1256,7 +1251,6 @@ objc_library(
"src/core/channel/context.h", "src/core/channel/context.h",
"src/core/channel/http_client_filter.h", "src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h", "src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.h", "src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.h", "src/core/client_config/client_config.h",
"src/core/client_config/connector.h", "src/core/client_config/connector.h",

File diff suppressed because one or more lines are too long

@ -183,7 +183,6 @@
'src/core/channel/connected_channel.c', 'src/core/channel/connected_channel.c',
'src/core/channel/http_client_filter.c', 'src/core/channel/http_client_filter.c',
'src/core/channel/http_server_filter.c', 'src/core/channel/http_server_filter.c',
'src/core/channel/noop_filter.c',
'src/core/channel/subchannel_call_holder.c', 'src/core/channel/subchannel_call_holder.c',
'src/core/client_config/client_config.c', 'src/core/client_config/client_config.c',
'src/core/client_config/connector.c', 'src/core/client_config/connector.c',

@ -116,7 +116,6 @@ filegroups:
- src/core/channel/context.h - src/core/channel/context.h
- src/core/channel/http_client_filter.h - src/core/channel/http_client_filter.h
- src/core/channel/http_server_filter.h - src/core/channel/http_server_filter.h
- src/core/channel/noop_filter.h
- src/core/channel/subchannel_call_holder.h - src/core/channel/subchannel_call_holder.h
- src/core/client_config/client_config.h - src/core/client_config/client_config.h
- src/core/client_config/connector.h - src/core/client_config/connector.h
@ -231,7 +230,6 @@ filegroups:
- src/core/channel/connected_channel.c - src/core/channel/connected_channel.c
- src/core/channel/http_client_filter.c - src/core/channel/http_client_filter.c
- src/core/channel/http_server_filter.c - src/core/channel/http_server_filter.c
- src/core/channel/noop_filter.c
- src/core/channel/subchannel_call_holder.c - src/core/channel/subchannel_call_holder.c
- src/core/client_config/client_config.c - src/core/client_config/client_config.c
- src/core/client_config/connector.c - src/core/client_config/connector.c
@ -811,6 +809,14 @@ libs:
- winsock - winsock
- global - global
targets: targets:
- name: alloc_test
build: test
language: c
src:
- test/core/support/alloc_test.c
deps:
- gpr_test_util
- gpr
- name: alpn_test - name: alpn_test
build: test build: test
language: c language: c

@ -165,7 +165,6 @@ Pod::Spec.new do |s|
'src/core/channel/context.h', 'src/core/channel/context.h',
'src/core/channel/http_client_filter.h', 'src/core/channel/http_client_filter.h',
'src/core/channel/http_server_filter.h', 'src/core/channel/http_server_filter.h',
'src/core/channel/noop_filter.h',
'src/core/channel/subchannel_call_holder.h', 'src/core/channel/subchannel_call_holder.h',
'src/core/client_config/client_config.h', 'src/core/client_config/client_config.h',
'src/core/client_config/connector.h', 'src/core/client_config/connector.h',
@ -310,7 +309,6 @@ Pod::Spec.new do |s|
'src/core/channel/connected_channel.c', 'src/core/channel/connected_channel.c',
'src/core/channel/http_client_filter.c', 'src/core/channel/http_client_filter.c',
'src/core/channel/http_server_filter.c', 'src/core/channel/http_server_filter.c',
'src/core/channel/noop_filter.c',
'src/core/channel/subchannel_call_holder.c', 'src/core/channel/subchannel_call_holder.c',
'src/core/client_config/client_config.c', 'src/core/client_config/client_config.c',
'src/core/client_config/connector.c', 'src/core/client_config/connector.c',
@ -463,7 +461,6 @@ Pod::Spec.new do |s|
'src/core/channel/context.h', 'src/core/channel/context.h',
'src/core/channel/http_client_filter.h', 'src/core/channel/http_client_filter.h',
'src/core/channel/http_server_filter.h', 'src/core/channel/http_server_filter.h',
'src/core/channel/noop_filter.h',
'src/core/channel/subchannel_call_holder.h', 'src/core/channel/subchannel_call_holder.h',
'src/core/client_config/client_config.h', 'src/core/client_config/client_config.h',
'src/core/client_config/connector.h', 'src/core/client_config/connector.h',

@ -40,6 +40,12 @@
extern "C" { extern "C" {
#endif #endif
typedef struct gpr_allocation_functions {
void *(*malloc_fn)(size_t size);
void *(*realloc_fn)(void *ptr, size_t size);
void (*free_fn)(void *ptr);
} gpr_allocation_functions;
/* malloc, never returns NULL */ /* malloc, never returns NULL */
void *gpr_malloc(size_t size); void *gpr_malloc(size_t size);
/* free */ /* free */
@ -51,6 +57,14 @@ void *gpr_malloc_aligned(size_t size, size_t alignment_log);
/* free memory allocated by gpr_malloc_aligned */ /* free memory allocated by gpr_malloc_aligned */
void gpr_free_aligned(void *ptr); void gpr_free_aligned(void *ptr);
/** Request the family of allocation functions in \a functions be used. NOTE
* that this request will be honored in a *best effort* basis and that no
* guarantees are made about the default functions (eg, malloc) being called. */
void gpr_set_allocation_functions(gpr_allocation_functions functions);
/** Return the family of allocation functions currently in effect. */
gpr_allocation_functions gpr_get_allocation_functions();
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -43,7 +43,6 @@
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/channel/channel_stack.h" #include "src/core/channel/channel_stack.h"
#include "src/core/channel/noop_filter.h"
#include "src/core/statistics/census_interface.h" #include "src/core/statistics/census_interface.h"
#include "src/core/statistics/census_rpc_stats.h" #include "src/core/statistics/census_rpc_stats.h"
#include "src/core/transport/static_metadata.h" #include "src/core/transport/static_metadata.h"

@ -1,118 +0,0 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "src/core/channel/noop_filter.h"
#include <grpc/support/log.h>
typedef struct call_data {
int unused; /* C89 requires at least one struct element */
} call_data;
typedef struct channel_data {
int unused; /* C89 requires at least one struct element */
} channel_data;
/* used to silence 'variable not used' warnings */
static void ignore_unused(void *ignored) {}
static void noop_mutate_op(grpc_call_element *elem,
grpc_transport_stream_op *op) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
ignore_unused(calld);
ignore_unused(channeld);
/* do nothing */
}
/* Called either:
- in response to an API call (or similar) from above, to send something
- a network event (or similar) from below, to receive something
op contains type and call direction information, in addition to the data
that is being sent or received. */
static void noop_start_transport_stream_op(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_transport_stream_op *op) {
noop_mutate_op(elem, op);
/* pass control down the stack */
grpc_call_next_op(exec_ctx, elem, op);
}
/* Constructor for call_data */
static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_call_element_args *args) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
/* initialize members */
calld->unused = channeld->unused;
}
/* Destructor for call_data */
static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem) {}
/* Constructor for channel_data */
static void init_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem,
grpc_channel_element_args *args) {
/* grab pointers to our data from the channel element */
channel_data *channeld = elem->channel_data;
/* The last filter tends to be implemented differently to
handle the case that there's no 'next' filter to call on the down
path */
GPR_ASSERT(!args->is_last);
/* initialize members */
channeld->unused = 0;
}
/* Destructor for channel data */
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {
/* grab pointers to our data from the channel element */
channel_data *channeld = elem->channel_data;
ignore_unused(channeld);
}
const grpc_channel_filter grpc_no_op_filter = {
noop_start_transport_stream_op, grpc_channel_next_op, sizeof(call_data),
init_call_elem, grpc_call_stack_ignore_set_pollset, destroy_call_elem,
sizeof(channel_data), init_channel_elem, destroy_channel_elem,
grpc_call_next_get_peer, "no-op"};

@ -411,7 +411,6 @@ static grpc_tcp_listener *add_socket_to_server(grpc_tcp_server *s, int fd,
grpc_tcp_listener *grpc_tcp_server_add_port(grpc_tcp_server *s, grpc_tcp_listener *grpc_tcp_server_add_port(grpc_tcp_server *s,
const void *addr, size_t addr_len) { const void *addr, size_t addr_len) {
int allocated_port = -1;
grpc_tcp_listener *sp; grpc_tcp_listener *sp;
grpc_tcp_listener *sp2 = NULL; grpc_tcp_listener *sp2 = NULL;
int fd; int fd;
@ -464,14 +463,13 @@ grpc_tcp_listener *grpc_tcp_server_add_port(grpc_tcp_server *s,
addr_len = sizeof(wild6); addr_len = sizeof(wild6);
fd = grpc_create_dualstack_socket(addr, SOCK_STREAM, 0, &dsmode); fd = grpc_create_dualstack_socket(addr, SOCK_STREAM, 0, &dsmode);
sp = add_socket_to_server(s, fd, addr, addr_len); sp = add_socket_to_server(s, fd, addr, addr_len);
allocated_port = sp->port;
if (fd >= 0 && dsmode == GRPC_DSMODE_DUALSTACK) { if (fd >= 0 && dsmode == GRPC_DSMODE_DUALSTACK) {
goto done; goto done;
} }
/* If we didn't get a dualstack socket, also listen on 0.0.0.0. */ /* If we didn't get a dualstack socket, also listen on 0.0.0.0. */
if (port == 0 && allocated_port > 0) { if (port == 0 && sp != NULL) {
grpc_sockaddr_set_port((struct sockaddr *)&wild4, allocated_port); grpc_sockaddr_set_port((struct sockaddr *)&wild4, sp->port);
sp2 = sp; sp2 = sp;
} }
addr = (struct sockaddr *)&wild4; addr = (struct sockaddr *)&wild4;
@ -488,8 +486,8 @@ grpc_tcp_listener *grpc_tcp_server_add_port(grpc_tcp_server *s,
addr_len = sizeof(addr4_copy); addr_len = sizeof(addr4_copy);
} }
sp = add_socket_to_server(s, fd, addr, addr_len); sp = add_socket_to_server(s, fd, addr, addr_len);
sp->sibling = sp2; if (sp != NULL) sp->sibling = sp2;
if (sp2) sp2->is_sibling = 1; if (sp2 != NULL) sp2->is_sibling = 1;
done: done:
gpr_free(allocated_addr); gpr_free(allocated_addr);

@ -34,13 +34,27 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <stdlib.h> #include <stdlib.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include "src/core/profiling/timers.h" #include "src/core/profiling/timers.h"
static gpr_allocation_functions g_alloc_functions = {malloc, realloc, free};
gpr_allocation_functions gpr_get_allocation_functions() {
return g_alloc_functions;
}
void gpr_set_allocation_functions(gpr_allocation_functions functions) {
GPR_ASSERT(functions.malloc_fn != NULL);
GPR_ASSERT(functions.realloc_fn != NULL);
GPR_ASSERT(functions.free_fn != NULL);
g_alloc_functions = functions;
}
void *gpr_malloc(size_t size) { void *gpr_malloc(size_t size) {
void *p; void *p;
GPR_TIMER_BEGIN("gpr_malloc", 0); GPR_TIMER_BEGIN("gpr_malloc", 0);
p = malloc(size); p = g_alloc_functions.malloc_fn(size);
if (!p) { if (!p) {
abort(); abort();
} }
@ -50,13 +64,13 @@ void *gpr_malloc(size_t size) {
void gpr_free(void *p) { void gpr_free(void *p) {
GPR_TIMER_BEGIN("gpr_free", 0); GPR_TIMER_BEGIN("gpr_free", 0);
free(p); g_alloc_functions.free_fn(p);
GPR_TIMER_END("gpr_free", 0); GPR_TIMER_END("gpr_free", 0);
} }
void *gpr_realloc(void *p, size_t size) { void *gpr_realloc(void *p, size_t size) {
GPR_TIMER_BEGIN("gpr_realloc", 0); GPR_TIMER_BEGIN("gpr_realloc", 0);
p = realloc(p, size); p = g_alloc_functions.realloc_fn(p, size);
if (!p) { if (!p) {
abort(); abort();
} }

@ -147,6 +147,7 @@ void grpc_shutdown(void) {
gpr_timers_global_destroy(); gpr_timers_global_destroy();
grpc_tracer_shutdown(); grpc_tracer_shutdown();
grpc_resolver_registry_shutdown(); grpc_resolver_registry_shutdown();
grpc_lb_policy_registry_shutdown();
for (i = 0; i < g_number_of_plugins; i++) { for (i = 0; i < g_number_of_plugins; i++) {
if (g_all_of_the_plugins[i].destroy != NULL) { if (g_all_of_the_plugins[i].destroy != NULL) {
g_all_of_the_plugins[i].destroy(); g_all_of_the_plugins[i].destroy();

@ -44,6 +44,8 @@
#include "src/core/transport/chttp2/http2_errors.h" #include "src/core/transport/chttp2/http2_errors.h"
#include "src/core/transport/chttp2_transport.h" #include "src/core/transport/chttp2_transport.h"
#define MAX_MAX_HEADER_LIST_SIZE (1024*1024*1024)
/* HTTP/2 mandated initial connection settings */ /* HTTP/2 mandated initial connection settings */
const grpc_chttp2_setting_parameters const grpc_chttp2_setting_parameters
grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS] = { grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS] = {
@ -60,7 +62,7 @@ const grpc_chttp2_setting_parameters
GRPC_CHTTP2_FLOW_CONTROL_ERROR}, GRPC_CHTTP2_FLOW_CONTROL_ERROR},
{"MAX_FRAME_SIZE", 16384, 16384, 16777215, {"MAX_FRAME_SIZE", 16384, 16384, 16777215,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_CHTTP2_PROTOCOL_ERROR}, GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_CHTTP2_PROTOCOL_ERROR},
{"MAX_HEADER_LIST_SIZE", 0xffffffffu, 0, 0xffffffffu, {"MAX_HEADER_LIST_SIZE", MAX_MAX_HEADER_LIST_SIZE, 0, MAX_MAX_HEADER_LIST_SIZE,
GRPC_CHTTP2_CLAMP_INVALID_VALUE, GRPC_CHTTP2_PROTOCOL_ERROR}, GRPC_CHTTP2_CLAMP_INVALID_VALUE, GRPC_CHTTP2_PROTOCOL_ERROR},
}; };

@ -47,6 +47,17 @@ namespace Grpc.Core.Tests
Assert.Throws(typeof(ArgumentNullException), () => new Channel(null, ChannelCredentials.Insecure)); Assert.Throws(typeof(ArgumentNullException), () => new Channel(null, ChannelCredentials.Insecure));
} }
[Test]
public void Constructor_RejectsDuplicateOptions()
{
var options = new ChannelOption[]
{
new ChannelOption(ChannelOptions.PrimaryUserAgentString, "ABC"),
new ChannelOption(ChannelOptions.PrimaryUserAgentString, "XYZ")
};
Assert.Throws(typeof(ArgumentException), () => new Channel("127.0.0.1", ChannelCredentials.Insecure, options));
}
[Test] [Test]
public void State_IdleAfterCreation() public void State_IdleAfterCreation()
{ {

@ -218,18 +218,6 @@ namespace Grpc.Core.Tests
Assert.AreEqual(StatusCode.Unimplemented, ex.Status.StatusCode); Assert.AreEqual(StatusCode.Unimplemented, ex.Status.StatusCode);
} }
[Test]
public void UserAgentStringPresent()
{
helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
{
return context.RequestHeaders.Where(entry => entry.Key == "user-agent").Single().Value;
});
string userAgent = Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc");
Assert.IsTrue(userAgent.StartsWith("grpc-csharp/"));
}
[Test] [Test]
public void PeerInfoPresent() public void PeerInfoPresent()
{ {

@ -64,6 +64,7 @@
<Link>Version.cs</Link> <Link>Version.cs</Link>
</Compile> </Compile>
<Compile Include="CallCredentialsTest.cs" /> <Compile Include="CallCredentialsTest.cs" />
<Compile Include="UserAgentStringTest.cs" />
<Compile Include="FakeCredentials.cs" /> <Compile Include="FakeCredentials.cs" />
<Compile Include="MarshallingErrorsTest.cs" /> <Compile Include="MarshallingErrorsTest.cs" />
<Compile Include="ChannelCredentialsTest.cs" /> <Compile Include="ChannelCredentialsTest.cs" />

@ -32,6 +32,7 @@
#endregion #endregion
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
@ -52,6 +53,7 @@ namespace Grpc.Core.Tests
readonly string host; readonly string host;
readonly ServerServiceDefinition serviceDefinition; readonly ServerServiceDefinition serviceDefinition;
readonly IEnumerable<ChannelOption> channelOptions;
readonly Method<string, string> unaryMethod; readonly Method<string, string> unaryMethod;
readonly Method<string, string> clientStreamingMethod; readonly Method<string, string> clientStreamingMethod;
@ -66,9 +68,10 @@ namespace Grpc.Core.Tests
Server server; Server server;
Channel channel; Channel channel;
public MockServiceHelper(string host = null, Marshaller<string> marshaller = null) public MockServiceHelper(string host = null, Marshaller<string> marshaller = null, IEnumerable<ChannelOption> channelOptions = null)
{ {
this.host = host ?? "localhost"; this.host = host ?? "localhost";
this.channelOptions = channelOptions;
marshaller = marshaller ?? Marshallers.StringMarshaller; marshaller = marshaller ?? Marshallers.StringMarshaller;
unaryMethod = new Method<string, string>( unaryMethod = new Method<string, string>(
@ -154,7 +157,7 @@ namespace Grpc.Core.Tests
{ {
if (channel == null) if (channel == null)
{ {
channel = new Channel(Host, GetServer().Ports.Single().BoundPort, ChannelCredentials.Insecure); channel = new Channel(Host, GetServer().Ports.Single().BoundPort, ChannelCredentials.Insecure, channelOptions);
} }
return channel; return channel;
} }

@ -0,0 +1,101 @@
#region Copyright notice and license
// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Internal;
using Grpc.Core.Profiling;
using Grpc.Core.Utils;
using NUnit.Framework;
namespace Grpc.Core.Tests
{
public class UserAgentStringTest
{
const string Host = "127.0.0.1";
MockServiceHelper helper;
Server server;
Channel channel;
[TearDown]
public void Cleanup()
{
channel.ShutdownAsync().Wait();
server.ShutdownAsync().Wait();
}
[Test]
public void DefaultUserAgentString()
{
helper = new MockServiceHelper(Host);
server = helper.GetServer();
server.Start();
channel = helper.GetChannel();
helper.UnaryHandler = new UnaryServerMethod<string, string>((request, context) =>
{
var userAgentString = context.RequestHeaders.First(m => (m.Key == "user-agent")).Value;
var parts = userAgentString.Split(new [] {' '}, 2);
Assert.AreEqual(string.Format("grpc-csharp/{0}", VersionInfo.CurrentVersion), parts[0]);
Assert.IsTrue(parts[1].StartsWith("grpc-c/"));
return Task.FromResult("PASS");
});
Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), ""));
}
[Test]
public void ApplicationUserAgentString()
{
helper = new MockServiceHelper(Host,
channelOptions: new[] { new ChannelOption(ChannelOptions.PrimaryUserAgentString, "XYZ") });
server = helper.GetServer();
server.Start();
channel = helper.GetChannel();
channel = helper.GetChannel();
helper.UnaryHandler = new UnaryServerMethod<string, string>((request, context) =>
{
var userAgentString = context.RequestHeaders.First(m => (m.Key == "user-agent")).Value;
var parts = userAgentString.Split(new[] { ' ' }, 3);
Assert.AreEqual("XYZ", parts[0]);
return Task.FromResult("PASS");
});
Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), ""));
}
}
}

@ -32,8 +32,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Grpc.Core.Internal; using Grpc.Core.Internal;
@ -57,7 +55,7 @@ namespace Grpc.Core
readonly string target; readonly string target;
readonly GrpcEnvironment environment; readonly GrpcEnvironment environment;
readonly ChannelSafeHandle handle; readonly ChannelSafeHandle handle;
readonly List<ChannelOption> options; readonly Dictionary<string, ChannelOption> options;
bool shutdownRequested; bool shutdownRequested;
@ -71,12 +69,12 @@ namespace Grpc.Core
public Channel(string target, ChannelCredentials credentials, IEnumerable<ChannelOption> options = null) public Channel(string target, ChannelCredentials credentials, IEnumerable<ChannelOption> options = null)
{ {
this.target = Preconditions.CheckNotNull(target, "target"); this.target = Preconditions.CheckNotNull(target, "target");
this.options = CreateOptionsDictionary(options);
EnsureUserAgentChannelOption(this.options);
this.environment = GrpcEnvironment.AddRef(); this.environment = GrpcEnvironment.AddRef();
this.options = options != null ? new List<ChannelOption>(options) : new List<ChannelOption>();
EnsureUserAgentChannelOption(this.options);
using (var nativeCredentials = credentials.ToNativeCredentials()) using (var nativeCredentials = credentials.ToNativeCredentials())
using (var nativeChannelArgs = ChannelOptions.CreateChannelArgs(this.options)) using (var nativeChannelArgs = ChannelOptions.CreateChannelArgs(this.options.Values))
{ {
if (nativeCredentials != null) if (nativeCredentials != null)
{ {
@ -233,18 +231,36 @@ namespace Grpc.Core
activeCallCounter.Decrement(); activeCallCounter.Decrement();
} }
private static void EnsureUserAgentChannelOption(List<ChannelOption> options) private static void EnsureUserAgentChannelOption(Dictionary<string, ChannelOption> options)
{ {
if (!options.Any((option) => option.Name == ChannelOptions.PrimaryUserAgentString)) var key = ChannelOptions.PrimaryUserAgentString;
var userAgentString = "";
ChannelOption option;
if (options.TryGetValue(key, out option))
{ {
options.Add(new ChannelOption(ChannelOptions.PrimaryUserAgentString, GetUserAgentString())); // user-provided userAgentString needs to be at the beginning
} userAgentString = option.StringValue + " ";
};
// TODO(jtattermusch): it would be useful to also provide .NET/mono version.
userAgentString += string.Format("grpc-csharp/{0}", VersionInfo.CurrentVersion);
options[ChannelOptions.PrimaryUserAgentString] = new ChannelOption(key, userAgentString);
} }
private static string GetUserAgentString() private static Dictionary<string, ChannelOption> CreateOptionsDictionary(IEnumerable<ChannelOption> options)
{ {
// TODO(jtattermusch): it would be useful to also provide .NET/mono version. var dict = new Dictionary<string, ChannelOption>();
return string.Format("grpc-csharp/{0}", VersionInfo.CurrentVersion); if (options == null)
{
return dict;
}
foreach (var option in options)
{
dict.Add(option.Name, option);
}
return dict;
} }
} }
} }

@ -169,7 +169,7 @@ namespace Grpc.Core
/// Creates native object for a collection of channel options. /// Creates native object for a collection of channel options.
/// </summary> /// </summary>
/// <returns>The native channel arguments.</returns> /// <returns>The native channel arguments.</returns>
internal static ChannelArgsSafeHandle CreateChannelArgs(List<ChannelOption> options) internal static ChannelArgsSafeHandle CreateChannelArgs(ICollection<ChannelOption> options)
{ {
if (options == null || options.Count == 0) if (options == null || options.Count == 0)
{ {
@ -179,9 +179,9 @@ namespace Grpc.Core
try try
{ {
nativeArgs = ChannelArgsSafeHandle.Create(options.Count); nativeArgs = ChannelArgsSafeHandle.Create(options.Count);
for (int i = 0; i < options.Count; i++) int i = 0;
foreach (var option in options)
{ {
var option = options[i];
if (option.Type == ChannelOption.OptionType.Integer) if (option.Type == ChannelOption.OptionType.Integer)
{ {
nativeArgs.SetInteger(i, option.Name, option.IntValue); nativeArgs.SetInteger(i, option.Name, option.IntValue);
@ -194,6 +194,7 @@ namespace Grpc.Core
{ {
throw new InvalidOperationException("Unknown option type"); throw new InvalidOperationException("Unknown option type");
} }
i++;
} }
return nativeArgs; return nativeArgs;
} }

@ -94,7 +94,15 @@ int main(int argc, char **argv) {
/* some settings values are illegal */ /* some settings values are illegal */
/* max frame size = 0 */ /* max frame size = 0 */
GRPC_RUN_BAD_CLIENT_TEST(verifier, GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR ONE_SETTING_HDR "\x00\x05\x00\x00\x00\x00", GRPC_BAD_CLIENT_DISCONNECT); PFX_STR ONE_SETTING_HDR "\x00\x05\x00\x00\x00\x00",
GRPC_BAD_CLIENT_DISCONNECT);
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR ONE_SETTING_HDR "\x00\x06\xff\xff\xff\xff",
GRPC_BAD_CLIENT_DISCONNECT);
/* update intiial window size */
GRPC_RUN_BAD_CLIENT_TEST(verifier,
PFX_STR ONE_SETTING_HDR "\x00\x04\x00\x01\x00\x00",
GRPC_BAD_CLIENT_DISCONNECT);
return 0; return 0;
} }

@ -42,8 +42,9 @@
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/channel/channel_stack.h" #include "src/core/channel/channel_stack.h"
#include "src/core/surface/channel.h"
#include "src/core/channel/client_channel.h" #include "src/core/channel/client_channel.h"
#include "src/core/client_config/lb_policy_registry.h"
#include "src/core/surface/channel.h"
#include "src/core/support/string.h" #include "src/core/support/string.h"
#include "src/core/surface/server.h" #include "src/core/surface/server.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
@ -716,6 +717,9 @@ int main(int argc, char **argv) {
grpc_test_init(argc, argv); grpc_test_init(argc, argv);
grpc_init(); grpc_init();
GPR_ASSERT(grpc_lb_policy_create("this-lb-policy-does-not-exist", NULL) == NULL);
GPR_ASSERT(grpc_lb_policy_create(NULL, NULL) == NULL);
/* everything is fine, all servers stay up the whole time and life's peachy */ /* everything is fine, all servers stay up the whole time and life's peachy */
spec = test_spec_create(NUM_ITERS, NUM_SERVERS); spec = test_spec_create(NUM_ITERS, NUM_SERVERS);
spec->verifier = verify_vanilla_round_robin; spec->verifier = verify_vanilla_round_robin;

@ -31,14 +31,44 @@
* *
*/ */
#ifndef GRPC_INTERNAL_CORE_CHANNEL_NOOP_FILTER_H #include <grpc/support/log.h>
#define GRPC_INTERNAL_CORE_CHANNEL_NOOP_FILTER_H #include <grpc/support/alloc.h>
#include "test/core/util/test_config.h"
#include "src/core/channel/channel_stack.h" static void *fake_malloc(size_t size) {
return (void*)size;
}
/* No-op filter: simply takes everything it's given, and passes it on to the static void *fake_realloc(void *addr, size_t size) {
next filter. Exists simply as a starting point that others can take and return (void*)size;
customize for their own filters */ }
extern const grpc_channel_filter grpc_no_op_filter;
#endif /* GRPC_INTERNAL_CORE_CHANNEL_NOOP_FILTER_H */ static void fake_free(void *addr) {
*((gpr_intptr*)addr) = 0xdeadd00d;
}
static void test_custom_allocs() {
const gpr_allocation_functions default_fns = gpr_get_allocation_functions();
gpr_intptr addr_to_free = 0;
int *i;
gpr_allocation_functions fns = {fake_malloc, fake_realloc, fake_free};
gpr_set_allocation_functions(fns);
GPR_ASSERT((void*)0xdeadbeef == gpr_malloc(0xdeadbeef));
GPR_ASSERT((void*)0xcafed00d == gpr_realloc(0, 0xcafed00d));
gpr_free(&addr_to_free);
GPR_ASSERT(addr_to_free == 0xdeadd00d);
/* Restore and check we don't get funky values and that we don't leak */
gpr_set_allocation_functions(default_fns);
GPR_ASSERT((void*)1 != (i = gpr_malloc(sizeof(*i))));
GPR_ASSERT((void*)2 != (i = gpr_realloc(i, 2)));
gpr_free(i);
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
test_custom_allocs();
return 0;
}

@ -241,6 +241,25 @@ static void test_base64_and_huffman_works(void) {
grpc_shutdown(); grpc_shutdown();
} }
static void test_user_data_works(void) {
int *ud1;
int *ud2;
grpc_mdelem *md;
LOG_TEST("test_user_data_works");
grpc_init();
ud1 = gpr_malloc(sizeof(int));
*ud1 = 1;
ud2 = gpr_malloc(sizeof(int));
*ud2 = 2;
md = grpc_mdelem_from_strings("abc", "123");
grpc_mdelem_set_user_data(md, gpr_free, ud1);
grpc_mdelem_set_user_data(md, gpr_free, ud2);
GPR_ASSERT(grpc_mdelem_get_user_data(md, gpr_free) == ud1);
GRPC_MDELEM_UNREF(md);
grpc_shutdown();
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
grpc_test_init(argc, argv); grpc_test_init(argc, argv);
test_no_op(); test_no_op();
@ -252,5 +271,6 @@ int main(int argc, char **argv) {
test_things_stick_around(); test_things_stick_around();
test_slices_work(); test_slices_work();
test_base64_and_huffman_works(); test_base64_and_huffman_works();
test_user_data_works();
return 0; return 0;
} }

@ -790,7 +790,6 @@ src/core/channel/connected_channel.h \
src/core/channel/context.h \ src/core/channel/context.h \
src/core/channel/http_client_filter.h \ src/core/channel/http_client_filter.h \
src/core/channel/http_server_filter.h \ src/core/channel/http_server_filter.h \
src/core/channel/noop_filter.h \
src/core/channel/subchannel_call_holder.h \ src/core/channel/subchannel_call_holder.h \
src/core/client_config/client_config.h \ src/core/client_config/client_config.h \
src/core/client_config/connector.h \ src/core/client_config/connector.h \
@ -928,7 +927,6 @@ src/core/channel/compress_filter.c \
src/core/channel/connected_channel.c \ src/core/channel/connected_channel.c \
src/core/channel/http_client_filter.c \ src/core/channel/http_client_filter.c \
src/core/channel/http_server_filter.c \ src/core/channel/http_server_filter.c \
src/core/channel/noop_filter.c \
src/core/channel/subchannel_call_holder.c \ src/core/channel/subchannel_call_holder.c \
src/core/client_config/client_config.c \ src/core/client_config/client_config.c \
src/core/client_config/connector.c \ src/core/client_config/connector.c \

@ -1,6 +1,18 @@
[ [
{
"deps": [
"gpr",
"gpr_test_util"
],
"headers": [],
"language": "c",
"name": "alloc_test",
"src": [
"test/core/support/alloc_test.c"
]
},
{ {
"deps": [ "deps": [
"gpr", "gpr",
@ -14475,7 +14487,6 @@
"src/core/channel/context.h", "src/core/channel/context.h",
"src/core/channel/http_client_filter.h", "src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h", "src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.h", "src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.h", "src/core/client_config/client_config.h",
"src/core/client_config/connector.h", "src/core/client_config/connector.h",
@ -14630,8 +14641,6 @@
"src/core/channel/http_client_filter.h", "src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.c", "src/core/channel/http_server_filter.c",
"src/core/channel/http_server_filter.h", "src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.c",
"src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.c", "src/core/channel/subchannel_call_holder.c",
"src/core/channel/subchannel_call_holder.h", "src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.c", "src/core/client_config/client_config.c",
@ -14987,7 +14996,6 @@
"src/core/channel/context.h", "src/core/channel/context.h",
"src/core/channel/http_client_filter.h", "src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.h", "src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.h", "src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.h", "src/core/client_config/client_config.h",
"src/core/client_config/connector.h", "src/core/client_config/connector.h",
@ -15128,8 +15136,6 @@
"src/core/channel/http_client_filter.h", "src/core/channel/http_client_filter.h",
"src/core/channel/http_server_filter.c", "src/core/channel/http_server_filter.c",
"src/core/channel/http_server_filter.h", "src/core/channel/http_server_filter.h",
"src/core/channel/noop_filter.c",
"src/core/channel/noop_filter.h",
"src/core/channel/subchannel_call_holder.c", "src/core/channel/subchannel_call_holder.c",
"src/core/channel/subchannel_call_holder.h", "src/core/channel/subchannel_call_holder.h",
"src/core/client_config/client_config.c", "src/core/client_config/client_config.c",

@ -1,6 +1,24 @@
[ [
{
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"exclude_configs": [],
"flaky": false,
"language": "c",
"name": "alloc_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
]
},
{ {
"ci_platforms": [ "ci_platforms": [
"linux", "linux",

@ -1135,6 +1135,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bad_client_test", "vcxproj\
{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}") = "alloc_test", "vcxproj\test\alloc_test\alloc_test.vcxproj", "{DD37D527-9DFF-1F53-B97F-50CF80AE0650}"
ProjectSection(myProperties) = preProject
lib = "False"
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
{EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037}
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "alpn_test", "vcxproj\test\alpn_test\alpn_test.vcxproj", "{5BAAE7EA-A972-DD80-F190-29B9E3110BB3}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "alpn_test", "vcxproj\test\alpn_test\alpn_test.vcxproj", "{5BAAE7EA-A972-DD80-F190-29B9E3110BB3}"
ProjectSection(myProperties) = preProject ProjectSection(myProperties) = preProject
lib = "False" lib = "False"
@ -11721,6 +11730,22 @@ Global
{BA67B418-B699-E41A-9CC4-0279C49481A5}.Release-DLL|Win32.Build.0 = Release|Win32 {BA67B418-B699-E41A-9CC4-0279C49481A5}.Release-DLL|Win32.Build.0 = Release|Win32
{BA67B418-B699-E41A-9CC4-0279C49481A5}.Release-DLL|x64.ActiveCfg = Release|x64 {BA67B418-B699-E41A-9CC4-0279C49481A5}.Release-DLL|x64.ActiveCfg = Release|x64
{BA67B418-B699-E41A-9CC4-0279C49481A5}.Release-DLL|x64.Build.0 = Release|x64 {BA67B418-B699-E41A-9CC4-0279C49481A5}.Release-DLL|x64.Build.0 = Release|x64
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Debug|Win32.ActiveCfg = Debug|Win32
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Debug|x64.ActiveCfg = Debug|x64
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Release|Win32.ActiveCfg = Release|Win32
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Release|x64.ActiveCfg = Release|x64
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Debug|Win32.Build.0 = Debug|Win32
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Debug|x64.Build.0 = Debug|x64
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Release|Win32.Build.0 = Release|Win32
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Release|x64.Build.0 = Release|x64
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Debug-DLL|Win32.Build.0 = Debug|Win32
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Debug-DLL|x64.ActiveCfg = Debug|x64
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Debug-DLL|x64.Build.0 = Debug|x64
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Release-DLL|Win32.ActiveCfg = Release|Win32
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Release-DLL|Win32.Build.0 = Release|Win32
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Release-DLL|x64.ActiveCfg = Release|x64
{DD37D527-9DFF-1F53-B97F-50CF80AE0650}.Release-DLL|x64.Build.0 = Release|x64
{5BAAE7EA-A972-DD80-F190-29B9E3110BB3}.Debug|Win32.ActiveCfg = Debug|Win32 {5BAAE7EA-A972-DD80-F190-29B9E3110BB3}.Debug|Win32.ActiveCfg = Debug|Win32
{5BAAE7EA-A972-DD80-F190-29B9E3110BB3}.Debug|x64.ActiveCfg = Debug|x64 {5BAAE7EA-A972-DD80-F190-29B9E3110BB3}.Debug|x64.ActiveCfg = Debug|x64
{5BAAE7EA-A972-DD80-F190-29B9E3110BB3}.Release|Win32.ActiveCfg = Release|Win32 {5BAAE7EA-A972-DD80-F190-29B9E3110BB3}.Release|Win32.ActiveCfg = Release|Win32

@ -276,7 +276,6 @@
<ClInclude Include="..\..\..\src\core\channel\context.h" /> <ClInclude Include="..\..\..\src\core\channel\context.h" />
<ClInclude Include="..\..\..\src\core\channel\http_client_filter.h" /> <ClInclude Include="..\..\..\src\core\channel\http_client_filter.h" />
<ClInclude Include="..\..\..\src\core\channel\http_server_filter.h" /> <ClInclude Include="..\..\..\src\core\channel\http_server_filter.h" />
<ClInclude Include="..\..\..\src\core\channel\noop_filter.h" />
<ClInclude Include="..\..\..\src\core\channel\subchannel_call_holder.h" /> <ClInclude Include="..\..\..\src\core\channel\subchannel_call_holder.h" />
<ClInclude Include="..\..\..\src\core\client_config\client_config.h" /> <ClInclude Include="..\..\..\src\core\client_config\client_config.h" />
<ClInclude Include="..\..\..\src\core\client_config\connector.h" /> <ClInclude Include="..\..\..\src\core\client_config\connector.h" />
@ -447,8 +446,6 @@
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\src\core\channel\http_server_filter.c"> <ClCompile Include="..\..\..\src\core\channel\http_server_filter.c">
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\src\core\channel\noop_filter.c">
</ClCompile>
<ClCompile Include="..\..\..\src\core\channel\subchannel_call_holder.c"> <ClCompile Include="..\..\..\src\core\channel\subchannel_call_holder.c">
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\src\core\client_config\client_config.c"> <ClCompile Include="..\..\..\src\core\client_config\client_config.c">

@ -94,9 +94,6 @@
<ClCompile Include="..\..\..\src\core\channel\http_server_filter.c"> <ClCompile Include="..\..\..\src\core\channel\http_server_filter.c">
<Filter>src\core\channel</Filter> <Filter>src\core\channel</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\src\core\channel\noop_filter.c">
<Filter>src\core\channel</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\core\channel\subchannel_call_holder.c"> <ClCompile Include="..\..\..\src\core\channel\subchannel_call_holder.c">
<Filter>src\core\channel</Filter> <Filter>src\core\channel</Filter>
</ClCompile> </ClCompile>
@ -545,9 +542,6 @@
<ClInclude Include="..\..\..\src\core\channel\http_server_filter.h"> <ClInclude Include="..\..\..\src\core\channel\http_server_filter.h">
<Filter>src\core\channel</Filter> <Filter>src\core\channel</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\src\core\channel\noop_filter.h">
<Filter>src\core\channel</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\core\channel\subchannel_call_holder.h"> <ClInclude Include="..\..\..\src\core\channel\subchannel_call_holder.h">
<Filter>src\core\channel</Filter> <Filter>src\core\channel</Filter>
</ClInclude> </ClInclude>

@ -255,7 +255,6 @@
<ClInclude Include="..\..\..\src\core\channel\context.h" /> <ClInclude Include="..\..\..\src\core\channel\context.h" />
<ClInclude Include="..\..\..\src\core\channel\http_client_filter.h" /> <ClInclude Include="..\..\..\src\core\channel\http_client_filter.h" />
<ClInclude Include="..\..\..\src\core\channel\http_server_filter.h" /> <ClInclude Include="..\..\..\src\core\channel\http_server_filter.h" />
<ClInclude Include="..\..\..\src\core\channel\noop_filter.h" />
<ClInclude Include="..\..\..\src\core\channel\subchannel_call_holder.h" /> <ClInclude Include="..\..\..\src\core\channel\subchannel_call_holder.h" />
<ClInclude Include="..\..\..\src\core\client_config\client_config.h" /> <ClInclude Include="..\..\..\src\core\client_config\client_config.h" />
<ClInclude Include="..\..\..\src\core\client_config\connector.h" /> <ClInclude Include="..\..\..\src\core\client_config\connector.h" />
@ -386,8 +385,6 @@
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\src\core\channel\http_server_filter.c"> <ClCompile Include="..\..\..\src\core\channel\http_server_filter.c">
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\src\core\channel\noop_filter.c">
</ClCompile>
<ClCompile Include="..\..\..\src\core\channel\subchannel_call_holder.c"> <ClCompile Include="..\..\..\src\core\channel\subchannel_call_holder.c">
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\src\core\client_config\client_config.c"> <ClCompile Include="..\..\..\src\core\client_config\client_config.c">

@ -34,9 +34,6 @@
<ClCompile Include="..\..\..\src\core\channel\http_server_filter.c"> <ClCompile Include="..\..\..\src\core\channel\http_server_filter.c">
<Filter>src\core\channel</Filter> <Filter>src\core\channel</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\src\core\channel\noop_filter.c">
<Filter>src\core\channel</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\core\channel\subchannel_call_holder.c"> <ClCompile Include="..\..\..\src\core\channel\subchannel_call_holder.c">
<Filter>src\core\channel</Filter> <Filter>src\core\channel</Filter>
</ClCompile> </ClCompile>
@ -443,9 +440,6 @@
<ClInclude Include="..\..\..\src\core\channel\http_server_filter.h"> <ClInclude Include="..\..\..\src\core\channel\http_server_filter.h">
<Filter>src\core\channel</Filter> <Filter>src\core\channel</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\..\src\core\channel\noop_filter.h">
<Filter>src\core\channel</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\core\channel\subchannel_call_holder.h"> <ClInclude Include="..\..\..\src\core\channel\subchannel_call_holder.h">
<Filter>src\core\channel</Filter> <Filter>src\core\channel</Filter>
</ClInclude> </ClInclude>

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\1.0.204.1.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{DD37D527-9DFF-1F53-B97F-50CF80AE0650}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration">
<PlatformToolset>v100</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration">
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\vsprojects\global.props" />
<Import Project="..\..\..\..\vsprojects\openssl.props" />
<Import Project="..\..\..\..\vsprojects\winsock.props" />
<Import Project="..\..\..\..\vsprojects\zlib.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>alloc_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>alloc_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\test\core\support\alloc_test.c">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\gpr_test_util\gpr_test_util.vcxproj">
<Project>{EAB0A629-17A9-44DB-B5FF-E91A721FE037}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\vsprojects\vcxproj\.\gpr\gpr.vcxproj">
<Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" />
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" />
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" />
<Import Project="..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets" Condition="Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" />
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" />
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" />
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" />
<Error Condition="!Exists('..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" />
</Target>
</Project>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\..\test\core\support\alloc_test.c">
<Filter>test\core\support</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="test">
<UniqueIdentifier>{8db8ec05-f062-e4a6-60a0-efa7208d4f9b}</UniqueIdentifier>
</Filter>
<Filter Include="test\core">
<UniqueIdentifier>{5d06003c-e2cd-4d48-87b3-dcb700cbb4e4}</UniqueIdentifier>
</Filter>
<Filter Include="test\core\support">
<UniqueIdentifier>{11853b15-8afe-b102-ee0d-6742942e3f6e}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
Loading…
Cancel
Save