Skip to content

Commit

Permalink
Merge branch 'master' of github.com:grpc/grpc into nanopb_build_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dgquintas committed Jun 11, 2018
2 parents dd8bc8c + b12b813 commit 32c0493
Show file tree
Hide file tree
Showing 161 changed files with 5,493 additions and 921 deletions.
11 changes: 9 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ disable=
# TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have
# this one if we extracted just a few more helper functions...
too-many-nested-blocks,
# NOTE(nathaniel): I have disputed the premise of this inspection from
# the beginning and will continue to do so until it goes away for good.
# TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary
# super-init requirement for abstract class implementations for now.
super-init-not-called,
# NOTE(nathaniel): A single statement that always returns program
# control is better than two statements the first of which sometimes
# returns program control and the second of which always returns
# program control. Probably generally, but definitely in the cases of
# if:/else: and for:/else:.
useless-else-on-loop,
no-else-return,
11 changes: 9 additions & 2 deletions .pylintrc-tests
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ disable=
# TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have
# this one if we extracted just a few more helper functions...
too-many-nested-blocks,
# NOTE(nathaniel): I have disputed the premise of this inspection from
# the beginning and will continue to do so until it goes away for good.
# TODO(https://github.com/grpc/grpc/issues/261): Disable unnecessary
# super-init requirement for abstract class implementations for now.
super-init-not-called,
# NOTE(nathaniel): A single statement that always returns program
# control is better than two statements the first of which sometimes
# returns program control and the second of which always returns
# program control. Probably generally, but definitely in the cases of
# if:/else: and for:/else:.
useless-else-on-loop,
no-else-return,
19 changes: 19 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,25 @@ grpc_cc_library(
],
)

grpc_cc_library(
name = "grpc_cfstream",
srcs = [
"src/core/lib/iomgr/cfstream_handle.cc",
"src/core/lib/iomgr/endpoint_cfstream.cc",
"src/core/lib/iomgr/error_cfstream.cc",
"src/core/lib/iomgr/tcp_client_cfstream.cc",
],
hdrs = [
"src/core/lib/iomgr/cfstream_handle.h",
"src/core/lib/iomgr/endpoint_cfstream.h",
"src/core/lib/iomgr/error_cfstream.h",
],
deps = [
":gpr_base",
":grpc_base",
],
)

