Merge branch 'master' into node_new_core_api

pull/504/head
murgatroid99 10 years ago
commit d0e37cb958
  1. 7
      Makefile
  2. 41
      build.json
  3. 2
      include/grpc/support/port_platform.h
  4. 15
      src/core/httpcli/httpcli_security_context.c
  5. 197
      src/core/iomgr/pollset_multipoller_with_epoll.c
  6. 6
      src/core/iomgr/pollset_multipoller_with_poll_posix.c
  7. 11
      src/core/iomgr/pollset_posix.c
  8. 1
      src/core/iomgr/pollset_posix.h
  9. 130
      src/core/security/auth.c
  10. 3
      src/core/security/secure_transport_setup.c
  11. 177
      src/core/security/security_context.c
  12. 38
      src/core/security/security_context.h
  13. 54
      src/core/support/cpu_windows.c
  14. 2
      src/core/support/file_win32.c
  15. 7
      src/core/surface/secure_channel_create.c
  16. 4
      src/csharp/GrpcCore/GrpcEnvironment.cs
  17. 36
      src/csharp/GrpcCore/Internal/CallSafeHandle.cs
  18. 4
      src/csharp/GrpcCore/Internal/ChannelSafeHandle.cs
  19. 12
      src/csharp/GrpcCore/Internal/CompletionQueueSafeHandle.cs
  20. 37
      src/csharp/GrpcCore/Internal/Enums.cs
  21. 40
      src/csharp/GrpcCore/Internal/Event.cs
  22. 16
      src/csharp/GrpcCore/Internal/ServerSafeHandle.cs
  23. 2
      src/csharp/GrpcCore/Internal/Timespec.cs
  24. 115
      src/node/examples/perf_test.js
  25. 31
      src/python/src/_adapter/_c_test.py
  26. 4
      src/python/src/_adapter/_low_test.py
  27. 24
      src/python/src/_adapter/_server.c
  28. 2
      src/python/src/_adapter/fore.py
  29. 4
      templates/vsprojects/vs2013/build_and_run_tests.bat.template
  30. 4
      templates/vsprojects/vs2013/gpr.vcxproj.filters.template
  31. 2
      templates/vsprojects/vs2013/gpr_shared.vcxproj.filters.template
  32. 2
      templates/vsprojects/vs2013/gpr_shared.vcxproj.template
  33. 20
      templates/vsprojects/vs2013/grpc.sln.template
  34. 4
      templates/vsprojects/vs2013/grpc.vcxproj.filters.template
  35. 2
      templates/vsprojects/vs2013/grpc_csharp_ext.vcxproj.template
  36. 2
      templates/vsprojects/vs2013/grpc_csharp_ext_shared.vcxproj.template
  37. 2
      templates/vsprojects/vs2013/grpc_shared.vcxproj.filters.template
  38. 2
      templates/vsprojects/vs2013/grpc_shared.vcxproj.template
  39. 4
      templates/vsprojects/vs2013/grpc_unsecure.vcxproj.filters.template
  40. 2
      templates/vsprojects/vs2013/grpc_unsecure.vcxproj.template
  41. 2
      templates/vsprojects/vs2013/vcxproj.filters_defs.include
  42. 27
      templates/vsprojects/vs2013/vcxproj_defs.include
  43. 7
      test/core/end2end/dualstack_socket_test.c
  44. 4
      test/core/end2end/tests/cancel_after_accept.c
  45. 6
      test/core/end2end/tests/cancel_after_accept_and_writes_closed.c
  46. 4
      test/core/end2end/tests/cancel_after_accept_and_writes_closed_legacy.c
  47. 4
      test/core/end2end/tests/cancel_after_accept_legacy.c
  48. 4
      test/core/end2end/tests/cancel_after_invoke.c
  49. 2
      test/core/end2end/tests/cancel_after_invoke_legacy.c
  50. 4
      test/core/end2end/tests/cancel_before_invoke.c
  51. 2
      test/core/end2end/tests/cancel_before_invoke_legacy.c
  52. 4
      test/core/end2end/tests/cancel_in_a_vacuum.c
  53. 2
      test/core/end2end/tests/cancel_in_a_vacuum_legacy.c
  54. 4
      test/core/end2end/tests/census_simple_request.c
  55. 4
      test/core/end2end/tests/census_simple_request_legacy.c
  56. 6
      test/core/end2end/tests/disappearing_server.c
  57. 4
      test/core/end2end/tests/disappearing_server_legacy.c
  58. 6
      test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls.c
  59. 4
      test/core/end2end/tests/early_server_shutdown_finishes_inflight_calls_legacy.c
  60. 6
      test/core/end2end/tests/graceful_server_shutdown.c
  61. 4
      test/core/end2end/tests/graceful_server_shutdown_legacy.c
  62. 6
      test/core/end2end/tests/invoke_large_request.c
  63. 4
      test/core/end2end/tests/invoke_large_request_legacy.c
  64. 14
      test/core/end2end/tests/max_concurrent_streams.c
  65. 12
      test/core/end2end/tests/max_concurrent_streams_legacy.c
  66. 6
      test/core/end2end/tests/ping_pong_streaming.c
  67. 4
      test/core/end2end/tests/ping_pong_streaming_legacy.c
  68. 6
      test/core/end2end/tests/request_response_with_binary_metadata_and_payload.c
  69. 4
      test/core/end2end/tests/request_response_with_binary_metadata_and_payload_legacy.c
  70. 6
      test/core/end2end/tests/request_response_with_metadata_and_payload.c
  71. 4
      test/core/end2end/tests/request_response_with_metadata_and_payload_legacy.c
  72. 6
      test/core/end2end/tests/request_response_with_payload.c
  73. 4
      test/core/end2end/tests/request_response_with_payload_legacy.c
  74. 6
      test/core/end2end/tests/request_response_with_trailing_metadata_and_payload.c
  75. 4
      test/core/end2end/tests/request_response_with_trailing_metadata_and_payload_legacy.c
  76. 6
      test/core/end2end/tests/request_with_large_metadata.c
  77. 4
      test/core/end2end/tests/request_with_large_metadata_legacy.c
  78. 6
      test/core/end2end/tests/request_with_payload.c
  79. 4
      test/core/end2end/tests/request_with_payload_legacy.c
  80. 6
      test/core/end2end/tests/simple_delayed_request.c
  81. 4
      test/core/end2end/tests/simple_delayed_request_legacy.c
  82. 6
      test/core/end2end/tests/simple_request.c
  83. 8
      test/core/end2end/tests/simple_request_legacy.c
  84. 2
      test/core/end2end/tests/thread_stress.c
  85. 2
      test/core/end2end/tests/thread_stress_legacy.c
  86. 6
      test/core/end2end/tests/writes_done_hangs_with_pending_read.c
  87. 6
      test/core/end2end/tests/writes_done_hangs_with_pending_read_legacy.c
  88. 1
      test/core/iomgr/tcp_client_posix_test.c
  89. 1
      tools/buildgen/build-cleaner.py
  90. 8
      tools/dockerfile/grpc_java_base/Dockerfile
  91. 9
      tools/run_tests/run_tests.py
  92. 3
      vsprojects/vs2013/.gitignore
  93. 56
      vsprojects/vs2013/build_and_run_tests.bat
  94. 9
      vsprojects/vs2013/gpr.vcxproj
  95. 3
      vsprojects/vs2013/gpr.vcxproj.filters
  96. 184
      vsprojects/vs2013/gpr_shared.vcxproj
  97. 214
      vsprojects/vs2013/gpr_shared.vcxproj.filters
  98. 7
      vsprojects/vs2013/gpr_test_util.vcxproj
  99. 28
      vsprojects/vs2013/grpc.sln
  100. 9
      vsprojects/vs2013/grpc.vcxproj
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1684,6 +1684,7 @@ LIBGPR_SRC = \
src/core/support/cmdline.c \
src/core/support/cpu_linux.c \
src/core/support/cpu_posix.c \
src/core/support/cpu_windows.c \
src/core/support/env_linux.c \
src/core/support/env_posix.c \
src/core/support/env_win32.c \
@ -1776,6 +1777,7 @@ objs/$(CONFIG)/src/core/support/cancellable.o:
objs/$(CONFIG)/src/core/support/cmdline.o:
objs/$(CONFIG)/src/core/support/cpu_linux.o:
objs/$(CONFIG)/src/core/support/cpu_posix.o:
objs/$(CONFIG)/src/core/support/cpu_windows.o:
objs/$(CONFIG)/src/core/support/env_linux.o:
objs/$(CONFIG)/src/core/support/env_posix.o:
objs/$(CONFIG)/src/core/support/env_win32.o:
@ -1892,6 +1894,7 @@ LIBGRPC_SRC = \
src/core/iomgr/iomgr_windows.c \
src/core/iomgr/pollset_kick.c \
src/core/iomgr/pollset_multipoller_with_poll_posix.c \
src/core/iomgr/pollset_multipoller_with_epoll.c \
src/core/iomgr/pollset_posix.c \
src/core/iomgr/pollset_windows.c \
src/core/iomgr/resolve_address.c \
@ -2027,6 +2030,7 @@ src/core/iomgr/iomgr_posix.c: $(OPENSSL_DEP)
src/core/iomgr/iomgr_windows.c: $(OPENSSL_DEP)
src/core/iomgr/pollset_kick.c: $(OPENSSL_DEP)
src/core/iomgr/pollset_multipoller_with_poll_posix.c: $(OPENSSL_DEP)
src/core/iomgr/pollset_multipoller_with_epoll.c: $(OPENSSL_DEP)
src/core/iomgr/pollset_posix.c: $(OPENSSL_DEP)
src/core/iomgr/pollset_windows.c: $(OPENSSL_DEP)
src/core/iomgr/resolve_address.c: $(OPENSSL_DEP)
@ -2184,6 +2188,7 @@ objs/$(CONFIG)/src/core/iomgr/iomgr_posix.o:
objs/$(CONFIG)/src/core/iomgr/iomgr_windows.o:
objs/$(CONFIG)/src/core/iomgr/pollset_kick.o:
objs/$(CONFIG)/src/core/iomgr/pollset_multipoller_with_poll_posix.o:
objs/$(CONFIG)/src/core/iomgr/pollset_multipoller_with_epoll.o:
objs/$(CONFIG)/src/core/iomgr/pollset_posix.o:
objs/$(CONFIG)/src/core/iomgr/pollset_windows.o:
objs/$(CONFIG)/src/core/iomgr/resolve_address.o:
@ -2425,6 +2430,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/iomgr/iomgr_windows.c \
src/core/iomgr/pollset_kick.c \
src/core/iomgr/pollset_multipoller_with_poll_posix.c \
src/core/iomgr/pollset_multipoller_with_epoll.c \
src/core/iomgr/pollset_posix.c \
src/core/iomgr/pollset_windows.c \
src/core/iomgr/resolve_address.c \
@ -2565,6 +2571,7 @@ objs/$(CONFIG)/src/core/iomgr/iomgr_posix.o:
objs/$(CONFIG)/src/core/iomgr/iomgr_windows.o:
objs/$(CONFIG)/src/core/iomgr/pollset_kick.o:
objs/$(CONFIG)/src/core/iomgr/pollset_multipoller_with_poll_posix.o:
objs/$(CONFIG)/src/core/iomgr/pollset_multipoller_with_epoll.o:
objs/$(CONFIG)/src/core/iomgr/pollset_posix.o:
objs/$(CONFIG)/src/core/iomgr/pollset_windows.o:
objs/$(CONFIG)/src/core/iomgr/resolve_address.o:

