Skip to content

Commit

Permalink
Merge branch 'master' of github.com:grpc/grpc into ssl_credentials_ov…
Browse files Browse the repository at this point in the history
…erride_default_roots
  • Loading branch information
jboeuf committed Jan 28, 2016
2 parents a50da47 + 822602c commit 54cc08c
Show file tree
Hide file tree
Showing 48 changed files with 803 additions and 566 deletions.
445 changes: 143 additions & 302 deletions Makefile

Large diffs are not rendered by default.

34 changes: 18 additions & 16 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2495,9 +2495,8 @@ vspackages:
configs:
asan:
CC: clang
CFLAGS: -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument
CPPFLAGS: -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument
CXX: clang++
CXXFLAGS: -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument
LD: clang
LDFLAGS: -fsanitize=address
LDXX: clang++
Expand All @@ -2508,9 +2507,8 @@ configs:
timeout_multiplier: 1.5
asan-noleaks:
CC: clang
CFLAGS: -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument
CPPFLAGS: -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument
CXX: clang++
CXXFLAGS: -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument
LD: clang
LDFLAGS: -fsanitize=address
LDXX: clang++
Expand All @@ -2527,9 +2525,8 @@ configs:
LDFLAGS: -rdynamic
gcov:
CC: gcc
CFLAGS: -O0 -fprofile-arcs -ftest-coverage -Wno-return-type
CPPFLAGS: -O0 -fprofile-arcs -ftest-coverage -Wno-return-type
CXX: g++
CXXFLAGS: -O0 -fprofile-arcs -ftest-coverage -Wno-return-type
DEFINES: _DEBUG DEBUG GPR_GCOV
LD: gcc
LDFLAGS: -fprofile-arcs -ftest-coverage -rdynamic
Expand All @@ -2548,20 +2545,17 @@ configs:
valgrind: --tool=memcheck --leak-check=full
msan:
CC: clang
CFLAGS: -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer
CPPFLAGS: -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer
-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument
-fPIE -pie
CXX: clang++
CXXFLAGS: -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer
-DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument
-fPIE -pie
DEFINES: NDEBUG
LD: clang
LDFLAGS: -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1
-fPIE -pie $(if $(JENKINS_BUILD),-Wl$(comma)-Ttext-segment=0x7e0000000000,)
LDXX: clang++
compile_the_world: true
timeout_multiplier: 1.5
timeout_multiplier: 2
mutrace:
CPPFLAGS: -O0
DEFINES: _DEBUG DEBUG
Expand All @@ -2575,11 +2569,9 @@ configs:
DEFINES: NDEBUG
tsan:
CC: clang
CFLAGS: -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument
CPPFLAGS: -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument
-fPIE -pie
CXX: clang++
CXXFLAGS: -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument
-fPIE -pie
LD: clang
LDFLAGS: -fsanitize=thread -fPIE -pie $(if $(JENKINS_BUILD),-Wl$(comma)-Ttext-segment=0x7e0000000000,)
LDXX: clang++
Expand All @@ -2589,15 +2581,25 @@ configs:
timeout_multiplier: 2
ubsan:
CC: clang
CFLAGS: -O1 -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument
CPPFLAGS: -O1 -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument
CXX: clang++
CXXFLAGS: -O1 -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument
DEFINES: NDEBUG
LD: clang
LDFLAGS: -fsanitize=undefined
LDXX: clang++
compile_the_world: true
timeout_multiplier: 1.5
defaults:
boringssl:
CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value
CPPFLAGS: -Ithird_party/boringssl/include -fvisibility=hidden -DOPENSSL_NO_ASM
-D_GNU_SOURCE
global:
CPPFLAGS: -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
LDFLAGS: -g
zlib:
CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration
$(W_NO_SHIFT_NEGATIVE_VALUE) -fvisibility=hidden
node_modules:
- deps:
- grpc
Expand Down
4 changes: 2 additions & 2 deletions include/grpc/support/log_win32.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -42,7 +42,7 @@ extern "C" {
* formatted error message, corresponding to the error messageid.
* Use in conjunction with GetLastError() et al.
*/
char *gpr_format_message(DWORD messageid);
char *gpr_format_message(int messageid);

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions include/grpc/support/thd.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -48,7 +48,7 @@
extern "C" {
#endif

typedef uint64_t gpr_thd_id;
typedef uintptr_t gpr_thd_id;

/* Thread creation options. */
typedef struct {
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def cython_extensions(package_names, module_names, include_dirs, libraries,
}

INSTALL_REQUIRES = (
'six>=1.10',
'enum34>=1.0.4',
'futures>=2.2.0',
# TODO(atash): eventually split the grpcio package into a metapackage
Expand All @@ -131,13 +132,15 @@ def cython_extensions(package_names, module_names, include_dirs, libraries,
) + INSTALL_REQUIRES

COMMAND_CLASS = {
'install': commands.Install,
'doc': commands.SphinxDocumentation,
'build_proto_modules': commands.BuildProtoModules,
'build_project_metadata': commands.BuildProjectMetadata,
'build_py': commands.BuildPy,
'build_ext': commands.BuildExt,
'gather': commands.Gather,
'run_interop': commands.RunInterop,
'bdist_egg_grpc_custom': commands.BdistEggCustomName,
}

# Ensure that package data is copied over before any commands have been run:
Expand Down Expand Up @@ -187,7 +190,7 @@ def cython_extensions(package_names, module_names, include_dirs, libraries,

setuptools.setup(
name='grpcio',
version='0.12.0b5',
version='0.12.0b6',
license=LICENSE,
ext_modules=CYTHON_EXTENSION_MODULES,
packages=list(PACKAGES),
Expand Down
5 changes: 5 additions & 0 deletions src/boringssl/gen_build_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ def WriteFiles(self, files, asm_outputs):
for f in files['ssl_headers'] + files['ssl_internal_headers'] + files['crypto_headers'] + files['crypto_internal_headers']
),
'boringssl': True,
'defaults': 'boringssl',
},
{
'name': 'boringssl_test_util',
'build': 'private',
'language': 'c++',
'secure': 'no',
'boringssl': True,
'defaults': 'boringssl',
'src': [
map_dir(f)
for f in sorted(files['test_support'])
Expand All @@ -103,6 +105,7 @@ def WriteFiles(self, files, asm_outputs):
'src': [map_dir(test)],
'vs_proj_dir': 'test/boringssl',
'boringssl': True,
'defaults': 'boringssl',
'deps': [
'boringssl_test_util',
'boringssl',
Expand All @@ -120,6 +123,7 @@ def WriteFiles(self, files, asm_outputs):
'src': [],
'vs_proj_dir': 'test/boringssl',
'boringssl': True,
'defaults': 'boringssl',
'deps': [
'boringssl_%s_lib' % os.path.splitext(os.path.basename(test))[0],
'boringssl_test_util',
Expand All @@ -138,6 +142,7 @@ def WriteFiles(self, files, asm_outputs):
'flaky': False,
'language': 'c++',
'boringssl': True,
'defaults': 'boringssl',
'cpu_cost': 1.0
}
for test in files['tests']
Expand Down
7 changes: 4 additions & 3 deletions src/core/channel/channel_args.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -35,6 +35,7 @@
#include "src/core/channel/channel_args.h"
#include "src/core/support/string.h"

#include <grpc/census.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
Expand Down Expand Up @@ -119,10 +120,10 @@ int grpc_channel_args_is_census_enabled(const grpc_channel_args *a) {
if (a == NULL) return 0;
for (i = 0; i < a->num_args; i++) {
if (0 == strcmp(a->args[i].key, GRPC_ARG_ENABLE_CENSUS)) {
return a->args[i].value.integer != 0;
return a->args[i].value.integer != 0 && census_enabled();
}
}
return 0;
return census_enabled();
}

grpc_compression_algorithm grpc_channel_args_get_compression_algorithm(
Expand Down
14 changes: 10 additions & 4 deletions src/core/client_config/subchannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,13 @@ grpc_subchannel *grpc_subchannel_create(grpc_connector *connector,
c->connector = connector;
grpc_connector_ref(c->connector);
c->num_filters = args->filter_count;
c->filters = gpr_malloc(sizeof(grpc_channel_filter *) * c->num_filters);
memcpy((void *)c->filters, args->filters,
sizeof(grpc_channel_filter *) * c->num_filters);
if (c->num_filters > 0) {
c->filters = gpr_malloc(sizeof(grpc_channel_filter *) * c->num_filters);
memcpy((void *)c->filters, args->filters,
sizeof(grpc_channel_filter *) * c->num_filters);
} else {
c->filters = NULL;
}
c->addr = gpr_malloc(args->addr_len);
memcpy(c->addr, args->addr, args->addr_len);
grpc_pollset_set_init(&c->pollset_set);
Expand Down Expand Up @@ -483,7 +487,9 @@ static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
/* build final filter list */
num_filters = c->num_filters + c->connecting_result.num_filters + 1;
filters = gpr_malloc(sizeof(*filters) * num_filters);
memcpy((void *)filters, c->filters, sizeof(*filters) * c->num_filters);
if (c->num_filters > 0) {
memcpy((void *)filters, c->filters, sizeof(*filters) * c->num_filters);
}
memcpy((void *)(filters + c->num_filters), c->connecting_result.filters,
sizeof(*filters) * c->connecting_result.num_filters);
filters[num_filters - 1] = &grpc_connected_channel_filter;
Expand Down
6 changes: 2 additions & 4 deletions src/core/iomgr/iocp_windows.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -67,7 +67,7 @@ static DWORD deadline_to_millis_timeout(gpr_timespec deadline,
return 0;
}
timeout = gpr_time_sub(deadline, now);
return gpr_time_to_millis(gpr_time_add(
return (DWORD)gpr_time_to_millis(gpr_time_add(
timeout, gpr_time_from_nanos(GPR_NS_PER_MS - 1, GPR_TIMESPAN)));
}

Expand Down Expand Up @@ -179,11 +179,9 @@ void grpc_iocp_add_socket(grpc_winsocket *socket) {
static void socket_notify_on_iocp(grpc_exec_ctx *exec_ctx,
grpc_winsocket *socket, grpc_closure *closure,
grpc_winsocket_callback_info *info) {
int run_now = 0;
GPR_ASSERT(info->closure == NULL);
gpr_mu_lock(&socket->state_mu);
if (info->has_pending_iocp) {
run_now = 1;
info->has_pending_iocp = 0;
grpc_exec_ctx_enqueue(exec_ctx, closure, 1);
} else {
Expand Down
11 changes: 1 addition & 10 deletions src/core/iomgr/pollset_windows.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -81,15 +81,6 @@ static grpc_pollset_worker *pop_front_worker(
}
}

static void push_back_worker(grpc_pollset_worker *root,
grpc_pollset_worker_link_type type,
grpc_pollset_worker *worker) {
worker->links[type].next = root;
worker->links[type].prev = worker->links[type].next->links[type].prev;
worker->links[type].prev->links[type].next =
worker->links[type].next->links[type].prev = worker;
}

static void push_front_worker(grpc_pollset_worker *root,
grpc_pollset_worker_link_type type,
grpc_pollset_worker *worker) {
Expand Down
7 changes: 1 addition & 6 deletions src/core/iomgr/sockaddr_win32.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -38,9 +38,4 @@
#include <ws2tcpip.h>
#include <mswsock.h>

#ifdef __MINGW32__
/* mingw seems to be missing that definition. */
const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
#endif

#endif /* GRPC_INTERNAL_CORE_IOMGR_SOCKADDR_WIN32_H */
2 changes: 1 addition & 1 deletion src/core/iomgr/tcp_server_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index,
for (sp = s->head; sp && port_index != 0; sp = sp->next, --port_index)
;
if (sp) {
return _open_osfhandle(sp->socket->socket, 0);
return _open_osfhandle((intptr_t)sp->socket->socket, 0);
} else {
return -1;
}
Expand Down
6 changes: 1 addition & 5 deletions src/core/iomgr/tcp_windows.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -143,10 +143,7 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *tcpp, int success) {
grpc_closure *cb = tcp->read_cb;
grpc_winsocket *socket = tcp->socket;
gpr_slice sub;
gpr_slice *slice = NULL;
size_t nslices = 0;
grpc_winsocket_callback_info *info = &socket->read_info;
int do_abort = 0;

if (success) {
if (socket->read_info.wsa_error != 0 && !tcp->shutting_down) {
Expand Down Expand Up @@ -238,7 +235,6 @@ static void on_write(grpc_exec_ctx *exec_ctx, void *tcpp, int success) {
grpc_winsocket *handle = tcp->socket;
grpc_winsocket_callback_info *info = &handle->write_info;
grpc_closure *cb;
int do_abort = 0;

gpr_mu_lock(&tcp->mu);
cb = tcp->write_cb;
Expand Down
12 changes: 1 addition & 11 deletions src/core/iomgr/udp_server.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2015, Google Inc.
* Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -425,15 +425,5 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
gpr_mu_unlock(&s->mu);
}

/* TODO(rjshade): Add a test for this method. */
void grpc_udp_server_write(server_port *sp, const char *buffer, size_t buf_len,
const struct sockaddr *peer_address) {
ssize_t rc;
rc = sendto(sp->fd, buffer, buf_len, 0, peer_address, sizeof(peer_address));
if (rc < 0) {
gpr_log(GPR_ERROR, "Unable to send data: %s", strerror(errno));
}
}

#endif
#endif
Loading

0 comments on commit 54cc08c

Please sign in to comment.