grpc_cc_library(
name = "grpc_client_channel",
srcs = [
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ target_include_directories(address_sorting
)

target_link_libraries(address_sorting
${_gRPC_BASELIB_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
)

Expand Down Expand Up @@ -5333,6 +5334,7 @@ add_library(end2end_tests
test/core/end2end/tests/max_message_length.cc
test/core/end2end/tests/negative_deadline.cc
test/core/end2end/tests/network_status_change.cc
test/core/end2end/tests/no_error_on_hotpath.cc
test/core/end2end/tests/no_logging.cc
test/core/end2end/tests/no_op.cc
test/core/end2end/tests/payload.cc
Expand Down Expand Up @@ -5452,6 +5454,7 @@ add_library(end2end_nosec_tests
test/core/end2end/tests/max_message_length.cc
test/core/end2end/tests/negative_deadline.cc
test/core/end2end/tests/network_status_change.cc
test/core/end2end/tests/no_error_on_hotpath.cc
test/core/end2end/tests/no_logging.cc
test/core/end2end/tests/no_op.cc
test/core/end2end/tests/payload.cc
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9989,6 +9989,7 @@ LIBEND2END_TESTS_SRC = \
test/core/end2end/tests/max_message_length.cc \
test/core/end2end/tests/negative_deadline.cc \
test/core/end2end/tests/network_status_change.cc \
test/core/end2end/tests/no_error_on_hotpath.cc \
test/core/end2end/tests/no_logging.cc \
test/core/end2end/tests/no_op.cc \
test/core/end2end/tests/payload.cc \
Expand Down Expand Up @@ -10105,6 +10106,7 @@ LIBEND2END_NOSEC_TESTS_SRC = \
test/core/end2end/tests/max_message_length.cc \
test/core/end2end/tests/negative_deadline.cc \
test/core/end2end/tests/network_status_change.cc \
test/core/end2end/tests/no_error_on_hotpath.cc \
test/core/end2end/tests/no_logging.cc \
test/core/end2end/tests/no_op.cc \
test/core/end2end/tests/payload.cc \
Expand Down
13 changes: 13 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,19 @@ filegroups:
uses:
- grpc_codegen
- grpc_trace_headers
- name: grpc_cfstream
headers:
- src/core/lib/iomgr/cfstream_handle.h
- src/core/lib/iomgr/endpoint_cfstream.h
- src/core/lib/iomgr/error_cfstream.h
src:
- src/core/lib/iomgr/cfstream_handle.cc
- src/core/lib/iomgr/endpoint_cfstream.cc
- src/core/lib/iomgr/error_cfstream.cc
- src/core/lib/iomgr/tcp_client_cfstream.cc
uses:
- grpc_base_headers
- gpr_base_headers
- name: grpc_client_authority_filter
headers:
- src/core/ext/filters/http/client_authority_filter.h
Expand Down
19 changes: 19 additions & 0 deletions gRPC-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,24 @@ Pod::Spec.new do |s|
'src/core/ext/filters/workarounds/workaround_utils.h'
end

s.subspec 'CFStream-Implementation' do |ss|
ss.header_mappings_dir = '.'
ss.dependency "#{s.name}/Implementation", version
ss.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
}
ss.source_files = 'src/core/lib/iomgr/cfstream_handle.cc',
'src/core/lib/iomgr/endpoint_cfstream.cc',
'src/core/lib/iomgr/error_cfstream.cc',
'src/core/lib/iomgr/tcp_client_cfstream.cc',
'src/core/lib/iomgr/cfstream_handle.h',
'src/core/lib/iomgr/endpoint_cfstream.h',
'src/core/lib/iomgr/error_cfstream.h'
ss.private_header_files = 'src/core/lib/iomgr/cfstream_handle.h',
'src/core/lib/iomgr/endpoint_cfstream.h',
'src/core/lib/iomgr/error_cfstream.h'
end

s.subspec 'Cronet-Interface' do |ss|
ss.header_mappings_dir = 'include/grpc'
ss.source_files = 'include/grpc/grpc_cronet.h'
Expand Down Expand Up @@ -1198,6 +1216,7 @@ Pod::Spec.new do |s|
'test/core/end2end/tests/max_message_length.cc',
'test/core/end2end/tests/negative_deadline.cc',
'test/core/end2end/tests/network_status_change.cc',
'test/core/end2end/tests/no_error_on_hotpath.cc',
'test/core/end2end/tests/no_logging.cc',
'test/core/end2end/tests/no_op.cc',
'test/core/end2end/tests/payload.cc',
Expand Down
23 changes: 18 additions & 5 deletions gRPC-ProtoRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,25 @@ Pod::Spec.new do |s|
s.header_dir = name

src_dir = 'src/objective-c/ProtoRPC'
s.source_files = "#{src_dir}/*.{h,m}"
s.header_mappings_dir = "#{src_dir}"

s.dependency 'gRPC', version
s.dependency 'gRPC-RxLibrary', version
s.dependency 'Protobuf', '~> 3.0'
s.default_subspec = 'Main'

s.subspec 'Main' do |ss|
ss.header_mappings_dir = "#{src_dir}"
ss.dependency 'gRPC', version
ss.dependency 'gRPC-RxLibrary', version
ss.dependency 'Protobuf', '~> 3.0'

ss.source_files = "#{src_dir}/*.{h,m}"
end
s.subspec 'CFStream' do |ss|
ss.dependency 'gRPC/CFStream', version
ss.dependency "#{s.name}/Main", version
ss.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
}
end

s.pod_target_xcconfig = {
# This is needed by all pods that depend on Protobuf:
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
Expand Down
10 changes: 10 additions & 0 deletions gRPC.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC-Core', version
end

# This subspec is mutually exclusive with the `Main` subspec
s.subspec 'CFStream' do |ss|
ss.dependency 'gRPC-Core/CFStream-Implementation', version
ss.dependency "#{s.name}/Main", version

ss.pod_target_xcconfig = {
'GCC_PREPROCESSOR_DEFINITIONS' => 'GRPC_CFSTREAM=1'
}
end

s.subspec 'GID' do |ss|
ss.ios.deployment_target = '7.0'

Expand Down
2 changes: 2 additions & 0 deletions grpc.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2636,6 +2636,7 @@
'test/core/end2end/tests/max_message_length.cc',
'test/core/end2end/tests/negative_deadline.cc',
'test/core/end2end/tests/network_status_change.cc',
'test/core/end2end/tests/no_error_on_hotpath.cc',
'test/core/end2end/tests/no_logging.cc',
'test/core/end2end/tests/no_op.cc',
'test/core/end2end/tests/payload.cc',
Expand Down Expand Up @@ -2726,6 +2727,7 @@
'test/core/end2end/tests/max_message_length.cc',
'test/core/end2end/tests/negative_deadline.cc',
'test/core/end2end/tests/network_status_change.cc',
'test/core/end2end/tests/no_error_on_hotpath.cc',
'test/core/end2end/tests/no_logging.cc',
'test/core/end2end/tests/no_op.cc',
'test/core/end2end/tests/payload.cc',
Expand Down
2 changes: 1 addition & 1 deletion include/grpc/impl/codegen/grpc_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ typedef struct {
#define GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE "grpc.per_rpc_retry_buffer_size"
/** Channel arg that carries the bridged objective c object for custom metrics
* logging filter. */
#define GRPC_ARG_MOBILE_LOG_CONFIG "grpc.mobile_log_config"
#define GRPC_ARG_MOBILE_LOG_CONTEXT "grpc.mobile_log_context"
/** If non-zero, client authority filter is disabled for the channel */
#define GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER \
"grpc.disable_client_authority_filter"
Expand Down
3 changes: 3 additions & 0 deletions include/grpc/impl/codegen/port_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_TIME 1
#define GPR_GETPID_IN_UNISTD_H 1
/* TODO(mxyan): Remove when CFStream becomes default */
#ifndef GRPC_CFSTREAM
#define GPR_SUPPORT_CHANNELS_FROM_FD 1
#endif
#ifdef _LP64
#define GPR_ARCH_64 1
#else /* _LP64 */
Expand Down
11 changes: 7 additions & 4 deletions include/grpcpp/impl/codegen/call.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,13 @@ class CallOpClientRecvStatus {
binary_error_details =
grpc::string(iter->second.begin(), iter->second.length());
}
*recv_status_ = Status(static_cast<StatusCode>(status_code_),
grpc::string(GRPC_SLICE_START_PTR(error_message_),
GRPC_SLICE_END_PTR(error_message_)),
binary_error_details);
*recv_status_ =
Status(static_cast<StatusCode>(status_code_),
GRPC_SLICE_IS_EMPTY(error_message_)
? grpc::string()
: grpc::string(GRPC_SLICE_START_PTR(error_message_),
GRPC_SLICE_END_PTR(error_message_)),
binary_error_details);
client_context_->set_debug_error_string(
debug_error_string_ != nullptr ? debug_error_string_ : "");
g_core_codegen_interface->grpc_slice_unref(error_message_);
Expand Down
13 changes: 9 additions & 4 deletions src/compiler/csharp_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,14 +680,19 @@ grpc::string GetServices(const FileDescriptor* file, bool generate_client,
out.Print("using grpc = global::Grpc.Core;\n");
out.Print("\n");

out.Print("namespace $namespace$ {\n", "namespace", GetFileNamespace(file));
out.Indent();
grpc::string file_namespace = GetFileNamespace(file);
if (file_namespace != "") {
out.Print("namespace $namespace$ {\n", "namespace", file_namespace);
out.Indent();
}
for (int i = 0; i < file->service_count(); i++) {
GenerateService(&out, file->service(i), generate_client, generate_server,
internal_access);
}
out.Outdent();
out.Print("}\n");
if (file_namespace != "") {
out.Outdent();
out.Print("}\n");
}
out.Print("#endregion\n");
}
return output;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <grpc/support/port_platform.h>

#include "src/core/lib/iomgr/port.h"
#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET)
#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER)

#include <ares.h>
#include <sys/ioctl.h>
Expand Down Expand Up @@ -348,4 +348,4 @@ void grpc_ares_ev_driver_start(grpc_ares_ev_driver* ev_driver) {
gpr_mu_unlock(&ev_driver->mu);
}

#endif /* GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET) */
#endif /* GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER) */
12 changes: 4 additions & 8 deletions src/core/ext/transport/chttp2/transport/chttp2_transport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1451,10 +1451,8 @@ static void perform_stream_op_locked(void* stream_op,
}
}
if (op_payload->send_initial_metadata.peer_string != nullptr) {
char* old_peer_string = (char*)gpr_atm_full_xchg(
op_payload->send_initial_metadata.peer_string,
(gpr_atm)gpr_strdup(t->peer_string));
gpr_free(old_peer_string);
gpr_atm_rel_store(op_payload->send_initial_metadata.peer_string,
(gpr_atm)t->peer_string);
}
}

Expand Down Expand Up @@ -1569,10 +1567,8 @@ static void perform_stream_op_locked(void* stream_op,
s->trailing_metadata_available =
op_payload->recv_initial_metadata.trailing_metadata_available;
if (op_payload->recv_initial_metadata.peer_string != nullptr) {
char* old_peer_string = (char*)gpr_atm_full_xchg(
op_payload->recv_initial_metadata.peer_string,
(gpr_atm)gpr_strdup(t->peer_string));
gpr_free(old_peer_string);
gpr_atm_rel_store(op_payload->recv_initial_metadata.peer_string,
(gpr_atm)t->peer_string);
}
grpc_chttp2_maybe_complete_recv_initial_metadata(t, s);
}
Expand Down
Loading

0 comments on commit 32c0493

Please sign in to comment.