@ -139,6 +139,7 @@
"src/core/iomgr/iomgr_windows.c",
"src/core/iomgr/pollset_kick.c",
"src/core/iomgr/pollset_multipoller_with_poll_posix.c",
"src/core/iomgr/pollset_multipoller_with_epoll.c",
"src/core/iomgr/pollset_posix.c",
"src/core/iomgr/pollset_windows.c",
"src/core/iomgr/resolve_address.c",
@ -252,6 +253,7 @@
"src/core/support/cmdline.c",
"src/core/support/cpu_linux.c",
"src/core/support/cpu_posix.c",
"src/core/support/cpu_windows.c",
"src/core/support/env_linux.c",
"src/core/support/env_posix.c",
"src/core/support/env_win32.c",
@ -347,7 +349,8 @@
"deps": [
"gpr",
"grpc"
]
],
"vs_project_guid": "{D64C6D63-4458-4A88-AB38-35678384A7E4}"
},
{
"name": "grpc_test_util",
@ -758,6 +761,7 @@
{
"name": "echo_client",
"build": "test",
"run": false,
"language": "c",
"src": [
"test/core/echo/client.c"
@ -767,12 +771,12 @@
"grpc",
"gpr_test_util",
"gpr"
],
"run": false
]
},
{
"name": "echo_server",
"build": "test",
"run": false,
"language": "c",
"src": [
"test/core/echo/server.c"
@ -782,8 +786,7 @@
"grpc",
"gpr_test_util",
"gpr"
],
"run": false
]
},
{
"name": "echo_test",
@ -816,6 +819,7 @@
{
"name": "fling_client",
"build": "test",
"run": false,
"language": "c",
"src": [
"test/core/fling/client.c"
@ -825,12 +829,12 @@
"grpc",
"gpr_test_util",
"gpr"
],
"run": false
]
},
{
"name": "fling_server",
"build": "test",
"run": false,
"language": "c",
"src": [
"test/core/fling/server.c"
@ -840,8 +844,7 @@
"grpc",
"gpr_test_util",
"gpr"
],
"run": false
]
},
{
"name": "fling_stream_test",
@ -1251,6 +1254,7 @@
{
"name": "json_rewrite",
"build": "test",
"run": false,
"language": "c",
"src": [
"test/core/json/json_rewrite.c"
@ -1258,12 +1262,12 @@
"deps": [
"grpc",
"gpr"
],
"run": false
]
},
{
"name": "json_rewrite_test",
"build": "test",
"run": false,
"language": "c",
"src": [
"test/core/json/json_rewrite_test.c"
@ -1273,8 +1277,7 @@
"grpc",
"gpr_test_util",
"gpr"
],
"run": false
]
},
{
"name": "json_test",
@ -1586,6 +1589,7 @@
{
"name": "interop_client",
"build": "test",
"run": false,
"language": "c++",
"src": [
"test/cpp/interop/empty.proto",
@ -1600,12 +1604,12 @@
"grpc",
"gpr_test_util",
"gpr"
],
"run": false
]
},
{
"name": "interop_server",
"build": "test",
"run": false,
"language": "c++",
"src": [
"test/cpp/interop/empty.proto",
@ -1620,8 +1624,7 @@
"grpc",
"gpr_test_util",
"gpr"
],
"run": false
]
},
{
"name": "qps_client",
@ -1725,6 +1728,7 @@
{
"name": "tips_client",
"build": "test",
"run": false,
"language": "c++",
"src": [
"examples/tips/main.cc"
@ -1737,8 +1741,7 @@
"grpc",
"gpr_test_util",
"gpr"
],
"run": false
]
},
{
"name": "tips_publisher_test",

@ -73,7 +73,7 @@
#define GPR_CPU_LINUX 1
#define GPR_GCC_ATOMIC 1
#define GPR_LINUX 1
#define GPR_POSIX_MULTIPOLL_WITH_POLL 1
#define GPR_LINUX_MULTIPOLL_WITH_EPOLL 1
#define GPR_POSIX_WAKEUP_FD 1
#define GPR_LINUX_EVENTFD 1
#define GPR_POSIX_SOCKET 1

@ -73,20 +73,23 @@ static grpc_security_status httpcli_ssl_create_handshaker(
return GRPC_SECURITY_OK;
}
static grpc_security_status httpcli_ssl_check_peer(
grpc_security_context *ctx, const tsi_peer *peer,
grpc_security_check_peer_cb cb, void *user_data) {
static grpc_security_status httpcli_ssl_check_peer(grpc_security_context *ctx,
tsi_peer peer,
grpc_security_check_cb cb,
void *user_data) {
grpc_httpcli_ssl_channel_security_context *c =
(grpc_httpcli_ssl_channel_security_context *)ctx;
grpc_security_status status = GRPC_SECURITY_OK;
/* Check the peer name. */
if (c->secure_peer_name != NULL &&
!tsi_ssl_peer_matches_name(peer, c->secure_peer_name)) {
!tsi_ssl_peer_matches_name(&peer, c->secure_peer_name)) {
gpr_log(GPR_ERROR, "Peer name %s is not in peer certificate",
c->secure_peer_name);
return GRPC_SECURITY_ERROR;
status = GRPC_SECURITY_ERROR;
}
return GRPC_SECURITY_OK;
tsi_peer_destruct(&peer);
return status;
}
static grpc_security_context_vtable httpcli_ssl_vtable = {

@ -0,0 +1,197 @@
/*
*
* 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 <grpc/support/port_platform.h>
#ifdef GPR_LINUX_MULTIPOLL_WITH_EPOLL
#include <errno.h>
#include <string.h>
#include <sys/epoll.h>
#include <unistd.h>
#include "src/core/iomgr/fd_posix.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
typedef struct {
int epoll_fd;
grpc_wakeup_fd_info wakeup_fd;
} pollset_hdr;
static void multipoll_with_epoll_pollset_add_fd(grpc_pollset *pollset,
grpc_fd *fd) {
pollset_hdr *h = pollset->data.ptr;
struct epoll_event ev;
int err;
ev.events = EPOLLIN | EPOLLOUT | EPOLLET;
ev.data.ptr = fd;
err = epoll_ctl(h->epoll_fd, EPOLL_CTL_ADD, fd->fd, &ev);
if (err < 0) {
/* FDs may be added to a pollset multiple times, so EEXIST is normal. */
if (errno != EEXIST) {
gpr_log(GPR_ERROR, "epoll_ctl add for %d failed: %s", fd->fd,
strerror(errno));
}
}
}
static void multipoll_with_epoll_pollset_del_fd(grpc_pollset *pollset,
grpc_fd *fd) {
pollset_hdr *h = pollset->data.ptr;
int err;
/* Note that this can race with concurrent poll, but that should be fine since
* at worst it creates a spurious read event on a reused grpc_fd object. */
err = epoll_ctl(h->epoll_fd, EPOLL_CTL_DEL, fd->fd, NULL);
if (err < 0) {
gpr_log(GPR_ERROR, "epoll_ctl del for %d failed: %s", fd->fd,
strerror(errno));
}
}
/* TODO(klempner): We probably want to turn this down a bit */
#define GRPC_EPOLL_MAX_EVENTS 1000
static int multipoll_with_epoll_pollset_maybe_work(
grpc_pollset *pollset, gpr_timespec deadline, gpr_timespec now,
int allow_synchronous_callback) {
struct epoll_event ep_ev[GRPC_EPOLL_MAX_EVENTS];
int ep_rv;
pollset_hdr *h = pollset->data.ptr;
int timeout_ms;
/* If you want to ignore epoll's ability to sanely handle parallel pollers,
* for a more apples-to-apples performance comparison with poll, add a
* if (pollset->counter == 0) { return 0 }
* here.
*/
if (gpr_time_cmp(deadline, gpr_inf_future) == 0) {
timeout_ms = -1;
} else {
timeout_ms = gpr_time_to_millis(gpr_time_sub(deadline, now));
if (timeout_ms <= 0) {
return 1;
}
}
pollset->counter += 1;
gpr_mu_unlock(&pollset->mu);
do {
ep_rv = epoll_wait(h->epoll_fd, ep_ev, GRPC_EPOLL_MAX_EVENTS, timeout_ms);
if (ep_rv < 0) {
if (errno != EINTR) {
gpr_log(GPR_ERROR, "epoll_wait() failed: %s", strerror(errno));
}
} else {
int i;
for (i = 0; i < ep_rv; ++i) {
if (ep_ev[i].data.ptr == 0) {
grpc_wakeup_fd_consume_wakeup(&h->wakeup_fd);
} else {
grpc_fd *fd = ep_ev[i].data.ptr;
/* TODO(klempner): We might want to consider making err and pri
* separate events */
int cancel = ep_ev[i].events & (EPOLLERR | EPOLLHUP);
int read = ep_ev[i].events & (EPOLLIN | EPOLLPRI);
int write = ep_ev[i].events & EPOLLOUT;
if (read || cancel) {
grpc_fd_become_readable(fd, allow_synchronous_callback);
}
if (write || cancel) {
grpc_fd_become_writable(fd, allow_synchronous_callback);
}
}
}
}
timeout_ms = 0;
} while (ep_rv == GRPC_EPOLL_MAX_EVENTS);
gpr_mu_lock(&pollset->mu);
pollset->counter -= 1;
/* TODO(klempner): This should signal once per event rather than broadcast,
* although it probably doesn't matter because threads will generally be
* blocked in epoll_wait rather than being blocked on the cv. */
gpr_cv_broadcast(&pollset->cv);
return 1;
}
static void multipoll_with_epoll_pollset_destroy(grpc_pollset *pollset) {
pollset_hdr *h = pollset->data.ptr;
grpc_wakeup_fd_destroy(&h->wakeup_fd);
close(h->epoll_fd);
gpr_free(h);
}
static void epoll_kick(grpc_pollset *pollset) {
pollset_hdr *h = pollset->data.ptr;
grpc_wakeup_fd_wakeup(&h->wakeup_fd);
}
static const grpc_pollset_vtable multipoll_with_epoll_pollset = {
multipoll_with_epoll_pollset_add_fd, multipoll_with_epoll_pollset_del_fd,
multipoll_with_epoll_pollset_maybe_work, epoll_kick,
multipoll_with_epoll_pollset_destroy};
void grpc_platform_become_multipoller(grpc_pollset *pollset, grpc_fd **fds,
size_t nfds) {
size_t i;
pollset_hdr *h = gpr_malloc(sizeof(pollset_hdr));
struct epoll_event ev;
int err;
pollset->vtable = &multipoll_with_epoll_pollset;
pollset->data.ptr = h;
h->epoll_fd = epoll_create1(EPOLL_CLOEXEC);
if (h->epoll_fd < 0) {
/* TODO(klempner): Fall back to poll here, especially on ENOSYS */
gpr_log(GPR_ERROR, "epoll_create1 failed: %s", strerror(errno));
abort();
}
for (i = 0; i < nfds; i++) {
multipoll_with_epoll_pollset_add_fd(pollset, fds[i]);
}
grpc_wakeup_fd_create(&h->wakeup_fd);
ev.events = EPOLLIN;
ev.data.ptr = 0;
err = epoll_ctl(h->epoll_fd, EPOLL_CTL_ADD,
GRPC_WAKEUP_FD_GET_READ_FD(&h->wakeup_fd), &ev);
if (err < 0) {
gpr_log(GPR_ERROR, "Wakeup fd epoll_ctl failed: %s", strerror(errno));
abort();
}
}
#endif /* GPR_LINUX_MULTIPOLL_WITH_EPOLL */

@ -200,6 +200,10 @@ static int multipoll_with_poll_pollset_maybe_work(
return 1;
}
static void multipoll_with_poll_pollset_kick(grpc_pollset *p) {
grpc_pollset_kick_kick(&p->kick_state);
}
static void multipoll_with_poll_pollset_destroy(grpc_pollset *pollset) {
size_t i;
pollset_hdr *h = pollset->data.ptr;
@ -219,7 +223,7 @@ static void multipoll_with_poll_pollset_destroy(grpc_pollset *pollset) {
static const grpc_pollset_vtable multipoll_with_poll_pollset = {
multipoll_with_poll_pollset_add_fd, multipoll_with_poll_pollset_del_fd,
multipoll_with_poll_pollset_maybe_work,
multipoll_with_poll_pollset_maybe_work, multipoll_with_poll_pollset_kick,
multipoll_with_poll_pollset_destroy};
void grpc_platform_become_multipoller(grpc_pollset *pollset, grpc_fd **fds,

@ -76,7 +76,7 @@ static void backup_poller(void *p) {
void grpc_pollset_kick(grpc_pollset *p) {
if (p->counter) {
grpc_pollset_kick_kick(&p->kick_state);
p->vtable->kick(p);
}
}
@ -84,6 +84,10 @@ void grpc_pollset_force_kick(grpc_pollset *p) {
grpc_pollset_kick_kick(&p->kick_state);
}
static void kick_using_pollset_kick(grpc_pollset *p) {
grpc_pollset_kick_kick(&p->kick_state);
}
/* global state management */
grpc_pollset *grpc_backup_pollset(void) { return &g_backup_pollset; }
@ -186,7 +190,7 @@ static void empty_pollset_destroy(grpc_pollset *pollset) {}
static const grpc_pollset_vtable empty_pollset = {
empty_pollset_add_fd, empty_pollset_del_fd, empty_pollset_maybe_work,
empty_pollset_destroy};
kick_using_pollset_kick, empty_pollset_destroy};
static void become_empty_pollset(grpc_pollset *pollset) {
pollset->vtable = &empty_pollset;
@ -296,7 +300,8 @@ static void unary_poll_pollset_destroy(grpc_pollset *pollset) {
static const grpc_pollset_vtable unary_poll_pollset = {
unary_poll_pollset_add_fd, unary_poll_pollset_del_fd,
unary_poll_pollset_maybe_work, unary_poll_pollset_destroy};
unary_poll_pollset_maybe_work, kick_using_pollset_kick,
unary_poll_pollset_destroy};
static void become_unary_pollset(grpc_pollset *pollset, grpc_fd *fd) {
pollset->vtable = &unary_poll_pollset;

@ -66,6 +66,7 @@ struct grpc_pollset_vtable {
void (*del_fd)(grpc_pollset *pollset, struct grpc_fd *fd);
int (*maybe_work)(grpc_pollset *pollset, gpr_timespec deadline,
gpr_timespec now, int allow_synchronous_callback);
void (*kick)(grpc_pollset *pollset);
void (*destroy)(grpc_pollset *pollset);
};

@ -35,22 +35,49 @@
#include <string.h>
#include "src/core/security/security_context.h"
#include "src/core/security/credentials.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/support/string.h"
#include "src/core/channel/channel_stack.h"
#include "src/core/security/security_context.h"
#include "src/core/security/credentials.h"
#include "src/core/surface/call.h"
/* We can have a per-call credentials. */
typedef struct {
grpc_credentials *creds;
grpc_mdstr *host;
grpc_call_op op;
} call_data;
/* We can have a per-channel credentials. */
typedef struct {
grpc_channel_security_context *security_context;
grpc_mdctx *md_ctx;
grpc_mdstr *authority_string;
grpc_mdstr *error_msg_key;
} channel_data;
static void do_nothing(void *ignored, grpc_op_error error) {}
static void bubbleup_error(grpc_call_element *elem, const char *error_msg) {
grpc_call_op finish_op;
channel_data *channeld = elem->channel_data;
gpr_log(GPR_ERROR, "%s", error_msg);
finish_op.type = GRPC_RECV_METADATA;
finish_op.dir = GRPC_CALL_UP;
finish_op.flags = 0;
finish_op.data.metadata = grpc_mdelem_from_metadata_strings(
channeld->md_ctx, channeld->error_msg_key,
grpc_mdstr_from_string(channeld->md_ctx, error_msg));
finish_op.done_cb = do_nothing;
finish_op.user_data = NULL;
grpc_call_next_op(elem, &finish_op);
grpc_call_element_send_cancel(elem);
}
static void on_credentials_metadata(void *user_data, grpc_mdelem **md_elems,
size_t num_md,
grpc_credentials_status status) {
@ -62,6 +89,46 @@ static void on_credentials_metadata(void *user_data, grpc_mdelem **md_elems,
grpc_call_next_op(elem, &((call_data *)elem->call_data)->op);
}
static void send_security_metadata(grpc_call_element *elem, grpc_call_op *op) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
grpc_credentials *channel_creds =
channeld->security_context->request_metadata_creds;
/* TODO(jboeuf):
Decide on the policy in this case:
- populate both channel and call?
- the call takes precedence over the channel?
- leave this decision up to the channel credentials? */
if (calld->creds != NULL) {
gpr_log(GPR_ERROR, "Ignoring per call credentials for now.");
}
if (channel_creds != NULL &&
grpc_credentials_has_request_metadata(channel_creds)) {
calld->op = *op; /* Copy op (originates from the caller's stack). */
grpc_credentials_get_request_metadata(channel_creds,
on_credentials_metadata, elem);
} else {
grpc_call_next_op(elem, op);
}
}
static void on_host_checked(void *user_data, grpc_security_status status) {
grpc_call_element *elem = (grpc_call_element *)user_data;
call_data *calld = elem->call_data;
if (status == GRPC_SECURITY_OK) {
send_security_metadata(elem, &calld->op);
} else {
char *error_msg;
gpr_asprintf(&error_msg, "Invalid host %s set in :authority metadata.",
grpc_mdstr_as_c_string(calld->host));
bubbleup_error(elem, error_msg);
gpr_free(error_msg);
}
}
/* 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
@ -74,26 +141,36 @@ static void call_op(grpc_call_element *elem, grpc_call_element *from_elem,
channel_data *channeld = elem->channel_data;
switch (op->type) {
case GRPC_SEND_START: {
grpc_credentials *channel_creds =
channeld->security_context->request_metadata_creds;
/* TODO(jboeuf):
Decide on the policy in this case:
- populate both channel and call?
- the call takes precedence over the channel?
- leave this decision up to the channel credentials? */
if (calld->creds != NULL) {
gpr_log(GPR_ERROR, "Ignoring per call credentials for now.");
case GRPC_SEND_METADATA:
/* Pointer comparison is OK for md_elems created from the same context. */
if (op->data.metadata->key == channeld->authority_string) {
if (calld->host != NULL) grpc_mdstr_unref(calld->host);
calld->host = grpc_mdstr_ref(op->data.metadata->value);
}
if (channel_creds != NULL &&
grpc_credentials_has_request_metadata(channel_creds)) {
grpc_call_next_op(elem, op);
break;
case GRPC_SEND_START:
if (calld->host != NULL) {
grpc_security_status status;
const char *call_host = grpc_mdstr_as_c_string(calld->host);
calld->op = *op; /* Copy op (originates from the caller's stack). */
grpc_credentials_get_request_metadata(channel_creds,
on_credentials_metadata, elem);
break;
status = grpc_channel_security_context_check_call_host(
channeld->security_context, call_host, on_host_checked, elem);
if (status != GRPC_SECURITY_OK) {
if (status == GRPC_SECURITY_ERROR) {
char *error_msg;
gpr_asprintf(&error_msg,
"Invalid host %s set in :authority metadata.",
call_host);
bubbleup_error(elem, error_msg);
gpr_free(error_msg);
}
break;
}
}
/* FALLTHROUGH INTENDED. */
}
send_security_metadata(elem, op);
break;
default:
/* pass control up or down the stack depending on op->dir */
@ -116,6 +193,7 @@ static void init_call_elem(grpc_call_element *elem,
Find a way to pass-in the credentials from the caller here. */
call_data *calld = elem->call_data;
calld->creds = NULL;
calld->host = NULL;
}
/* Destructor for call_data */
@ -124,6 +202,9 @@ static void destroy_call_elem(grpc_call_element *elem) {
if (calld->creds != NULL) {
grpc_credentials_unref(calld->creds);
}
if (calld->host != NULL) {
grpc_mdstr_unref(calld->host);
}
}
/* Constructor for channel_data */
@ -146,6 +227,11 @@ static void init_channel_elem(grpc_channel_element *elem,
GPR_ASSERT(ctx->is_client_side);
channeld->security_context =
(grpc_channel_security_context *)grpc_security_context_ref(ctx);
channeld->md_ctx = metadata_context;
channeld->authority_string =
grpc_mdstr_from_string(channeld->md_ctx, ":authority");
channeld->error_msg_key =
grpc_mdstr_from_string(channeld->md_ctx, "grpc-message");
}
/* Destructor for channel data */
@ -154,6 +240,12 @@ static void destroy_channel_elem(grpc_channel_element *elem) {
channel_data *channeld = elem->channel_data;
grpc_channel_security_context *ctx = channeld->security_context;
if (ctx != NULL) grpc_security_context_unref(&ctx->base);
if (channeld->authority_string != NULL) {
grpc_mdstr_unref(channeld->authority_string);
}
if (channeld->error_msg_key != NULL) {
grpc_mdstr_unref(channeld->error_msg_key);
}
}
const grpc_channel_filter grpc_client_auth_filter = {

@ -113,8 +113,7 @@ static void check_peer(grpc_secure_transport_setup *s) {
return;
}
peer_status =
grpc_security_context_check_peer(s->ctx, &peer, on_peer_checked, s);
tsi_peer_destruct(&peer);
grpc_security_context_check_peer(s->ctx, peer, on_peer_checked, s);
if (peer_status == GRPC_SECURITY_ERROR) {
gpr_log(GPR_ERROR, "Peer check failed.");
secure_transport_setup_done(s, 0);

@ -69,12 +69,22 @@ grpc_security_status grpc_security_context_create_handshaker(
}
grpc_security_status grpc_security_context_check_peer(
grpc_security_context *ctx, const tsi_peer *peer,
grpc_security_check_peer_cb cb, void *user_data) {
if (ctx == NULL) return GRPC_SECURITY_ERROR;
grpc_security_context *ctx, tsi_peer peer, grpc_security_check_cb cb,
void *user_data) {
if (ctx == NULL) {
tsi_peer_destruct(&peer);
return GRPC_SECURITY_ERROR;
}
return ctx->vtable->check_peer(ctx, peer, cb, user_data);
}
grpc_security_status grpc_channel_security_context_check_call_host(
grpc_channel_security_context *ctx, const char *host,
grpc_security_check_cb cb, void *user_data) {
if (ctx == NULL || ctx->check_call_host == NULL) return GRPC_SECURITY_ERROR;
return ctx->check_call_host(ctx, host, cb, user_data);
}
void grpc_security_context_unref(grpc_security_context *ctx) {
if (ctx == NULL) return;
if (gpr_unref(&ctx->refcount)) ctx->vtable->destroy(ctx);
@ -137,6 +147,11 @@ static int check_request_metadata_creds(grpc_credentials *creds) {
/* -- Fake implementation. -- */
typedef struct {
grpc_channel_security_context base;
int call_host_check_is_async;
} grpc_fake_channel_security_context;
static void fake_channel_destroy(grpc_security_context *ctx) {
grpc_channel_security_context *c = (grpc_channel_security_context *)ctx;
grpc_credentials_unref(c->request_metadata_creds);
@ -158,31 +173,51 @@ static grpc_security_status fake_server_create_handshaker(
}
static grpc_security_status fake_check_peer(grpc_security_context *ctx,
const tsi_peer *peer,
grpc_security_check_peer_cb cb,
tsi_peer peer,
grpc_security_check_cb cb,
void *user_data) {
const char *prop_name;
if (peer->property_count != 1) {
grpc_security_status status = GRPC_SECURITY_OK;
if (peer.property_count != 1) {
gpr_log(GPR_ERROR, "Fake peers should only have 1 property.");
return GRPC_SECURITY_ERROR;
status = GRPC_SECURITY_ERROR;
goto end;
}
prop_name = peer->properties[0].name;
prop_name = peer.properties[0].name;
if (prop_name == NULL ||
strcmp(prop_name, TSI_CERTIFICATE_TYPE_PEER_PROPERTY)) {
gpr_log(GPR_ERROR, "Unexpected property in fake peer: %s.",
prop_name == NULL ? "<EMPTY>" : prop_name);
return GRPC_SECURITY_ERROR;
status = GRPC_SECURITY_ERROR;
goto end;
}
if (peer->properties[0].type != TSI_PEER_PROPERTY_TYPE_STRING) {
if (peer.properties[0].type != TSI_PEER_PROPERTY_TYPE_STRING) {
gpr_log(GPR_ERROR, "Invalid type of cert type property.");
return GRPC_SECURITY_ERROR;
status = GRPC_SECURITY_ERROR;
goto end;
}
if (strncmp(peer->properties[0].value.string.data, TSI_FAKE_CERTIFICATE_TYPE,
peer->properties[0].value.string.length)) {
if (strncmp(peer.properties[0].value.string.data, TSI_FAKE_CERTIFICATE_TYPE,
peer.properties[0].value.string.length)) {
gpr_log(GPR_ERROR, "Invalid value for cert type property.");
return GRPC_SECURITY_ERROR;
status = GRPC_SECURITY_ERROR;
goto end;
}
end:
tsi_peer_destruct(&peer);
return status;
}
static grpc_security_status fake_channel_check_call_host(
grpc_channel_security_context *ctx, const char *host,
grpc_security_check_cb cb, void *user_data) {
grpc_fake_channel_security_context *c =
(grpc_fake_channel_security_context *)ctx;
if (c->call_host_check_is_async) {
cb(user_data, GRPC_SECURITY_OK);
return GRPC_SECURITY_PENDING;
} else {
return GRPC_SECURITY_OK;
}
return GRPC_SECURITY_OK;
}
static grpc_security_context_vtable fake_channel_vtable = {
@ -192,15 +227,17 @@ static grpc_security_context_vtable fake_server_vtable = {
fake_server_destroy, fake_server_create_handshaker, fake_check_peer};
grpc_channel_security_context *grpc_fake_channel_security_context_create(
grpc_credentials *request_metadata_creds) {
grpc_channel_security_context *c =
gpr_malloc(sizeof(grpc_channel_security_context));
gpr_ref_init(&c->base.refcount, 1);
c->base.is_client_side = 1;
c->base.vtable = &fake_channel_vtable;
grpc_credentials *request_metadata_creds, int call_host_check_is_async) {
grpc_fake_channel_security_context *c =
gpr_malloc(sizeof(grpc_fake_channel_security_context));
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.is_client_side = 1;
c->base.base.vtable = &fake_channel_vtable;
GPR_ASSERT(check_request_metadata_creds(request_metadata_creds));
c->request_metadata_creds = grpc_credentials_ref(request_metadata_creds);
return c;
c->base.request_metadata_creds = grpc_credentials_ref(request_metadata_creds);
c->base.check_call_host = fake_channel_check_call_host;
c->call_host_check_is_async = call_host_check_is_async;
return &c->base;
}
grpc_security_context *grpc_fake_server_security_context_create(void) {
@ -215,7 +252,9 @@ grpc_security_context *grpc_fake_server_security_context_create(void) {
typedef struct {
grpc_channel_security_context base;
tsi_ssl_handshaker_factory *handshaker_factory;
char *secure_peer_name;
char *target_name;
char *overridden_target_name;
tsi_peer peer;
} grpc_ssl_channel_security_context;
typedef struct {
@ -230,7 +269,9 @@ static void ssl_channel_destroy(grpc_security_context *ctx) {
if (c->handshaker_factory != NULL) {
tsi_ssl_handshaker_factory_destroy(c->handshaker_factory);
}
if (c->secure_peer_name != NULL) gpr_free(c->secure_peer_name);
if (c->target_name != NULL) gpr_free(c->target_name);
if (c->overridden_target_name != NULL) gpr_free(c->overridden_target_name);
tsi_peer_destruct(&c->peer);
gpr_free(ctx);
}
@ -244,11 +285,11 @@ static void ssl_server_destroy(grpc_security_context *ctx) {
static grpc_security_status ssl_create_handshaker(
tsi_ssl_handshaker_factory *handshaker_factory, int is_client,
const char *secure_peer_name, tsi_handshaker **handshaker) {
const char *peer_name, tsi_handshaker **handshaker) {
tsi_result result = TSI_OK;
if (handshaker_factory == NULL) return GRPC_SECURITY_ERROR;
result = tsi_ssl_handshaker_factory_create_handshaker(
handshaker_factory, is_client ? secure_peer_name : NULL, handshaker);
handshaker_factory, is_client ? peer_name : NULL, handshaker);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
tsi_result_to_string(result));
@ -261,7 +302,10 @@ static grpc_security_status ssl_channel_create_handshaker(
grpc_security_context *ctx, tsi_handshaker **handshaker) {
grpc_ssl_channel_security_context *c =
(grpc_ssl_channel_security_context *)ctx;
return ssl_create_handshaker(c->handshaker_factory, 1, c->secure_peer_name,
return ssl_create_handshaker(c->handshaker_factory, 1,
c->overridden_target_name != NULL
? c->overridden_target_name
: c->target_name,
handshaker);
}
@ -271,7 +315,7 @@ static grpc_security_status ssl_server_create_handshaker(
return ssl_create_handshaker(c->handshaker_factory, 0, NULL, handshaker);
}
static grpc_security_status ssl_check_peer(const char *secure_peer_name,
static grpc_security_status ssl_check_peer(const char *peer_name,
const tsi_peer *peer) {
/* Check the ALPN. */
const tsi_peer_property *p =
@ -291,28 +335,54 @@ static grpc_security_status ssl_check_peer(const char *secure_peer_name,
}
/* Check the peer name if specified. */
if (secure_peer_name != NULL &&
!tsi_ssl_peer_matches_name(peer, secure_peer_name)) {
gpr_log(GPR_ERROR, "Peer name %s is not in peer certificate",
secure_peer_name);
if (peer_name != NULL &&
!tsi_ssl_peer_matches_name(peer, peer_name)) {
gpr_log(GPR_ERROR, "Peer name %s is not in peer certificate", peer_name);
return GRPC_SECURITY_ERROR;
}
return GRPC_SECURITY_OK;
}
static grpc_security_status ssl_channel_check_peer(
grpc_security_context *ctx, const tsi_peer *peer,
grpc_security_check_peer_cb cb, void *user_data) {
static grpc_security_status ssl_channel_check_peer(grpc_security_context *ctx,
tsi_peer peer,
grpc_security_check_cb cb,
void *user_data) {
grpc_ssl_channel_security_context *c =
(grpc_ssl_channel_security_context *)ctx;
return ssl_check_peer(c->secure_peer_name, peer);
grpc_security_status status = ssl_check_peer(c->overridden_target_name != NULL
? c->overridden_target_name
: c->target_name,
&peer);
c->peer = peer;
return status;
}
static grpc_security_status ssl_server_check_peer(grpc_security_context *ctx,
tsi_peer peer,
grpc_security_check_cb cb,
void *user_data) {
/* TODO(jboeuf): Find a way to expose the peer to the authorization layer. */
grpc_security_status status = ssl_check_peer(NULL, &peer);
tsi_peer_destruct(&peer);
return status;
}
static grpc_security_status ssl_server_check_peer(
grpc_security_context *ctx, const tsi_peer *peer,
grpc_security_check_peer_cb cb, void *user_data) {
/* TODO(jboeuf): Find a way to expose the peer to the authorization layer. */
return ssl_check_peer(NULL, peer);
static grpc_security_status ssl_channel_check_call_host(
grpc_channel_security_context *ctx, const char *host,
grpc_security_check_cb cb, void *user_data) {
grpc_ssl_channel_security_context *c =
(grpc_ssl_channel_security_context *)ctx;
if (tsi_ssl_peer_matches_name(&c->peer, host)) return GRPC_SECURITY_OK;
/* If the target name was overridden, then the original target_name was
'checked' transitively during the previous peer check at the end of the
handshake. */
if (c->overridden_target_name != NULL && !strcmp(host, c->target_name)) {
return GRPC_SECURITY_OK;
} else {
return GRPC_SECURITY_ERROR;
}
}
static grpc_security_context_vtable ssl_channel_vtable = {
@ -345,7 +415,8 @@ static size_t get_default_pem_roots(const unsigned char **pem_root_certs) {
grpc_security_status grpc_ssl_channel_security_context_create(
grpc_credentials *request_metadata_creds, const grpc_ssl_config *config,
const char *secure_peer_name, grpc_channel_security_context **ctx) {
const char *target_name, const char *overridden_target_name,
grpc_channel_security_context **ctx) {
size_t num_alpn_protocols = grpc_chttp2_num_alpn_versions();
const unsigned char **alpn_protocol_strings =
gpr_malloc(sizeof(const char *) * num_alpn_protocols);
@ -364,8 +435,8 @@ grpc_security_status grpc_ssl_channel_security_context_create(
strlen(grpc_chttp2_get_alpn_version_index(i));
}
if (config == NULL || secure_peer_name == NULL) {
gpr_log(GPR_ERROR, "An ssl channel needs a config and a secure name.");
if (config == NULL || target_name == NULL) {
gpr_log(GPR_ERROR, "An ssl channel needs a config and a target name.");
goto error;
}
if (!check_request_metadata_creds(request_metadata_creds)) {
@ -379,8 +450,12 @@ grpc_security_status grpc_ssl_channel_security_context_create(
c->base.base.vtable = &ssl_channel_vtable;
c->base.base.is_client_side = 1;
c->base.request_metadata_creds = grpc_credentials_ref(request_metadata_creds);
if (secure_peer_name != NULL) {
c->secure_peer_name = gpr_strdup(secure_peer_name);
c->base.check_call_host = ssl_channel_check_call_host;
if (target_name != NULL) {
c->target_name = gpr_strdup(target_name);
}
if (overridden_target_name != NULL) {
c->overridden_target_name = gpr_strdup(overridden_target_name);
}
if (config->pem_root_certs == NULL) {
pem_root_certs_size = get_default_pem_roots(&pem_root_certs);
@ -478,7 +553,7 @@ grpc_channel *grpc_ssl_channel_create(grpc_credentials *ssl_creds,
grpc_channel *channel = NULL;
grpc_security_status status = GRPC_SECURITY_OK;
size_t i = 0;
const char *secure_peer_name = target;
const char *overridden_target_name = NULL;
grpc_arg arg;
grpc_channel_args *new_args;
@ -486,13 +561,13 @@ grpc_channel *grpc_ssl_channel_create(grpc_credentials *ssl_creds,
grpc_arg *arg = &args->args[i];
if (!strcmp(arg->key, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG) &&
arg->type == GRPC_ARG_STRING) {
secure_peer_name = arg->value.string;
overridden_target_name = arg->value.string;
break;
}
}
status = grpc_ssl_channel_security_context_create(
request_metadata_creds, grpc_ssl_credentials_get_config(ssl_creds),
secure_peer_name, &ctx);
target, overridden_target_name, &ctx);
if (status != GRPC_SECURITY_OK) {
return grpc_lame_client_channel_create();
}
@ -510,7 +585,7 @@ grpc_channel *grpc_fake_transport_security_channel_create(
grpc_credentials *fake_creds, grpc_credentials *request_metadata_creds,
const char *target, const grpc_channel_args *args) {
grpc_channel_security_context *ctx =
grpc_fake_channel_security_context_create(request_metadata_creds);
grpc_fake_channel_security_context_create(request_metadata_creds, 1);
grpc_channel *channel =
grpc_secure_channel_create_internal(target, args, ctx);
grpc_security_context_unref(&ctx->base);

@ -56,16 +56,15 @@ typedef struct grpc_security_context grpc_security_context;
#define GRPC_SECURITY_CONTEXT_ARG "grpc.security_context"
typedef void (*grpc_security_check_peer_cb)(void *user_data,
grpc_security_status status);
typedef void (*grpc_security_check_cb)(void *user_data,
grpc_security_status status);
typedef struct {
void (*destroy)(grpc_security_context *ctx);
grpc_security_status (*create_handshaker)(grpc_security_context *ctx,
tsi_handshaker **handshaker);
grpc_security_status (*check_peer)(grpc_security_context *ctx,
const tsi_peer *peer,
grpc_security_check_peer_cb,
grpc_security_status (*check_peer)(grpc_security_context *ctx, tsi_peer peer,
grpc_security_check_cb cb,
void *user_data);
} grpc_security_context_vtable;
@ -87,18 +86,14 @@ grpc_security_status grpc_security_context_create_handshaker(
/* Check the peer.
Implementations can choose to check the peer either synchronously or
asynchronously. In the first case, a successful will return
asynchronously. In the first case, a successful call will return
GRPC_SECURITY_OK. In the asynchronous case, the call will return
GRPC_SECURITY_PENDING unless an error is detected early on.
Note:
Asynchronous implementations of this interface should make a copy of the
fields of the peer they want to check as there is no guarantee on the
lifetime of the peer object beyond this call.
Ownership of the peer is transfered.
*/
grpc_security_status grpc_security_context_check_peer(
grpc_security_context *ctx, const tsi_peer *peer,
grpc_security_check_peer_cb cb, void *user_data);
grpc_security_context *ctx, tsi_peer peer,
grpc_security_check_cb cb, void *user_data);
/* Util to encapsulate the context in a channel arg. */
grpc_arg grpc_security_context_to_arg(grpc_security_context *ctx);
@ -120,14 +115,26 @@ typedef struct grpc_channel_security_context grpc_channel_security_context;
struct grpc_channel_security_context {
grpc_security_context base; /* requires is_client_side to be non 0. */
grpc_credentials *request_metadata_creds;
grpc_security_status (*check_call_host)(
grpc_channel_security_context *ctx, const char *host,
grpc_security_check_cb cb, void *user_data);
};
/* Checks that the host that will be set for a call is acceptable.
Implementations can choose do the check either synchronously or
asynchronously. In the first case, a successful call will return
GRPC_SECURITY_OK. In the asynchronous case, the call will return
GRPC_SECURITY_PENDING unless an error is detected early on. */
grpc_security_status grpc_channel_security_context_check_call_host(
grpc_channel_security_context *ctx, const char *host,
grpc_security_check_cb cb, void *user_data);
/* --- Creation security contexts. --- */
/* For TESTING ONLY!
Creates a fake context that emulates real channel security. */
grpc_channel_security_context *grpc_fake_channel_security_context_create(
grpc_credentials *request_metadata_creds);
grpc_credentials *request_metadata_creds, int call_host_check_is_async);
/* For TESTING ONLY!
Creates a fake context that emulates real server security. */
@ -148,7 +155,8 @@ grpc_security_context *grpc_fake_server_security_context_create(void);
*/
grpc_security_status grpc_ssl_channel_security_context_create(
grpc_credentials *request_metadata_creds, const grpc_ssl_config *config,
const char *secure_peer_name, grpc_channel_security_context **ctx);
const char *target_name, const char *overridden_target_name,
grpc_channel_security_context **ctx);
/* Creates an SSL server_security_context.
- config is the SSL config to be used for the SSL channel establishment.

@ -0,0 +1,54 @@
/*
*
* Copyright 2014, 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 <grpc/support/port_platform.h>
#ifdef GPR_WIN32
#include "src/core/support/cpu.h"
#include <grpc/support/log.h>
unsigned gpr_cpu_num_cores(void) {
/* TODO(jtattermusch): implement */
gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1");
return 1;
}
unsigned gpr_cpu_current_cpu(void) {
/* TODO(jtattermusch): implement */
gpr_log(GPR_ERROR, "Cannot determine current CPU");
return 0;
}
#endif /* GPR_WIN32 */

@ -76,7 +76,7 @@ end:
*tmp_filename_out = gpr_tchar_to_char(tmp_filename);
}
gpr_free(tmp_filename);
gpr_free(template_string);
return result;
}

@ -189,8 +189,8 @@ static void done_setup(void *sp) {
static grpc_transport_setup_result complete_setup(void *channel_stack,
grpc_transport *transport,
grpc_mdctx *mdctx) {
static grpc_channel_filter const *extra_filters[] = {&grpc_http_client_filter,
&grpc_http_filter};
static grpc_channel_filter const *extra_filters[] = {
&grpc_client_auth_filter, &grpc_http_client_filter, &grpc_http_filter};
return grpc_client_channel_transport_setup_complete(
channel_stack, transport, extra_filters, GPR_ARRAY_SIZE(extra_filters),
mdctx);
@ -208,7 +208,7 @@ grpc_channel *grpc_secure_channel_create_internal(
grpc_arg context_arg;
grpc_channel_args *args_copy;
grpc_mdctx *mdctx = grpc_mdctx_create();
#define MAX_FILTERS 4
#define MAX_FILTERS 3
const grpc_channel_filter *filters[MAX_FILTERS];
int n = 0;
if (grpc_find_security_context_in_args(args) != NULL) {
@ -222,7 +222,6 @@ grpc_channel *grpc_secure_channel_create_internal(
if (grpc_channel_args_is_census_enabled(args)) {
filters[n++] = &grpc_client_census_filter;
}
filters[n++] = &grpc_client_auth_filter;
filters[n++] = &grpc_client_channel_filter;
GPR_ASSERT(n <= MAX_FILTERS);
channel = grpc_channel_create_from_filters(filters, n, args_copy, mdctx, 1);

@ -13,10 +13,10 @@ namespace Google.GRPC.Core
{
const int THREAD_POOL_SIZE = 1;
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_init();
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_shutdown();
static object staticLock = new object();

@ -15,66 +15,66 @@ namespace Google.GRPC.Core.Internal
{
const UInt32 GRPC_WRITE_BUFFER_HINT = 1;
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern CallSafeHandle grpc_channel_create_call_old(ChannelSafeHandle channel, string method, string host, Timespec deadline);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_add_metadata(CallSafeHandle call, IntPtr metadata, UInt32 flags);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_invoke_old(CallSafeHandle call, CompletionQueueSafeHandle cq, IntPtr metadataReadTag, IntPtr finishedTag, UInt32 flags);
[DllImport("libgrpc.so", EntryPoint = "grpc_call_invoke_old")]
[DllImport("grpc.dll", EntryPoint = "grpc_call_invoke_old")]
static extern GRPCCallError grpc_call_invoke_old_CALLBACK(CallSafeHandle call, CompletionQueueSafeHandle cq,
[MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate metadataReadCallback,
[MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate finishedCallback,
UInt32 flags);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_server_accept_old(CallSafeHandle call, CompletionQueueSafeHandle completionQueue, IntPtr finishedTag);
[DllImport("libgrpc.so", EntryPoint = "grpc_call_server_accept_old")]
[DllImport("grpc.dll", EntryPoint = "grpc_call_server_accept_old")]
static extern GRPCCallError grpc_call_server_accept_old_CALLBACK(CallSafeHandle call, CompletionQueueSafeHandle completionQueue, [MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate finishedCallback);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_server_end_initial_metadata_old(CallSafeHandle call, UInt32 flags);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_cancel(CallSafeHandle call);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_cancel_with_status(CallSafeHandle call, StatusCode status, string description);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_start_write_status_old(CallSafeHandle call, StatusCode statusCode, string statusMessage, IntPtr tag);
[DllImport("libgrpc.so", EntryPoint = "grpc_call_start_write_status_old")]
[DllImport("grpc.dll", EntryPoint = "grpc_call_start_write_status_old")]
static extern GRPCCallError grpc_call_start_write_status_old_CALLBACK(CallSafeHandle call, StatusCode statusCode, string statusMessage, [MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate callback);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_writes_done_old(CallSafeHandle call, IntPtr tag);
[DllImport("libgrpc.so", EntryPoint = "grpc_call_writes_done_old")]
[DllImport("grpc.dll", EntryPoint = "grpc_call_writes_done_old")]
static extern GRPCCallError grpc_call_writes_done_old_CALLBACK(CallSafeHandle call, [MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate callback);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern GRPCCallError grpc_call_start_read_old(CallSafeHandle call, IntPtr tag);
[DllImport("libgrpc.so", EntryPoint = "grpc_call_start_read_old")]
[DllImport("grpc.dll", EntryPoint = "grpc_call_start_read_old")]
static extern GRPCCallError grpc_call_start_read_old_CALLBACK(CallSafeHandle call, [MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate callback);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern void grpc_call_start_write_from_copied_buffer(CallSafeHandle call,
byte[] buffer, UIntPtr length,
IntPtr tag, UInt32 flags);
[DllImport("libgrpc_csharp_ext.so", EntryPoint = "grpc_call_start_write_from_copied_buffer")]
[DllImport("grpc_csharp_ext.dll", EntryPoint = "grpc_call_start_write_from_copied_buffer")]
static extern void grpc_call_start_write_from_copied_buffer_CALLBACK(CallSafeHandle call,
byte[] buffer, UIntPtr length,
[MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate callback,
UInt32 flags);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_call_destroy(IntPtr call);
private CallSafeHandle()

@ -10,10 +10,10 @@ namespace Google.GRPC.Core.Internal
/// </summary>
internal class ChannelSafeHandle : SafeHandleZeroIsInvalid
{
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern ChannelSafeHandle grpc_channel_create(string target, IntPtr channelArgs);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_channel_destroy(IntPtr channel);
private ChannelSafeHandle()

@ -9,22 +9,22 @@ namespace Google.GRPC.Core.Internal
/// </summary>
internal class CompletionQueueSafeHandle : SafeHandleZeroIsInvalid
{
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern CompletionQueueSafeHandle grpc_completion_queue_create();
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern EventSafeHandle grpc_completion_queue_pluck(CompletionQueueSafeHandle cq, IntPtr tag, Timespec deadline);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern EventSafeHandle grpc_completion_queue_next(CompletionQueueSafeHandle cq, Timespec deadline);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_completion_queue_shutdown(CompletionQueueSafeHandle cq);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern GRPCCompletionType grpc_completion_queue_next_with_callback(CompletionQueueSafeHandle cq);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_completion_queue_destroy(IntPtr cq);
private CompletionQueueSafeHandle()

@ -36,29 +36,36 @@ namespace Google.GRPC.Core.Internal
/// </summary>
internal enum GRPCCompletionType
{
GRPC_QUEUE_SHUTDOWN,
/* Shutting down */
GRPC_READ,
GRPC_QUEUE_SHUTDOWN,
/* operation completion */
GRPC_OP_COMPLETE,
/* A read has completed */
GRPC_INVOKE_ACCEPTED,
/* An invoke call has been accepted by flow
control */
GRPC_READ,
/* A write has been accepted by flow control */
GRPC_WRITE_ACCEPTED,
/* A write has been accepted by
flow control */
GRPC_FINISH_ACCEPTED,
/* writes_done or write_status has been accepted */
GRPC_FINISH_ACCEPTED,
/* The metadata array sent by server received at client */
GRPC_CLIENT_METADATA_READ,
/* The metadata array sent by server received at
client */
/* An RPC has finished. The event contains status.
* On the server this will be OK or Cancelled. */
GRPC_FINISHED,
/* An RPC has finished. The event contains status.
On the server this will be OK or Cancelled. */
GRPC_SERVER_RPC_NEW,
/* A new RPC has arrived at the server */
GRPC_SERVER_RPC_NEW,
/* The server has finished shutting down */
GRPC_SERVER_SHUTDOWN,
/* must be last, forces users to include a default: case */
GRPC_COMPLETION_DO_NOT_USE
/* must be last, forces users to include
a default: case */
}
/// <summary>

@ -9,34 +9,34 @@ namespace Google.GRPC.Core.Internal
/// </summary>
internal class EventSafeHandle : SafeHandleZeroIsInvalid
{
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_event_finish(IntPtr ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern GRPCCompletionType grpc_event_type(EventSafeHandle ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern CallSafeHandle grpc_event_call(EventSafeHandle ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern GRPCOpError grpc_event_write_accepted(EventSafeHandle ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern GRPCOpError grpc_event_finish_accepted(EventSafeHandle ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern StatusCode grpc_event_finished_status(EventSafeHandle ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern IntPtr grpc_event_finished_details(EventSafeHandle ev); // returns const char*
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern IntPtr grpc_event_read_length(EventSafeHandle ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern void grpc_event_read_copy_to_buffer(EventSafeHandle ev, byte[] buffer, UIntPtr bufferLen);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern IntPtr grpc_event_server_rpc_new_method(EventSafeHandle ev); // returns const char*
public GRPCCompletionType GetCompletionType()
@ -98,34 +98,34 @@ namespace Google.GRPC.Core.Internal
/// </summary>
internal class EventSafeHandleNotOwned : SafeHandleZeroIsInvalid
{
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_event_finish(IntPtr ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern GRPCCompletionType grpc_event_type(EventSafeHandleNotOwned ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern CallSafeHandle grpc_event_call(EventSafeHandleNotOwned ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern GRPCOpError grpc_event_write_accepted(EventSafeHandleNotOwned ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern GRPCOpError grpc_event_finish_accepted(EventSafeHandleNotOwned ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern StatusCode grpc_event_finished_status(EventSafeHandleNotOwned ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern IntPtr grpc_event_finished_details(EventSafeHandleNotOwned ev); // returns const char*
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern IntPtr grpc_event_read_length(EventSafeHandleNotOwned ev);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern void grpc_event_read_copy_to_buffer(EventSafeHandleNotOwned ev, byte[] buffer, UIntPtr bufferLen);
[DllImport("libgrpc_csharp_ext.so")]
[DllImport("grpc_csharp_ext.dll")]
static extern IntPtr grpc_event_server_rpc_new_method(EventSafeHandleNotOwned ev); // returns const char*
public EventSafeHandleNotOwned() : base(false)

@ -10,30 +10,30 @@ namespace Google.GRPC.Core.Internal
/// </summary>
internal sealed class ServerSafeHandle : SafeHandleZeroIsInvalid
{
[DllImport("libgrpc.so", EntryPoint = "grpc_server_request_call_old")]
[DllImport("grpc.dll", EntryPoint = "grpc_server_request_call_old")]
static extern GRPCCallError grpc_server_request_call_old_CALLBACK(ServerSafeHandle server, [MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate callback);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern ServerSafeHandle grpc_server_create(CompletionQueueSafeHandle cq, IntPtr args);
// TODO: check int representation size
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern int grpc_server_add_http2_port(ServerSafeHandle server, string addr);
// TODO: check int representation size
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern int grpc_server_add_secure_http2_port(ServerSafeHandle server, string addr);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_server_start(ServerSafeHandle server);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_server_shutdown(ServerSafeHandle server);
[DllImport("libgrpc.so", EntryPoint = "grpc_server_shutdown_and_notify")]
[DllImport("grpc.dll", EntryPoint = "grpc_server_shutdown_and_notify")]
static extern void grpc_server_shutdown_and_notify_CALLBACK(ServerSafeHandle server, [MarshalAs(UnmanagedType.FunctionPtr)] EventCallbackDelegate callback);
[DllImport("libgrpc.so")]
[DllImport("grpc.dll")]
static extern void grpc_server_destroy(IntPtr server);
private ServerSafeHandle()

@ -13,7 +13,7 @@ namespace Google.GRPC.Core.Internal
const int nanosPerSecond = 1000 * 1000 * 1000;
const int nanosPerTick = 100;
[DllImport("libgpr.so")]
[DllImport("gpr.dll")]
static extern Timespec gpr_now();
// TODO: this only works on 64bit linux, can we autoselect the right size of ints?

@ -0,0 +1,115 @@
/*
*
* 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.
*
*/
var grpc = require('..');
var testProto = grpc.load(__dirname + '/../interop/test.proto').grpc.testing;
var _ = require('underscore');
var interop_server = require('../interop/interop_server.js');
function runTest(iterations, callback) {
var testServer = interop_server.getServer(0, false);
testServer.server.listen();
var client = new testProto.TestService('localhost:' + testServer.port);
function runIterations(finish) {
var start = process.hrtime();
var intervals = [];
var pending = iterations;
function next(i) {
if (i >= iterations) {
testServer.server.shutdown();
var totalDiff = process.hrtime(start);
finish({
total: totalDiff[0] * 1000000 + totalDiff[1] / 1000,
intervals: intervals
});
} else{
var deadline = new Date();
deadline.setSeconds(deadline.getSeconds() + 3);
var startTime = process.hrtime();
client.emptyCall({}, function(err, resp) {
var timeDiff = process.hrtime(startTime);
intervals[i] = timeDiff[0] * 1000000 + timeDiff[1] / 1000;
next(i+1);
}, {}, deadline);
}
}
next(0);
}
function warmUp(num) {
var pending = num;
for (var i = 0; i < num; i++) {
(function(i) {
client.emptyCall({}, function(err, resp) {
pending--;
if (pending === 0) {
runIterations(callback);
}
});
})(i);
}
}
warmUp(100);
}
function percentile(arr, percentile) {
if (percentile > 99) {
percentile = 99;
}
if (percentile < 0) {
percentile = 0;
}
return arr[(arr.length * percentile / 100)|0];
}
if (require.main === module) {
var count;
if (process.argv.length >= 3) {
count = process.argv[2];
} else {
count = 100;
}
runTest(count, function(results) {
var sorted_intervals = _.sortBy(results.intervals, _.identity);
console.log('count:', count);
console.log('total time:', results.total, 'us');
console.log('median:', percentile(sorted_intervals, 50), 'us');
console.log('90th percentile:', percentile(sorted_intervals, 90), 'us');
console.log('95th percentile:', percentile(sorted_intervals, 95), 'us');
console.log('99th percentile:', percentile(sorted_intervals, 99), 'us');
console.log('QPS:', (count / results.total) * 1000000);
});
}
module.exports = runTest;

@ -92,7 +92,7 @@ class _CTest(unittest.TestCase):
_c.init()
completion_queue = _c.CompletionQueue()
server = _c.Server(completion_queue)
server = _c.Server(completion_queue, None)
server.add_http2_addr('[::]:0')
server.start()
server.stop()
@ -102,7 +102,7 @@ class _CTest(unittest.TestCase):
service_tag = object()
completion_queue = _c.CompletionQueue()
server = _c.Server(completion_queue)
server = _c.Server(completion_queue, None)
server.add_http2_addr('[::]:0')
server.start()
server.service(service_tag)
@ -119,7 +119,7 @@ class _CTest(unittest.TestCase):
del completion_queue
completion_queue = _c.CompletionQueue()
server = _c.Server(completion_queue)
server = _c.Server(completion_queue, None)
server.add_http2_addr('[::]:0')
server.start()
thread = threading.Thread(target=completion_queue.get, args=(_FUTURE,))
@ -162,6 +162,31 @@ class _CTest(unittest.TestCase):
_c.shut_down()
@unittest.skip('TODO(nathaniel): find and use real-enough test credentials')
def test_secure_server(self):
_c.init()
server_credentials = _c.ServerCredentials(
'root certificate', (('private key', 'certificate chain'),))
completion_queue = _c.CompletionQueue()
server = _c.Server(completion_queue, server_credentials)
server.add_http2_addr('[::]:0')
server.start()
thread = threading.Thread(target=completion_queue.get, args=(_FUTURE,))
thread.start()
time.sleep(1)
server.stop()
completion_queue.stop()
for _ in range(_IDEMPOTENCE_DEMONSTRATION):
event = completion_queue.get(time.time() + _TIMEOUT)
self.assertIs(event.kind, _datatypes.Event.Kind.STOP)
thread.join()
del server
del completion_queue
_c.shut_down()
if __name__ == '__main__':
unittest.main()

@ -82,7 +82,7 @@ class EchoTest(unittest.TestCase):
self.host = 'localhost'
self.server_completion_queue = _low.CompletionQueue()
self.server = _low.Server(self.server_completion_queue)
self.server = _low.Server(self.server_completion_queue, None)
port = self.server.add_http2_addr('[::]:0')
self.server.start()
@ -260,7 +260,7 @@ class CancellationTest(unittest.TestCase):
self.host = 'localhost'
self.server_completion_queue = _low.CompletionQueue()
self.server = _low.Server(self.server_completion_queue)
self.server = _low.Server(self.server_completion_queue, None)
port = self.server.add_http2_addr('[::]:0')
self.server.start()

@ -38,18 +38,30 @@
#include "_adapter/_completion_queue.h"
#include "_adapter/_error.h"
#include "_adapter/_server_credentials.h"
static int pygrpc_server_init(Server *self, PyObject *args, PyObject *kwds) {
const PyObject *completion_queue;
if (!(PyArg_ParseTuple(args, "O!", &pygrpc_CompletionQueueType,
&completion_queue))) {
PyObject *server_credentials;
if (!(PyArg_ParseTuple(args, "O!O", &pygrpc_CompletionQueueType,
&completion_queue, &server_credentials))) {
self->c_server = NULL;
return -1;
}
if (server_credentials == Py_None) {
self->c_server = grpc_server_create(
((CompletionQueue *)completion_queue)->c_completion_queue, NULL);
return 0;
} else if (PyObject_TypeCheck(server_credentials,
&pygrpc_ServerCredentialsType)) {
self->c_server = grpc_secure_server_create(
((ServerCredentials *)server_credentials)->c_server_credentials,
((CompletionQueue *)completion_queue)->c_completion_queue, NULL);
return 0;
} else {
self->c_server = NULL;
return -1;
}
self->c_server = grpc_server_create(
((CompletionQueue *)completion_queue)->c_completion_queue, NULL);
return 0;
}
static void pygrpc_server_dealloc(Server *self) {

@ -265,7 +265,7 @@ class ForeLink(ticket_interfaces.ForeLink):
"""
with self._condition:
self._completion_queue = _low.CompletionQueue()
self._server = _low.Server(self._completion_queue)
self._server = _low.Server(self._completion_queue, None)
port = self._server.add_http2_addr(
'[::]:%d' % (0 if self._port is None else self._port))
self._server.start()

@ -19,12 +19,12 @@ mkdir ${test_bin_dir}
% for target in test_targets:
echo Building test ${target.name}
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:${test_bin_dir}\ \
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:${test_bin_dir}\ \
%for source in target.src:
..\..\${to_windows_path(source)} \
%endfor
link.exe /OUT:"${test_bin_dir}\${target.name}.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 \
link.exe /DEBUG /OUT:"${test_bin_dir}\${target.name}.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 \
%for dep in target.deps:
Debug\${dep}.lib \
%endfor

@ -1,2 +1,2 @@
<%namespace file="vcxproj.filters_defs.include" import="gen_project"/>\
${gen_project('gpr', libs, targets)}
<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('gpr', libs, targets)}

@ -0,0 +1,2 @@
<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('gpr', libs, targets)}

@ -0,0 +1,2 @@
<%namespace file="vcxproj_defs.include" import="gen_project"/>\
${gen_project('gpr', libs, targets, configuration_type = 'DynamicLibrary', project_guid = '{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}')}

@ -23,7 +23,13 @@ Project("${cpp_proj_type}") = "${project.name}", "${project.name}.vcxproj", "${p
% endif
EndProject
% endfor
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "third_party\zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
Project("${cpp_proj_type}") = "gpr_shared", "gpr_shared.vcxproj", "{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}"
EndProject
Project("${cpp_proj_type}") = "grpc_shared", "grpc_shared.vcxproj", "{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}"
EndProject
Project("${cpp_proj_type}") = "grpc_csharp_ext_shared", "grpc_csharp_ext_shared.vcxproj", "{C26D04A8-37C6-44C7-B458-906C9FCE928C}"
EndProject
Project("${cpp_proj_type}") = "zlibvc", "third_party\zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "third_party", "third_party", "{DD51818F-0BCA-4035-9E5B-F28A9F87DED4}"
EndProject
@ -43,6 +49,18 @@ Global
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}.Debug|Win32.ActiveCfg = Debug|Win32
{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}.Debug|Win32.Build.0 = Debug|Win32
{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}.Release|Win32.ActiveCfg = Release|Win32
{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}.Release|Win32.Build.0 = Release|Win32
{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}.Debug|Win32.ActiveCfg = Debug|Win32
{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}.Debug|Win32.Build.0 = Debug|Win32
{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}.Release|Win32.ActiveCfg = Release|Win32
{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}.Release|Win32.Build.0 = Release|Win32
{C26D04A8-37C6-44C7-B458-906C9FCE928C}.Debug|Win32.ActiveCfg = Debug|Win32
{C26D04A8-37C6-44C7-B458-906C9FCE928C}.Debug|Win32.Build.0 = Debug|Win32
{C26D04A8-37C6-44C7-B458-906C9FCE928C}.Release|Win32.ActiveCfg = Release|Win32
{C26D04A8-37C6-44C7-B458-906C9FCE928C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -1,2 +1,2 @@
<%namespace file="vcxproj.filters_defs.include" import="gen_project"/>\
${gen_project('grpc', libs, targets)}
<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc', libs, targets)}

@ -0,0 +1,2 @@
<%namespace file="vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_csharp_ext', libs, targets)}

@ -0,0 +1,2 @@
<%namespace file="vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_csharp_ext', libs, targets, configuration_type = 'DynamicLibrary', project_guid = '{C26D04A8-37C6-44C7-B458-906C9FCE928C}', additional_props = ['winsock'])}

@ -0,0 +1,2 @@
<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc', libs, targets)}

@ -0,0 +1,2 @@
<%namespace file="vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc', libs, targets, configuration_type = 'DynamicLibrary', project_guid = '{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}', additional_props = ['ssl', 'winsock'], depends_on_zlib = True)}

@ -1,2 +1,2 @@
<%namespace file="vcxproj.filters_defs.include" import="gen_project"/>\
${gen_project('grpc_unsecure', libs, targets)}
<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc_unsecure', libs, targets)}

@ -1,2 +1,2 @@
<%namespace file="vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc', libs, targets)}
${gen_project('grpc_unsecure', libs, targets)}

@ -8,7 +8,7 @@
<%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\
<%def name="to_filter(path)">${calc_to_filter(path)}</%def>\
<%def name="filter_to_guid(proj, filter)">${re.sub('(........)(....)(....)(....)', r'\1-\2-\3-\4-', hashlib.md5(''.join([filter, proj])).hexdigest())}</%def>\
<%def name="gen_project(name, libs, targets)">\
<%def name="gen_filters(name, libs, targets)">\
% for project in vsprojects:
% if project.name == name:
<?xml version="1.0" encoding="utf-8"?>

@ -1,7 +1,6 @@
<%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\
<%def name="get_configuration_type(is_library)">${'StaticLibrary' if is_library else 'Application'}</%def>\
<%def name="get_subsystem(is_library)">${'Windows' if is_library else 'Console'}</%def>\
<%def name="gen_project(name, libs, targets)">\
<%def name="gen_project(name, libs, targets, configuration_type = 'StaticLibrary', project_guid = None, additional_props = [], depends_on_zlib = False)">\
% for project in vsprojects:
% if project.name == name:
<?xml version="1.0" encoding="utf-8"?>
@ -17,18 +16,18 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>${project.vs_project_guid}</ProjectGuid>
<ProjectGuid>${project_guid if project_guid else project.vs_project_guid}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>${get_configuration_type(project.is_library)}</ConfigurationType>
<ConfigurationType>${configuration_type}</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>${get_configuration_type(project.is_library)}</ConfigurationType>
<ConfigurationType>${configuration_type}</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
@ -41,13 +40,24 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="global.props" />
% for prop in additional_props:
<Import Project="${prop}.props" />
% endfor
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="global.props" />
% for prop in additional_props:
<Import Project="${prop}.props" />
% endfor
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>${name}</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>${name}</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@ -107,6 +117,11 @@
<Project>${vsproject_dict[dep].vs_project_guid}</Project>
</ProjectReference>
% endfor
% if depends_on_zlib:
<ProjectReference Include="third_party\zlibvc.vcxproj">
<Project>{8fd826f8-3739-44e6-8cc8-997122e53b8d}</Project>
</ProjectReference>
% endif
</ItemGroup>
% endif
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

@ -112,7 +112,8 @@ void test_connect(const char *server_host, const char *client_host, int port,
}
/* Send a trivial request. */
c = grpc_channel_create_call_old(client, "/foo", "test.google.com", deadline);
c = grpc_channel_create_call_old(client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK ==
@ -124,8 +125,8 @@ void test_connect(const char *server_host, const char *client_host, int port,
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -131,8 +131,8 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
grpc_byte_buffer_create(&response_payload_slice, 1);
int was_cancelled = 2;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);

@ -113,7 +113,7 @@ static void test_cancel_after_accept_and_writes_closed(
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -121,8 +121,8 @@ static void test_cancel_after_accept_and_writes_closed(
grpc_call_invoke_old(c, f.client_cq, tag(2), tag(3), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -113,7 +113,7 @@ static void test_cancel_after_accept_and_writes_closed(
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -121,7 +121,7 @@ static void test_cancel_after_accept_and_writes_closed(
grpc_call_invoke_old(c, f.client_cq, tag(2), tag(3), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -113,7 +113,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -121,7 +121,7 @@ static void test_cancel_after_accept(grpc_end2end_test_config config,
grpc_call_invoke_old(c, f.client_cq, tag(2), tag(3), 0));
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -124,8 +124,8 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
grpc_byte_buffer *request_payload =
grpc_byte_buffer_create(&request_payload_slice, 1);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);

@ -111,7 +111,7 @@ static void test_cancel_after_invoke(grpc_end2end_test_config config,
gpr_timespec deadline = five_seconds_time();
cq_verifier *v_client = cq_verifier_create(f.client_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);

@ -122,8 +122,8 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config, int test_
grpc_byte_buffer *request_payload =
grpc_byte_buffer_create(&request_payload_slice, 1);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c));

@ -109,7 +109,7 @@ static void test_cancel_before_invoke(grpc_end2end_test_config config) {
gpr_timespec deadline = five_seconds_time();
cq_verifier *v_client = cq_verifier_create(f.client_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);

@ -109,8 +109,8 @@ static void test_cancel_in_a_vacuum(grpc_end2end_test_config config,
gpr_timespec deadline = five_seconds_time();
cq_verifier *v_client = cq_verifier_create(f.client_cq);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
GPR_ASSERT(GRPC_CALL_OK == mode.initiate_cancel(c));

@ -109,7 +109,7 @@ static void test_cancel_in_a_vacuum(grpc_end2end_test_config config,
gpr_timespec deadline = five_seconds_time();
cq_verifier *v_client = cq_verifier_create(f.client_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);

@ -106,7 +106,7 @@ static void test_body(grpc_end2end_test_fixture f) {
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
tag(1);
@ -118,7 +118,7 @@ static void test_body(grpc_end2end_test_fixture f) {
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -106,7 +106,7 @@ static void test_body(grpc_end2end_test_fixture f) {
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
tag(1);
@ -118,7 +118,7 @@ static void test_body(grpc_end2end_test_fixture f) {
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -97,7 +97,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
c = grpc_channel_create_call_old(f->client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f->client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -109,8 +109,8 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f->server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -97,7 +97,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
grpc_call *s;
gpr_timespec deadline = five_seconds_time();
c = grpc_channel_create_call_old(f->client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f->client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -109,7 +109,7 @@ static void do_request_and_shutdown_server(grpc_end2end_test_fixture *f,
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f->server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -111,7 +111,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -123,8 +123,8 @@ static void test_early_server_shutdown_finishes_inflight_calls(
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -111,7 +111,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -123,7 +123,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -110,7 +110,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -122,8 +122,8 @@ static void test_early_server_shutdown_finishes_inflight_calls(
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -110,7 +110,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -122,7 +122,7 @@ static void test_early_server_shutdown_finishes_inflight_calls(
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -122,7 +122,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -138,8 +138,8 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
request (as this request is very large) */
cq_verify_empty(v_client);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -122,7 +122,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -138,7 +138,7 @@ static void test_invoke_large_request(grpc_end2end_test_config config) {
request (as this request is very large) */
cq_verify_empty(v_client);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -109,7 +109,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -121,8 +121,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==
@ -182,10 +182,10 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
/* start two requests - ensuring that the second is not accepted until
the first completes */
deadline = five_seconds_time();
c1 = grpc_channel_create_call_old(f.client, "/alpha", "test.google.com",
c1 = grpc_channel_create_call_old(f.client, "/alpha", "foo.test.google.com",
deadline);
GPR_ASSERT(c1);
c2 = grpc_channel_create_call_old(f.client, "/beta", "test.google.com",
c2 = grpc_channel_create_call_old(f.client, "/beta", "foo.test.google.com",
deadline);
GPR_ASSERT(c1);
@ -211,7 +211,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
cq_expect_server_rpc_new(v_server, &s1, tag(100),
live_call == 300 ? "/alpha" : "/beta",
"test.google.com", deadline, NULL);
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==
@ -237,7 +237,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(200)));
cq_expect_server_rpc_new(v_server, &s2, tag(200),
live_call == 300 ? "/alpha" : "/beta",
"test.google.com", deadline, NULL);
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -109,7 +109,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -121,7 +121,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);
@ -182,10 +182,10 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
/* start two requests - ensuring that the second is not accepted until
the first completes */
deadline = five_seconds_time();
c1 = grpc_channel_create_call_old(f.client, "/alpha", "test.google.com",
c1 = grpc_channel_create_call_old(f.client, "/alpha", "foo.test.google.com",
deadline);
GPR_ASSERT(c1);
c2 = grpc_channel_create_call_old(f.client, "/beta", "test.google.com",
c2 = grpc_channel_create_call_old(f.client, "/beta", "foo.test.google.com",
deadline);
GPR_ASSERT(c1);
@ -211,7 +211,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
cq_expect_server_rpc_new(v_server, &s1, tag(100),
live_call == 300 ? "/alpha" : "/beta",
"test.google.com", deadline, NULL);
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==
@ -237,7 +237,7 @@ static void test_max_concurrent_streams(grpc_end2end_test_config config) {
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(200)));
cq_expect_server_rpc_new(v_server, &s2, tag(200),
live_call == 300 ? "/alpha" : "/beta",
"test.google.com", deadline, NULL);
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -118,7 +118,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
cq_verifier *v_server = cq_verifier_create(f.server_cq);
gpr_log(GPR_INFO, "testing with %d message pairs.", messages);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -127,8 +127,8 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_server_accept_old(s, f.server_cq, tag(102)));

@ -118,7 +118,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
cq_verifier *v_server = cq_verifier_create(f.server_cq);
gpr_log(GPR_INFO, "testing with %d message pairs.", messages);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -127,7 +127,7 @@ static void test_pingpong_streaming(grpc_end2end_test_config config,
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -139,8 +139,8 @@ static void test_request_response_with_metadata_and_payload(
size_t details_capacity = 0;
int was_cancelled = 2;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -209,7 +209,7 @@ static void test_request_response_with_metadata_and_payload(
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "test.google.com"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.com"));
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));

@ -137,7 +137,7 @@ static void test_request_response_with_metadata_and_payload(
gpr_slice_unref(request_payload_slice);
gpr_slice_unref(response_payload_slice);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -157,7 +157,7 @@ static void test_request_response_with_metadata_and_payload(
cq_verify(v_client);
cq_expect_server_rpc_new(
v_server, &s, tag(100), "/foo", "test.google.com", deadline, "key1-bin",
v_server, &s, tag(100), "/foo", "foo.test.google.com", deadline, "key1-bin",
"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc", "key2-bin",
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d", NULL);
cq_verify(v_server);

@ -132,8 +132,8 @@ static void test_request_response_with_metadata_and_payload(
size_t details_capacity = 0;
int was_cancelled = 2;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -202,7 +202,7 @@ static void test_request_response_with_metadata_and_payload(
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "test.google.com"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.com"));
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));

@ -128,7 +128,7 @@ static void test_request_response_with_metadata_and_payload(
gpr_slice_unref(request_payload_slice);
gpr_slice_unref(response_payload_slice);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -147,7 +147,7 @@ static void test_request_response_with_metadata_and_payload(
cq_expect_write_accepted(v_client, tag(4), GRPC_OP_OK);
cq_verify(v_client);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, "key1", "val1", "key2", "val2", NULL);
cq_verify(v_server);

@ -127,8 +127,8 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
size_t details_capacity = 0;
int was_cancelled = 2;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -195,7 +195,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "test.google.com"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.com"));
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));

@ -121,7 +121,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -136,7 +136,7 @@ static void request_response_with_payload(grpc_end2end_test_fixture f) {
cq_expect_write_accepted(v_client, tag(4), GRPC_OP_OK);
cq_verify(v_client);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -133,8 +133,8 @@ static void test_request_response_with_metadata_and_payload(
size_t details_capacity = 0;
int was_cancelled = 2;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -204,7 +204,7 @@ static void test_request_response_with_metadata_and_payload(
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "test.google.com"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.com"));
GPR_ASSERT(was_cancelled == 1);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(byte_buffer_eq_string(response_payload_recv, "hello you"));

@ -130,7 +130,7 @@ static void test_request_response_with_metadata_and_payload(
gpr_slice_unref(request_payload_slice);
gpr_slice_unref(response_payload_slice);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -149,7 +149,7 @@ static void test_request_response_with_metadata_and_payload(
cq_expect_write_accepted(v_client, tag(4), GRPC_OP_OK);
cq_verify(v_client);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, "key1", "val1", "key2", "val2", NULL);
cq_verify(v_server);

@ -127,8 +127,8 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
int was_cancelled = 2;
const int large_size = 64 * 1024;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
meta.key = "key";
@ -196,7 +196,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "test.google.com"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.com"));
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));
GPR_ASSERT(contains_metadata(&request_metadata_recv, "key", meta.value));

@ -121,7 +121,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
((char*)meta.value)[large_size] = 0;
meta.value_length = large_size;
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -131,7 +131,7 @@ static void test_request_with_large_metadata(grpc_end2end_test_config config) {
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_invoke_old(c, f.client_cq, tag(2), tag(3), 0));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, "key", meta.value, NULL);
cq_verify(v_server);

@ -125,8 +125,8 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
size_t details_capacity = 0;
int was_cancelled = 2;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -187,7 +187,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "test.google.com"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.com"));
GPR_ASSERT(was_cancelled == 0);
GPR_ASSERT(byte_buffer_eq_string(request_payload_recv, "hello world"));

@ -116,7 +116,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
/* byte buffer holds the slice, we can unref it already */
gpr_slice_unref(payload_slice);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -132,7 +132,7 @@ static void test_invoke_request_with_payload(grpc_end2end_test_config config) {
cq_expect_write_accepted(v_client, tag(4), GRPC_OP_OK);
cq_verify(v_client);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -113,8 +113,8 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
config.init_client(f, client_args);
c = grpc_channel_create_call(f->client, f->client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f->client, f->client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -171,7 +171,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "test.google.com"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.com"));
GPR_ASSERT(was_cancelled == 0);
gpr_free(details);

@ -103,7 +103,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
config.init_client(f, client_args);
c = grpc_channel_create_call_old(f->client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f->client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -119,7 +119,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config,
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f->server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -121,8 +121,8 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
size_t details_capacity = 0;
int was_cancelled = 2;
c = grpc_channel_create_call(f.client, f.client_cq, "/foo", "test.google.com",
deadline);
c = grpc_channel_create_call(f.client, f.client_cq, "/foo",
"foo.test.google.com", deadline);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
@ -177,7 +177,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
GPR_ASSERT(status == GRPC_STATUS_UNIMPLEMENTED);
GPR_ASSERT(0 == strcmp(details, "xyz"));
GPR_ASSERT(0 == strcmp(call_details.method, "/foo"));
GPR_ASSERT(0 == strcmp(call_details.host, "test.google.com"));
GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.com"));
GPR_ASSERT(was_cancelled == 0);
gpr_free(details);

@ -110,7 +110,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -122,7 +122,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);
@ -157,7 +157,7 @@ static void simple_request_body2(grpc_end2end_test_fixture f) {
cq_verifier *v_client = cq_verifier_create(f.client_cq);
cq_verifier *v_server = cq_verifier_create(f.server_cq);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -169,7 +169,7 @@ static void simple_request_body2(grpc_end2end_test_fixture f) {
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "foo.test.google.com",
deadline, NULL);
cq_verify(v_server);

@ -109,7 +109,7 @@ static void start_request(void) {
gpr_slice slice = gpr_slice_malloc(100);
grpc_byte_buffer *buf;
grpc_call *call = grpc_channel_create_call_old(
g_fixture.client, "/Foo", "test.google.com", g_test_end_time);
g_fixture.client, "/Foo", "foo.test.google.com", g_test_end_time);
memset(GPR_SLICE_START_PTR(slice), 1, GPR_SLICE_LENGTH(slice));
buf = grpc_byte_buffer_create(&slice, 1);

@ -109,7 +109,7 @@ static void start_request(void) {
gpr_slice slice = gpr_slice_malloc(100);
grpc_byte_buffer *buf;
grpc_call *call = grpc_channel_create_call_old(
g_fixture.client, "/Foo", "test.google.com", g_test_end_time);
g_fixture.client, "/Foo", "foo.test.google.com", g_test_end_time);
memset(GPR_SLICE_START_PTR(slice), 1, GPR_SLICE_LENGTH(slice));
buf = grpc_byte_buffer_create(&slice, 1);

@ -124,7 +124,7 @@ static void test_writes_done_hangs_with_pending_read(
gpr_slice_unref(request_payload_slice);
gpr_slice_unref(response_payload_slice);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -140,8 +140,8 @@ static void test_writes_done_hangs_with_pending_read(
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -124,7 +124,7 @@ static void test_writes_done_hangs_with_pending_read(
gpr_slice_unref(request_payload_slice);
gpr_slice_unref(response_payload_slice);
c = grpc_channel_create_call_old(f.client, "/foo", "test.google.com",
c = grpc_channel_create_call_old(f.client, "/foo", "foo.test.google.com",
deadline);
GPR_ASSERT(c);
@ -140,8 +140,8 @@ static void test_writes_done_hangs_with_pending_read(
cq_verify(v_client);
GPR_ASSERT(GRPC_CALL_OK == grpc_server_request_call_old(f.server, tag(100)));
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo", "test.google.com",
deadline, NULL);
cq_expect_server_rpc_new(v_server, &s, tag(100), "/foo",
"foo.test.google.com", deadline, NULL);
cq_verify(v_server);
GPR_ASSERT(GRPC_CALL_OK ==

@ -171,6 +171,7 @@ void test_times_out(void) {
int main(void) {
grpc_iomgr_init();
test_succeeds();
gpr_log(GPR_ERROR, "End of first test");
test_fails();
test_times_out();
grpc_iomgr_shutdown();

@ -13,6 +13,7 @@ _VERSION_KEYS = ['major', 'minor', 'micro', 'build']
_ELEM_KEYS = [
'name',
'build',
'run',
'language',
'public_headers',
'headers',

@ -22,11 +22,13 @@ ENV PATH $PATH:$JAVA_HOME/bin:$M2_HOME/bin
ENV LD_LIBRARY_PATH /usr/local/lib
# Get the protobuf source from GitHub and install it
RUN wget -O - https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2 | \
tar xj && \
cd protobuf-2.6.1 && \
RUN wget -O - https://github.com/google/protobuf/archive/master.tar.gz | \
tar xz && \
cd protobuf-master && \
./autogen.sh && \
./configure --prefix=/usr && \
make -j12 && make check && make install && \
cd java && mvn install && cd .. && \
rm -r "$(pwd)"
# Install a GitHub SSH service credential that gives access to the GitHub repo while it's private

@ -40,7 +40,7 @@ class ValgrindConfig(object):
self.allow_hashing = False
def job_spec(self, binary, hash_targets):
return JobSpec(cmdline=['valgrind', '--tool=%s' % self.tool, binary],
return jobset.JobSpec(cmdline=['valgrind', '--tool=%s' % self.tool, binary],
hash_targets=None)
@ -180,14 +180,17 @@ forever = args.forever
class TestCache(object):
"""Cache for running tests."""
def __init__(self):
def __init__(self, use_cache_results):
self._last_successful_run = {}
self._use_cache_results = use_cache_results
def should_run(self, cmdline, bin_hash):
if cmdline not in self._last_successful_run:
return True
if self._last_successful_run[cmdline] != bin_hash:
return True
if not self._use_cache_results:
return True
return False
def finished(self, cmdline, bin_hash):
@ -228,7 +231,7 @@ def _build_and_run(check_cancelled, newline_on_success, cache):
return 0
test_cache = TestCache()
test_cache = TestCache(runs_per_test == 1)
test_cache.maybe_load()
if forever:

@ -1,5 +1,8 @@
Debug
Release
*.suo
*.user
test_bin
grpc.opensdf
grpc.sdf
third_party/*.user

@ -10,112 +10,112 @@ MSBuild.exe gpr_test_util.vcxproj /p:Configuration=Debug
mkdir test_bin
echo Building test gpr_cancellable_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\cancellable_test.c
link.exe /OUT:"test_bin\gpr_cancellable_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\cancellable_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\cancellable_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_cancellable_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\cancellable_test.obj
echo(
echo Running test gpr_cancellable_test
test_bin\gpr_cancellable_test.exe || echo TEST FAILED: gpr_cancellable_test && exit /b
echo(
echo Building test gpr_cmdline_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\cmdline_test.c
link.exe /OUT:"test_bin\gpr_cmdline_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\cmdline_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\cmdline_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_cmdline_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\cmdline_test.obj
echo(
echo Running test gpr_cmdline_test
test_bin\gpr_cmdline_test.exe || echo TEST FAILED: gpr_cmdline_test && exit /b
echo(
echo Building test gpr_env_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\env_test.c
link.exe /OUT:"test_bin\gpr_env_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\env_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\env_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_env_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\env_test.obj
echo(
echo Running test gpr_env_test
test_bin\gpr_env_test.exe || echo TEST FAILED: gpr_env_test && exit /b
echo(
echo Building test gpr_file_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\file_test.c
link.exe /OUT:"test_bin\gpr_file_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\file_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\file_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_file_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\file_test.obj
echo(
echo Running test gpr_file_test
test_bin\gpr_file_test.exe || echo TEST FAILED: gpr_file_test && exit /b
echo(
echo Building test gpr_histogram_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\histogram_test.c
link.exe /OUT:"test_bin\gpr_histogram_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\histogram_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\histogram_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_histogram_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\histogram_test.obj
echo(
echo Running test gpr_histogram_test
test_bin\gpr_histogram_test.exe || echo TEST FAILED: gpr_histogram_test && exit /b
echo(
echo Building test gpr_host_port_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\host_port_test.c
link.exe /OUT:"test_bin\gpr_host_port_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\host_port_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\host_port_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_host_port_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\host_port_test.obj
echo(
echo Running test gpr_host_port_test
test_bin\gpr_host_port_test.exe || echo TEST FAILED: gpr_host_port_test && exit /b
echo(
echo Building test gpr_log_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\log_test.c
link.exe /OUT:"test_bin\gpr_log_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\log_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\log_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_log_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\log_test.obj
echo(
echo Running test gpr_log_test
test_bin\gpr_log_test.exe || echo TEST FAILED: gpr_log_test && exit /b
echo(
echo Building test gpr_slice_buffer_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\slice_buffer_test.c
link.exe /OUT:"test_bin\gpr_slice_buffer_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\slice_buffer_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\slice_buffer_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_slice_buffer_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\slice_buffer_test.obj
echo(
echo Running test gpr_slice_buffer_test
test_bin\gpr_slice_buffer_test.exe || echo TEST FAILED: gpr_slice_buffer_test && exit /b
echo(
echo Building test gpr_slice_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\slice_test.c
link.exe /OUT:"test_bin\gpr_slice_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\slice_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\slice_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_slice_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\slice_test.obj
echo(
echo Running test gpr_slice_test
test_bin\gpr_slice_test.exe || echo TEST FAILED: gpr_slice_test && exit /b
echo(
echo Building test gpr_string_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\string_test.c
link.exe /OUT:"test_bin\gpr_string_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\string_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\string_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_string_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\string_test.obj
echo(
echo Running test gpr_string_test
test_bin\gpr_string_test.exe || echo TEST FAILED: gpr_string_test && exit /b
echo(
echo Building test gpr_sync_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\sync_test.c
link.exe /OUT:"test_bin\gpr_sync_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\sync_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\sync_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_sync_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\sync_test.obj
echo(
echo Running test gpr_sync_test
test_bin\gpr_sync_test.exe || echo TEST FAILED: gpr_sync_test && exit /b
echo(
echo Building test gpr_thd_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\thd_test.c
link.exe /OUT:"test_bin\gpr_thd_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\thd_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\thd_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_thd_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\thd_test.obj
echo(
echo Running test gpr_thd_test
test_bin\gpr_thd_test.exe || echo TEST FAILED: gpr_thd_test && exit /b
echo(
echo Building test gpr_time_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\time_test.c
link.exe /OUT:"test_bin\gpr_time_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\time_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\time_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_time_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\time_test.obj
echo(
echo Running test gpr_time_test
test_bin\gpr_time_test.exe || echo TEST FAILED: gpr_time_test && exit /b
echo(
echo Building test gpr_useful_test
cl.exe /c /I..\.. /I..\..\include /nologo /ZI /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\useful_test.c
link.exe /OUT:"test_bin\gpr_useful_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\useful_test.obj
cl.exe /c /I..\.. /I..\..\include /nologo /Z7 /W3 /WX- /sdl /D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- /Fo:test_bin\ ..\..\test\core\support\useful_test.c
link.exe /DEBUG /OUT:"test_bin\gpr_useful_test.exe" /INCREMENTAL /NOLOGO /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 Debug\gpr_test_util.lib Debug\gpr.lib test_bin\useful_test.obj
echo(
echo Running test gpr_useful_test
test_bin\gpr_useful_test.exe || echo TEST FAILED: gpr_useful_test && exit /b

@ -41,7 +41,12 @@
<Import Project="global.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>gpr</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>gpr</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@ -115,6 +120,8 @@
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_windows.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_linux.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_posix.c">

@ -16,6 +16,9 @@
<ClCompile Include="..\..\src\core\support\cpu_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_windows.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_linux.c">
<Filter>src\core\support</Filter>
</ClCompile>

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="global.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="global.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>gpr</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>gpr</TargetName>
</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>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</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>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\include\grpc\support\alloc.h" />
<ClInclude Include="..\..\include\grpc\support\atm.h" />
<ClInclude Include="..\..\include\grpc\support\atm_gcc_atomic.h" />
<ClInclude Include="..\..\include\grpc\support\atm_gcc_sync.h" />
<ClInclude Include="..\..\include\grpc\support\atm_win32.h" />
<ClInclude Include="..\..\include\grpc\support\cancellable_platform.h" />
<ClInclude Include="..\..\include\grpc\support\cmdline.h" />
<ClInclude Include="..\..\include\grpc\support\histogram.h" />
<ClInclude Include="..\..\include\grpc\support\host_port.h" />
<ClInclude Include="..\..\include\grpc\support\log.h" />
<ClInclude Include="..\..\include\grpc\support\log_win32.h" />
<ClInclude Include="..\..\include\grpc\support\port_platform.h" />
<ClInclude Include="..\..\include\grpc\support\slice.h" />
<ClInclude Include="..\..\include\grpc\support\slice_buffer.h" />
<ClInclude Include="..\..\include\grpc\support\sync.h" />
<ClInclude Include="..\..\include\grpc\support\sync_generic.h" />
<ClInclude Include="..\..\include\grpc\support\sync_posix.h" />
<ClInclude Include="..\..\include\grpc\support\sync_win32.h" />
<ClInclude Include="..\..\include\grpc\support\thd.h" />
<ClInclude Include="..\..\include\grpc\support\time.h" />
<ClInclude Include="..\..\include\grpc\support\useful.h" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\core\support\cpu.h" />
<ClInclude Include="..\..\src\core\support\env.h" />
<ClInclude Include="..\..\src\core\support\file.h" />
<ClInclude Include="..\..\src\core\support\murmur_hash.h" />
<ClInclude Include="..\..\src\core\support\string.h" />
<ClInclude Include="..\..\src\core\support\string_win32.h" />
<ClInclude Include="..\..\src\core\support\thd_internal.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\core\support\alloc.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\cancellable.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\cmdline.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_linux.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_windows.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_linux.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_win32.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\file.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\file_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\file_win32.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\histogram.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\host_port.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\log.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\log_android.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\log_linux.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\log_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\log_win32.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\murmur_hash.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\slice.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\slice_buffer.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\string.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\string_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\string_win32.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\sync.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\sync_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\sync_win32.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\thd_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\thd_win32.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\time.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\time_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\support\time_win32.c">
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -0,0 +1,214 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\src\core\support\alloc.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\cancellable.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\cmdline.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_linux.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\cpu_windows.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_linux.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\env_win32.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\file.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\file_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\file_win32.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\histogram.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\host_port.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\log.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\log_android.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\log_linux.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\log_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\log_win32.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\murmur_hash.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\slice.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\slice_buffer.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\string.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\string_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\string_win32.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\sync.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\sync_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\sync_win32.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\thd_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\thd_win32.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\time.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\time_posix.c">
<Filter>src\core\support</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\support\time_win32.c">
<Filter>src\core\support</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\grpc\support\alloc.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\atm.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\atm_gcc_atomic.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\atm_gcc_sync.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\atm_win32.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\cancellable_platform.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\cmdline.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\histogram.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\host_port.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\log.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\log_win32.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\port_platform.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\slice.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\slice_buffer.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\sync.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\sync_generic.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\sync_posix.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\sync_win32.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\thd.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\time.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc\support\useful.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\core\support\cpu.h">
<Filter>src\core\support</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\support\env.h">
<Filter>src\core\support</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\support\file.h">
<Filter>src\core\support</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\support\murmur_hash.h">
<Filter>src\core\support</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\support\string.h">
<Filter>src\core\support</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\support\string_win32.h">
<Filter>src\core\support</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\support\thd_internal.h">
<Filter>src\core\support</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="include">
<UniqueIdentifier>{9ea89137-2bf7-b6d9-b7af-7cb4d1b74928}</UniqueIdentifier>
</Filter>
<Filter Include="include\grpc">
<UniqueIdentifier>{e6957ec1-85ba-6515-03c0-e12878045b1f}</UniqueIdentifier>
</Filter>
<Filter Include="include\grpc\support">
<UniqueIdentifier>{31c42000-3ed7-95e1-d076-df814b72cdee}</UniqueIdentifier>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{60eb2826-e58b-cb10-a98d-fe04727398a2}</UniqueIdentifier>
</Filter>
<Filter Include="src\core">
<UniqueIdentifier>{c5e1baa7-de77-beb1-9675-942261648f79}</UniqueIdentifier>
</Filter>
<Filter Include="src\core\support">
<UniqueIdentifier>{bb116f2a-ea2a-c233-82da-0c54e3cbfec1}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

@ -41,7 +41,12 @@
<Import Project="global.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>gpr_test_util</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>gpr_test_util</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>

@ -12,6 +12,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc", "grpc.vcxproj", "{29
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_csharp_ext", "grpc_csharp_ext.vcxproj", "{D64C6D63-4458-4A88-AB38-35678384A7E4}"
ProjectSection(ProjectDependencies) = postProject
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
{29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_test_util", "grpc_test_util.vcxproj", "{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_unsecure", "grpc_unsecure.vcxproj", "{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}"
@ -19,6 +25,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_unsecure", "grpc_unsec
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpr_shared", "gpr_shared.vcxproj", "{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_shared", "grpc_shared.vcxproj", "{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc_csharp_ext_shared", "grpc_csharp_ext_shared.vcxproj", "{C26D04A8-37C6-44C7-B458-906C9FCE928C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "third_party\zlibvc.vcxproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "third_party", "third_party", "{DD51818F-0BCA-4035-9E5B-F28A9F87DED4}"
@ -41,6 +53,10 @@ Global
{29D16885-7228-4C31-81ED-5F9187C7F2A9}.Debug|Win32.Build.0 = Debug|Win32
{29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release|Win32.ActiveCfg = Release|Win32
{29D16885-7228-4C31-81ED-5F9187C7F2A9}.Release|Win32.Build.0 = Release|Win32
{D64C6D63-4458-4A88-AB38-35678384A7E4}.Debug|Win32.ActiveCfg = Debug|Win32
{D64C6D63-4458-4A88-AB38-35678384A7E4}.Debug|Win32.Build.0 = Debug|Win32
{D64C6D63-4458-4A88-AB38-35678384A7E4}.Release|Win32.ActiveCfg = Release|Win32
{D64C6D63-4458-4A88-AB38-35678384A7E4}.Release|Win32.Build.0 = Release|Win32
{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|Win32.ActiveCfg = Debug|Win32
{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Debug|Win32.Build.0 = Debug|Win32
{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}.Release|Win32.ActiveCfg = Release|Win32
@ -53,6 +69,18 @@ Global
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}.Debug|Win32.ActiveCfg = Debug|Win32
{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}.Debug|Win32.Build.0 = Debug|Win32
{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}.Release|Win32.ActiveCfg = Release|Win32
{3D304D6B-AAF8-428B-AC7D-A698DDDE93C0}.Release|Win32.Build.0 = Release|Win32
{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}.Debug|Win32.ActiveCfg = Debug|Win32
{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}.Debug|Win32.Build.0 = Debug|Win32
{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}.Release|Win32.ActiveCfg = Release|Win32
{F2EE8FDB-F1E0-43A0-A297-6F255BB52AAA}.Release|Win32.Build.0 = Release|Win32
{C26D04A8-37C6-44C7-B458-906C9FCE928C}.Debug|Win32.ActiveCfg = Debug|Win32
{C26D04A8-37C6-44C7-B458-906C9FCE928C}.Debug|Win32.Build.0 = Debug|Win32
{C26D04A8-37C6-44C7-B458-906C9FCE928C}.Release|Win32.ActiveCfg = Release|Win32
{C26D04A8-37C6-44C7-B458-906C9FCE928C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -41,7 +41,12 @@
<Import Project="global.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>grpc</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>grpc</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@ -268,6 +273,8 @@
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_multipoller_with_poll_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_multipoller_with_epoll.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_posix.c">
</ClCompile>
<ClCompile Include="..\..\src\core\iomgr\pollset_windows.c">

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save