grpc 0.14.1 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +1398 -817
- data/include/grpc/compression.h +2 -1
- data/include/grpc/grpc.h +10 -1
- data/include/grpc/grpc_cronet.h +51 -0
- data/include/grpc/grpc_posix.h +70 -0
- data/include/grpc/impl/codegen/atm.h +2 -2
- data/include/grpc/impl/codegen/{atm_win32.h → atm_windows.h} +3 -3
- data/include/grpc/impl/codegen/compression_types.h +39 -5
- data/include/grpc/impl/codegen/connectivity_state.h +1 -1
- data/include/grpc/impl/codegen/grpc_types.h +10 -0
- data/include/grpc/impl/codegen/log.h +2 -1
- data/include/grpc/impl/codegen/port_platform.h +30 -12
- data/include/grpc/impl/codegen/slice_buffer.h +2 -3
- data/include/grpc/impl/codegen/sync.h +2 -2
- data/include/grpc/impl/codegen/{sync_win32.h → sync_windows.h} +3 -3
- data/include/grpc/support/{sync_win32.h → atm_windows.h} +4 -4
- data/include/grpc/support/avl.h +5 -0
- data/include/grpc/support/{log_win32.h → log_windows.h} +3 -3
- data/include/grpc/support/string_util.h +2 -1
- data/include/grpc/support/{atm_win32.h → sync_windows.h} +4 -4
- data/src/core/ext/census/gen/census.pb.c +179 -0
- data/src/core/ext/census/gen/census.pb.h +294 -0
- data/src/core/ext/census/grpc_filter.c +11 -7
- data/src/core/ext/client_config/channel_connectivity.c +28 -14
- data/src/core/ext/client_config/client_channel.c +77 -53
- data/src/core/ext/client_config/connector.h +1 -1
- data/src/core/ext/client_config/lb_policy.c +9 -6
- data/src/core/ext/client_config/lb_policy.h +9 -5
- data/src/core/ext/client_config/subchannel.c +58 -39
- data/src/core/ext/client_config/subchannel.h +3 -2
- data/src/core/ext/client_config/subchannel_call_holder.c +34 -19
- data/src/core/ext/client_config/subchannel_call_holder.h +2 -1
- data/src/core/ext/client_config/subchannel_index.c +20 -9
- data/src/core/ext/lb_policy/grpclb/load_balancer_api.c +7 -7
- data/src/core/ext/lb_policy/grpclb/load_balancer_api.h +5 -5
- data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/{v0 → v1}/load_balancer.pb.c +29 -30
- data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h +178 -0
- data/src/core/ext/lb_policy/pick_first/pick_first.c +65 -45
- data/src/core/ext/lb_policy/round_robin/round_robin.c +84 -43
- data/src/core/ext/load_reporting/load_reporting.c +133 -0
- data/src/core/ext/load_reporting/load_reporting.h +75 -0
- data/src/core/ext/load_reporting/load_reporting_filter.c +151 -0
- data/src/core/ext/load_reporting/load_reporting_filter.h +41 -0
- data/src/core/ext/resolver/dns/native/dns_resolver.c +22 -8
- data/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +2 -2
- data/src/core/ext/transport/chttp2/client/insecure/channel_create.c +4 -4
- data/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c +95 -0
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +14 -18
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c +49 -24
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +82 -0
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +104 -60
- data/src/core/ext/transport/chttp2/transport/bin_decoder.c +232 -0
- data/src/{ruby/ext/grpc/rb_signal.c → core/ext/transport/chttp2/transport/bin_decoder.h} +27 -31
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.c +481 -260
- data/src/core/ext/transport/chttp2/transport/frame.h +1 -7
- data/src/core/ext/transport/chttp2/transport/frame_data.c +44 -27
- data/src/core/ext/transport/chttp2/transport/frame_data.h +6 -5
- data/src/core/ext/transport/chttp2/transport/frame_goaway.c +23 -17
- data/src/core/ext/transport/chttp2/transport/frame_goaway.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_ping.c +12 -7
- data/src/core/ext/transport/chttp2/transport/frame_ping.h +3 -3
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.c +25 -12
- data/src/core/ext/transport/chttp2/transport/frame_rst_stream.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_settings.c +23 -21
- data/src/core/ext/transport/chttp2/transport/frame_settings.h +2 -2
- data/src/core/ext/transport/chttp2/transport/frame_window_update.c +17 -9
- data/src/core/ext/transport/chttp2/transport/frame_window_update.h +2 -2
- data/src/core/ext/transport/chttp2/transport/hpack_parser.c +365 -287
- data/src/core/ext/transport/chttp2/transport/hpack_parser.h +8 -6
- data/src/core/ext/transport/chttp2/transport/hpack_table.c +24 -20
- data/src/core/ext/transport/chttp2/transport/hpack_table.h +5 -4
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.c +1 -0
- data/src/core/ext/transport/chttp2/transport/incoming_metadata.h +1 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +34 -32
- data/src/core/ext/transport/chttp2/transport/parsing.c +296 -212
- data/src/core/ext/transport/chttp2/transport/writing.c +12 -9
- data/src/core/lib/channel/channel_args.c +26 -12
- data/src/core/lib/channel/channel_args.h +1 -1
- data/src/core/lib/channel/channel_stack.c +12 -8
- data/src/core/lib/channel/channel_stack.h +27 -11
- data/src/core/lib/channel/channel_stack_builder.c +2 -2
- data/src/core/lib/channel/compress_filter.c +26 -31
- data/src/core/lib/channel/compress_filter.h +4 -4
- data/src/core/lib/channel/connected_channel.c +7 -5
- data/src/core/lib/channel/http_client_filter.c +34 -8
- data/src/core/lib/channel/http_client_filter.h +1 -1
- data/src/core/lib/channel/http_server_filter.c +21 -12
- data/src/core/lib/compression/{compression_algorithm.c → compression.c} +22 -21
- data/src/core/lib/http/httpcli.c +81 -59
- data/src/core/lib/http/httpcli.h +11 -15
- data/src/core/lib/http/httpcli_security_connector.c +5 -3
- data/src/core/lib/http/parser.c +127 -118
- data/src/core/lib/http/parser.h +11 -6
- data/src/core/lib/iomgr/closure.c +20 -16
- data/src/core/lib/iomgr/closure.h +19 -15
- data/src/core/lib/iomgr/endpoint.h +1 -1
- data/src/core/lib/iomgr/endpoint_pair_posix.c +2 -2
- data/src/core/lib/iomgr/error.c +535 -0
- data/src/core/lib/iomgr/error.h +192 -0
- data/src/core/lib/iomgr/ev_poll_and_epoll_posix.c +190 -83
- data/src/core/lib/iomgr/ev_poll_posix.c +1267 -0
- data/src/{ruby/ext/grpc/rb_signal.h → core/lib/iomgr/ev_poll_posix.h} +7 -5
- data/src/core/lib/iomgr/ev_posix.c +104 -14
- data/src/core/lib/iomgr/ev_posix.h +17 -7
- data/src/core/lib/iomgr/exec_ctx.c +25 -7
- data/src/core/lib/iomgr/exec_ctx.h +27 -8
- data/src/core/lib/iomgr/executor.c +2 -2
- data/src/core/lib/iomgr/executor.h +1 -1
- data/src/core/lib/iomgr/iocp_windows.c +2 -41
- data/src/core/lib/iomgr/iocp_windows.h +0 -8
- data/src/core/lib/iomgr/iomgr.c +5 -4
- data/src/core/lib/iomgr/iomgr_posix.c +5 -1
- data/src/core/lib/iomgr/iomgr_windows.c +1 -1
- data/src/core/lib/{support → iomgr}/load_file.c +15 -17
- data/src/core/lib/{support → iomgr}/load_file.h +8 -7
- data/src/core/lib/iomgr/polling_entity.c +104 -0
- data/src/core/lib/iomgr/polling_entity.h +81 -0
- data/src/core/lib/iomgr/pollset.h +6 -5
- data/src/core/lib/iomgr/pollset_set_windows.c +4 -1
- data/src/core/lib/iomgr/pollset_windows.c +10 -6
- data/src/core/lib/iomgr/resolve_address.h +5 -9
- data/src/core/lib/iomgr/resolve_address_posix.c +55 -38
- data/src/core/lib/iomgr/resolve_address_windows.c +51 -37
- data/src/core/lib/iomgr/sockaddr.h +2 -2
- data/src/core/lib/iomgr/{sockaddr_win32.h → sockaddr_windows.h} +3 -3
- data/src/core/lib/iomgr/socket_utils_common_posix.c +92 -45
- data/src/core/lib/iomgr/socket_utils_posix.h +19 -12
- data/src/core/lib/iomgr/socket_windows.c +61 -2
- data/src/core/lib/iomgr/socket_windows.h +13 -0
- data/src/core/lib/iomgr/tcp_client_posix.c +54 -39
- data/src/core/lib/iomgr/tcp_client_windows.c +34 -34
- data/src/core/lib/iomgr/tcp_posix.c +43 -39
- data/src/core/lib/iomgr/tcp_server.h +5 -3
- data/src/core/lib/iomgr/tcp_server_posix.c +103 -64
- data/src/core/lib/iomgr/tcp_server_windows.c +114 -101
- data/src/core/lib/iomgr/tcp_windows.c +45 -50
- data/src/core/lib/iomgr/tcp_windows.h +1 -1
- data/src/core/lib/iomgr/timer.c +26 -13
- data/src/core/lib/iomgr/udp_server.c +28 -4
- data/src/core/lib/iomgr/udp_server.h +5 -1
- data/src/core/lib/iomgr/unix_sockets_posix.c +8 -7
- data/src/core/lib/iomgr/unix_sockets_posix.h +2 -1
- data/src/core/lib/iomgr/unix_sockets_posix_noop.c +4 -2
- data/src/core/lib/iomgr/wakeup_fd_eventfd.c +15 -5
- data/src/core/lib/iomgr/wakeup_fd_pipe.c +13 -9
- data/src/core/lib/iomgr/wakeup_fd_posix.c +6 -6
- data/src/core/lib/iomgr/wakeup_fd_posix.h +9 -6
- data/src/core/lib/iomgr/workqueue.h +5 -4
- data/src/core/lib/iomgr/workqueue_posix.c +40 -26
- data/src/core/lib/iomgr/workqueue_windows.c +2 -2
- data/src/core/lib/profiling/basic_timers.c +2 -2
- data/src/core/lib/security/{security_context.c → context/security_context.c} +1 -1
- data/src/core/lib/security/{security_context.h → context/security_context.h} +4 -4
- data/src/core/lib/security/credentials/composite/composite_credentials.c +263 -0
- data/src/core/lib/security/credentials/composite/composite_credentials.h +72 -0
- data/src/core/lib/security/credentials/credentials.c +233 -0
- data/src/core/lib/security/{credentials.h → credentials/credentials.h} +19 -157
- data/src/core/lib/security/{credentials_metadata.c → credentials/credentials_metadata.c} +1 -1
- data/src/core/lib/security/credentials/fake/fake_credentials.c +139 -0
- data/src/core/lib/security/credentials/fake/fake_credentials.h +56 -0
- data/src/core/lib/security/{credentials_posix.c → credentials/google_default/credentials_posix.c} +1 -1
- data/src/core/lib/security/{credentials_win32.c → credentials/google_default/credentials_windows.c} +3 -3
- data/src/core/lib/security/{google_default_credentials.c → credentials/google_default/google_default_credentials.c} +93 -35
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +46 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.c +85 -0
- data/src/core/lib/security/credentials/iam/iam_credentials.h +44 -0
- data/src/core/lib/security/{json_token.c → credentials/jwt/json_token.c} +10 -101
- data/src/core/lib/security/{json_token.h → credentials/jwt/json_token.h} +3 -33
- data/src/core/lib/security/credentials/jwt/jwt_credentials.c +160 -0
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +62 -0
- data/src/core/lib/security/{jwt_verifier.c → credentials/jwt/jwt_verifier.c} +35 -15
- data/src/core/lib/security/{jwt_verifier.h → credentials/jwt/jwt_verifier.h} +3 -3
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.c +433 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +109 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.c +129 -0
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +45 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.c +240 -0
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +48 -0
- data/src/core/lib/security/{auth_filters.h → transport/auth_filters.h} +3 -3
- data/src/core/lib/security/{client_auth_filter.c → transport/client_auth_filter.c} +27 -20
- data/src/core/lib/security/{handshake.c → transport/handshake.c} +77 -45
- data/src/core/lib/security/{handshake.h → transport/handshake.h} +9 -11
- data/src/core/lib/security/{secure_endpoint.c → transport/secure_endpoint.c} +19 -12
- data/src/core/lib/security/{secure_endpoint.h → transport/secure_endpoint.h} +3 -3
- data/src/core/lib/security/{security_connector.c → transport/security_connector.c} +26 -17
- data/src/core/lib/security/{security_connector.h → transport/security_connector.h} +8 -8
- data/src/core/lib/security/{server_auth_filter.c → transport/server_auth_filter.c} +24 -16
- data/src/core/lib/security/transport/tsi_error.c +40 -0
- data/src/core/lib/security/transport/tsi_error.h +42 -0
- data/src/core/lib/security/{b64.c → util/b64.c} +1 -1
- data/src/core/lib/security/{b64.h → util/b64.h} +3 -3
- data/src/core/lib/security/util/json_util.c +61 -0
- data/src/core/lib/security/util/json_util.h +55 -0
- data/src/core/lib/support/avl.c +11 -0
- data/src/core/lib/support/cpu_windows.c +2 -2
- data/src/core/lib/support/{env_win32.c → env_windows.c} +3 -3
- data/src/core/lib/support/log.c +3 -1
- data/src/core/lib/support/log_linux.c +2 -2
- data/src/core/lib/support/{log_win32.c → log_windows.c} +4 -4
- data/src/core/lib/support/murmur_hash.c +3 -5
- data/src/core/lib/support/string.c +10 -0
- data/src/core/lib/support/string.h +4 -0
- data/src/core/lib/support/{string_util_win32.c → string_util_windows.c} +3 -3
- data/src/core/lib/support/{string_win32.c → string_windows.c} +2 -2
- data/src/core/lib/support/{string_win32.h → string_windows.h} +5 -5
- data/src/core/lib/support/subprocess_windows.c +1 -1
- data/src/core/lib/support/{sync_win32.c → sync_windows.c} +2 -2
- data/src/core/lib/support/{thd_win32.c → thd_windows.c} +2 -2
- data/src/core/lib/support/{time_win32.c → time_windows.c} +2 -2
- data/src/core/lib/support/tmpfile_msys.c +1 -1
- data/src/core/lib/support/{tmpfile_win32.c → tmpfile_windows.c} +3 -3
- data/src/core/lib/surface/alarm.c +2 -2
- data/src/core/lib/surface/byte_buffer_reader.c +13 -6
- data/src/core/lib/surface/call.c +323 -123
- data/src/core/lib/surface/call.h +2 -0
- data/src/core/lib/surface/call_log_batch.c +1 -1
- data/src/core/lib/surface/channel.c +64 -15
- data/src/core/lib/surface/channel.h +9 -0
- data/src/core/lib/surface/channel_ping.c +3 -3
- data/src/core/lib/surface/completion_queue.c +75 -19
- data/src/core/lib/surface/completion_queue.h +7 -2
- data/src/core/lib/surface/init.c +2 -1
- data/src/core/lib/surface/init_secure.c +4 -4
- data/src/core/lib/surface/lame_client.c +12 -8
- data/src/core/lib/surface/server.c +213 -120
- data/src/core/lib/surface/server.h +1 -0
- data/src/core/lib/surface/version.c +1 -1
- data/src/core/lib/transport/connectivity_state.c +40 -18
- data/src/core/lib/transport/connectivity_state.h +4 -1
- data/src/core/lib/transport/metadata.c +23 -23
- data/src/core/lib/transport/metadata.h +4 -0
- data/src/core/lib/transport/metadata_batch.c +9 -0
- data/src/core/lib/transport/metadata_batch.h +3 -0
- data/src/core/lib/transport/static_metadata.c +6 -5
- data/src/core/lib/transport/static_metadata.h +64 -60
- data/src/core/lib/transport/transport.c +24 -12
- data/src/core/lib/transport/transport.h +6 -5
- data/src/core/lib/transport/transport_impl.h +4 -0
- data/src/core/lib/transport/transport_op_string.c +2 -2
- data/src/core/plugin_registry/grpc_plugin_registry.c +4 -0
- data/src/ruby/bin/math_services.rb +41 -2
- data/src/ruby/ext/grpc/rb_call.c +42 -40
- data/src/ruby/ext/grpc/rb_channel.c +1 -1
- data/src/ruby/ext/grpc/rb_completion_queue.c +59 -6
- data/src/ruby/ext/grpc/rb_completion_queue.h +1 -1
- data/src/ruby/ext/grpc/rb_grpc.c +1 -3
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.c +12 -2
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +21 -5
- data/src/ruby/ext/grpc/rb_loader.c +1 -1
- data/src/ruby/ext/grpc/rb_server.c +5 -3
- data/src/ruby/lib/grpc.rb +0 -3
- data/src/ruby/lib/grpc/errors.rb +3 -2
- data/src/ruby/lib/grpc/generic/active_call.rb +32 -42
- data/src/ruby/lib/grpc/generic/bidi_call.rb +20 -0
- data/src/ruby/lib/grpc/generic/client_stub.rb +31 -54
- data/src/ruby/lib/grpc/generic/rpc_desc.rb +4 -4
- data/src/ruby/lib/grpc/generic/rpc_server.rb +12 -23
- data/src/ruby/lib/grpc/generic/service.rb +8 -8
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_services.rb +30 -2
- data/src/ruby/pb/grpc/testing/duplicate/echo_duplicate_services.rb +34 -4
- data/src/ruby/pb/grpc/testing/metrics_services.rb +39 -2
- data/src/ruby/pb/src/proto/grpc/testing/empty.rb +15 -0
- data/src/ruby/pb/src/proto/grpc/testing/messages.rb +84 -0
- data/src/ruby/pb/src/proto/grpc/testing/test.rb +14 -0
- data/src/ruby/pb/src/proto/grpc/testing/test_services.rb +110 -0
- data/src/ruby/pb/test/client.rb +5 -2
- data/src/ruby/spec/generic/active_call_spec.rb +3 -2
- data/src/ruby/spec/generic/client_stub_spec.rb +27 -24
- data/src/ruby/spec/generic/rpc_desc_spec.rb +11 -11
- data/src/ruby/spec/generic/rpc_server_spec.rb +42 -61
- data/src/ruby/spec/pb/health/checker_spec.rb +3 -5
- metadata +86 -48
- data/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h +0 -182
- data/src/core/lib/security/credentials.c +0 -1296
- data/src/ruby/lib/grpc/signals.rb +0 -69
data/src/core/lib/surface/call.h
CHANGED
@@ -53,6 +53,8 @@ typedef void (*grpc_ioreq_completion_func)(grpc_exec_ctx *exec_ctx,
|
|
53
53
|
grpc_call *grpc_call_create(grpc_channel *channel, grpc_call *parent_call,
|
54
54
|
uint32_t propagation_mask,
|
55
55
|
grpc_completion_queue *cq,
|
56
|
+
/* if not NULL, it'll be used in lieu of \a cq */
|
57
|
+
grpc_pollset_set *pollset_set_alternative,
|
56
58
|
const void *server_transport_data,
|
57
59
|
grpc_mdelem **add_initial_metadata,
|
58
60
|
size_t add_initial_metadata_count,
|
@@ -112,7 +112,7 @@ void grpc_call_log_batch(char *file, int line, gpr_log_severity severity,
|
|
112
112
|
size_t i;
|
113
113
|
for (i = 0; i < nops; i++) {
|
114
114
|
tmp = grpc_op_string(&ops[i]);
|
115
|
-
gpr_log(file, line, severity, "ops[%
|
115
|
+
gpr_log(file, line, severity, "ops[%" PRIuPTR "]: %s", i, tmp);
|
116
116
|
gpr_free(tmp);
|
117
117
|
}
|
118
118
|
}
|
@@ -36,16 +36,17 @@
|
|
36
36
|
#include <stdlib.h>
|
37
37
|
#include <string.h>
|
38
38
|
|
39
|
+
#include <grpc/compression.h>
|
39
40
|
#include <grpc/support/alloc.h>
|
40
41
|
#include <grpc/support/log.h>
|
41
42
|
#include <grpc/support/string_util.h>
|
42
43
|
|
44
|
+
#include "src/core/lib/channel/channel_args.h"
|
43
45
|
#include "src/core/lib/iomgr/iomgr.h"
|
44
46
|
#include "src/core/lib/support/string.h"
|
45
47
|
#include "src/core/lib/surface/api_trace.h"
|
46
48
|
#include "src/core/lib/surface/call.h"
|
47
49
|
#include "src/core/lib/surface/channel_init.h"
|
48
|
-
#include "src/core/lib/surface/init.h"
|
49
50
|
#include "src/core/lib/transport/static_metadata.h"
|
50
51
|
|
51
52
|
/** Cache grpc-status: X mdelems for X = 0..NUM_CACHED_STATUS_ELEMS.
|
@@ -64,10 +65,12 @@ typedef struct registered_call {
|
|
64
65
|
struct grpc_channel {
|
65
66
|
int is_client;
|
66
67
|
uint32_t max_message_length;
|
68
|
+
grpc_compression_options compression_options;
|
67
69
|
grpc_mdelem *default_authority;
|
68
70
|
|
69
71
|
gpr_mu registered_call_mu;
|
70
72
|
registered_call *registered_calls;
|
73
|
+
|
71
74
|
char *target;
|
72
75
|
};
|
73
76
|
|
@@ -80,7 +83,8 @@ struct grpc_channel {
|
|
80
83
|
/* the protobuf library will (by default) start warning at 100megs */
|
81
84
|
#define DEFAULT_MAX_MESSAGE_LENGTH (100 * 1024 * 1024)
|
82
85
|
|
83
|
-
static void destroy_channel(grpc_exec_ctx *exec_ctx, void *arg,
|
86
|
+
static void destroy_channel(grpc_exec_ctx *exec_ctx, void *arg,
|
87
|
+
grpc_error *error);
|
84
88
|
|
85
89
|
grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target,
|
86
90
|
const grpc_channel_args *input_args,
|
@@ -111,6 +115,7 @@ grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target,
|
|
111
115
|
channel->registered_calls = NULL;
|
112
116
|
|
113
117
|
channel->max_message_length = DEFAULT_MAX_MESSAGE_LENGTH;
|
118
|
+
grpc_compression_options_init(&channel->compression_options);
|
114
119
|
if (args) {
|
115
120
|
for (size_t i = 0; i < args->num_args; i++) {
|
116
121
|
if (0 == strcmp(args->args[i].key, GRPC_ARG_MAX_MESSAGE_LENGTH)) {
|
@@ -151,6 +156,27 @@ grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target,
|
|
151
156
|
":authority", args->args[i].value.string);
|
152
157
|
}
|
153
158
|
}
|
159
|
+
} else if (0 == strcmp(args->args[i].key,
|
160
|
+
GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL)) {
|
161
|
+
channel->compression_options.default_level.is_set = true;
|
162
|
+
GPR_ASSERT(args->args[i].value.integer >= 0 &&
|
163
|
+
args->args[i].value.integer < GRPC_COMPRESS_LEVEL_COUNT);
|
164
|
+
channel->compression_options.default_level.level =
|
165
|
+
(grpc_compression_level)args->args[i].value.integer;
|
166
|
+
} else if (0 == strcmp(args->args[i].key,
|
167
|
+
GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM)) {
|
168
|
+
channel->compression_options.default_algorithm.is_set = true;
|
169
|
+
GPR_ASSERT(args->args[i].value.integer >= 0 &&
|
170
|
+
args->args[i].value.integer <
|
171
|
+
GRPC_COMPRESS_ALGORITHMS_COUNT);
|
172
|
+
channel->compression_options.default_algorithm.algorithm =
|
173
|
+
(grpc_compression_algorithm)args->args[i].value.integer;
|
174
|
+
} else if (0 ==
|
175
|
+
strcmp(args->args[i].key,
|
176
|
+
GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET)) {
|
177
|
+
channel->compression_options.enabled_algorithms_bitset =
|
178
|
+
(uint32_t)args->args[i].value.integer |
|
179
|
+
0x1; /* always support no compression */
|
154
180
|
}
|
155
181
|
}
|
156
182
|
grpc_channel_args_destroy(args);
|
@@ -166,12 +192,14 @@ char *grpc_channel_get_target(grpc_channel *channel) {
|
|
166
192
|
|
167
193
|
static grpc_call *grpc_channel_create_call_internal(
|
168
194
|
grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
|
169
|
-
grpc_completion_queue *cq,
|
170
|
-
grpc_mdelem *
|
195
|
+
grpc_completion_queue *cq, grpc_pollset_set *pollset_set_alternative,
|
196
|
+
grpc_mdelem *path_mdelem, grpc_mdelem *authority_mdelem,
|
197
|
+
gpr_timespec deadline) {
|
171
198
|
grpc_mdelem *send_metadata[2];
|
172
199
|
size_t num_metadata = 0;
|
173
200
|
|
174
201
|
GPR_ASSERT(channel->is_client);
|
202
|
+
GPR_ASSERT(!(cq != NULL && pollset_set_alternative != NULL));
|
175
203
|
|
176
204
|
send_metadata[num_metadata++] = path_mdelem;
|
177
205
|
if (authority_mdelem != NULL) {
|
@@ -180,8 +208,9 @@ static grpc_call *grpc_channel_create_call_internal(
|
|
180
208
|
send_metadata[num_metadata++] = GRPC_MDELEM_REF(channel->default_authority);
|
181
209
|
}
|
182
210
|
|
183
|
-
return grpc_call_create(channel, parent_call, propagation_mask, cq,
|
184
|
-
|
211
|
+
return grpc_call_create(channel, parent_call, propagation_mask, cq,
|
212
|
+
pollset_set_alternative, NULL, send_metadata,
|
213
|
+
num_metadata, deadline);
|
185
214
|
}
|
186
215
|
|
187
216
|
grpc_call *grpc_channel_create_call(grpc_channel *channel,
|
@@ -194,14 +223,29 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel,
|
|
194
223
|
"grpc_channel_create_call("
|
195
224
|
"channel=%p, parent_call=%p, propagation_mask=%x, cq=%p, method=%s, "
|
196
225
|
"host=%s, "
|
197
|
-
"deadline=gpr_timespec { tv_sec: %
|
226
|
+
"deadline=gpr_timespec { tv_sec: %"PRId64", tv_nsec: %d, clock_type: %d }, "
|
198
227
|
"reserved=%p)",
|
199
228
|
10, (channel, parent_call, (unsigned)propagation_mask, cq, method, host,
|
200
|
-
|
229
|
+
deadline.tv_sec, deadline.tv_nsec,
|
201
230
|
(int)deadline.clock_type, reserved));
|
202
231
|
GPR_ASSERT(!reserved);
|
203
232
|
return grpc_channel_create_call_internal(
|
204
|
-
channel, parent_call, propagation_mask, cq,
|
233
|
+
channel, parent_call, propagation_mask, cq, NULL,
|
234
|
+
grpc_mdelem_from_metadata_strings(GRPC_MDSTR_PATH,
|
235
|
+
grpc_mdstr_from_string(method)),
|
236
|
+
host ? grpc_mdelem_from_metadata_strings(GRPC_MDSTR_AUTHORITY,
|
237
|
+
grpc_mdstr_from_string(host))
|
238
|
+
: NULL,
|
239
|
+
deadline);
|
240
|
+
}
|
241
|
+
|
242
|
+
grpc_call *grpc_channel_create_pollset_set_call(
|
243
|
+
grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
|
244
|
+
grpc_pollset_set *pollset_set, const char *method, const char *host,
|
245
|
+
gpr_timespec deadline, void *reserved) {
|
246
|
+
GPR_ASSERT(!reserved);
|
247
|
+
return grpc_channel_create_call_internal(
|
248
|
+
channel, parent_call, propagation_mask, NULL, pollset_set,
|
205
249
|
grpc_mdelem_from_metadata_strings(GRPC_MDSTR_PATH,
|
206
250
|
grpc_mdstr_from_string(method)),
|
207
251
|
host ? grpc_mdelem_from_metadata_strings(GRPC_MDSTR_AUTHORITY,
|
@@ -238,14 +282,14 @@ grpc_call *grpc_channel_create_registered_call(
|
|
238
282
|
"grpc_channel_create_registered_call("
|
239
283
|
"channel=%p, parent_call=%p, propagation_mask=%x, completion_queue=%p, "
|
240
284
|
"registered_call_handle=%p, "
|
241
|
-
"deadline=gpr_timespec { tv_sec: %
|
285
|
+
"deadline=gpr_timespec { tv_sec: %"PRId64", tv_nsec: %d, clock_type: %d }, "
|
242
286
|
"reserved=%p)",
|
243
287
|
9, (channel, parent_call, (unsigned)propagation_mask, completion_queue,
|
244
|
-
registered_call_handle,
|
245
|
-
|
288
|
+
registered_call_handle, deadline.tv_sec,
|
289
|
+
deadline.tv_nsec, (int)deadline.clock_type, reserved));
|
246
290
|
GPR_ASSERT(!reserved);
|
247
291
|
return grpc_channel_create_call_internal(
|
248
|
-
channel, parent_call, propagation_mask, completion_queue,
|
292
|
+
channel, parent_call, propagation_mask, completion_queue, NULL,
|
249
293
|
GRPC_MDELEM_REF(rc->path),
|
250
294
|
rc->authority ? GRPC_MDELEM_REF(rc->authority) : NULL, deadline);
|
251
295
|
}
|
@@ -267,7 +311,7 @@ void grpc_channel_internal_unref(grpc_exec_ctx *exec_ctx,
|
|
267
311
|
}
|
268
312
|
|
269
313
|
static void destroy_channel(grpc_exec_ctx *exec_ctx, void *arg,
|
270
|
-
|
314
|
+
grpc_error *error) {
|
271
315
|
grpc_channel *channel = arg;
|
272
316
|
grpc_channel_stack_destroy(exec_ctx, CHANNEL_STACK_FROM_CHANNEL(channel));
|
273
317
|
while (channel->registered_calls) {
|
@@ -293,7 +337,7 @@ void grpc_channel_destroy(grpc_channel *channel) {
|
|
293
337
|
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
|
294
338
|
GRPC_API_TRACE("grpc_channel_destroy(channel=%p)", 1, (channel));
|
295
339
|
memset(&op, 0, sizeof(op));
|
296
|
-
op.
|
340
|
+
op.disconnect_with_error = GRPC_ERROR_CREATE("Channel Destroyed");
|
297
341
|
elem = grpc_channel_stack_element(CHANNEL_STACK_FROM_CHANNEL(channel), 0);
|
298
342
|
elem->filter->start_transport_op(&exec_ctx, elem, &op);
|
299
343
|
|
@@ -306,6 +350,11 @@ grpc_channel_stack *grpc_channel_get_channel_stack(grpc_channel *channel) {
|
|
306
350
|
return CHANNEL_STACK_FROM_CHANNEL(channel);
|
307
351
|
}
|
308
352
|
|
353
|
+
grpc_compression_options grpc_channel_compression_options(
|
354
|
+
const grpc_channel *channel) {
|
355
|
+
return channel->compression_options;
|
356
|
+
}
|
357
|
+
|
309
358
|
grpc_mdelem *grpc_channel_get_reffed_status_elem(grpc_channel *channel, int i) {
|
310
359
|
char tmp[GPR_LTOA_MIN_BUFSIZE];
|
311
360
|
switch (i) {
|
@@ -42,6 +42,11 @@ grpc_channel *grpc_channel_create(grpc_exec_ctx *exec_ctx, const char *target,
|
|
42
42
|
grpc_channel_stack_type channel_stack_type,
|
43
43
|
grpc_transport *optional_transport);
|
44
44
|
|
45
|
+
grpc_call *grpc_channel_create_pollset_set_call(
|
46
|
+
grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask,
|
47
|
+
grpc_pollset_set *pollset_set, const char *method, const char *host,
|
48
|
+
gpr_timespec deadline, void *reserved);
|
49
|
+
|
45
50
|
/** Get a (borrowed) pointer to this channels underlying channel stack */
|
46
51
|
grpc_channel_stack *grpc_channel_get_channel_stack(grpc_channel *channel);
|
47
52
|
|
@@ -71,4 +76,8 @@ void grpc_channel_internal_unref(grpc_exec_ctx *exec_ctx,
|
|
71
76
|
grpc_channel_internal_unref(exec_ctx, channel)
|
72
77
|
#endif
|
73
78
|
|
79
|
+
/** Return the channel's compression options. */
|
80
|
+
grpc_compression_options grpc_channel_compression_options(
|
81
|
+
const grpc_channel *channel);
|
82
|
+
|
74
83
|
#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_H */
|
@@ -53,10 +53,10 @@ static void ping_destroy(grpc_exec_ctx *exec_ctx, void *arg,
|
|
53
53
|
gpr_free(arg);
|
54
54
|
}
|
55
55
|
|
56
|
-
static void ping_done(grpc_exec_ctx *exec_ctx, void *arg,
|
56
|
+
static void ping_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
|
57
57
|
ping_result *pr = arg;
|
58
|
-
grpc_cq_end_op(exec_ctx, pr->cq, pr->tag,
|
59
|
-
&pr->completion_storage);
|
58
|
+
grpc_cq_end_op(exec_ctx, pr->cq, pr->tag, GRPC_ERROR_REF(error), ping_destroy,
|
59
|
+
pr, &pr->completion_storage);
|
60
60
|
}
|
61
61
|
|
62
62
|
void grpc_channel_ping(grpc_channel *channel, grpc_completion_queue *cq,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
*
|
3
|
-
* Copyright 2015, Google Inc.
|
3
|
+
* Copyright 2015-2016, Google Inc.
|
4
4
|
* All rights reserved.
|
5
5
|
*
|
6
6
|
* Redistribution and use in source and binary forms, with or without
|
@@ -50,6 +50,8 @@
|
|
50
50
|
#include "src/core/lib/surface/event_string.h"
|
51
51
|
#include "src/core/lib/surface/surface_trace.h"
|
52
52
|
|
53
|
+
int grpc_trace_operation_failures;
|
54
|
+
|
53
55
|
typedef struct {
|
54
56
|
grpc_pollset_worker **worker;
|
55
57
|
void *tag;
|
@@ -70,6 +72,8 @@ struct grpc_completion_queue {
|
|
70
72
|
int shutdown;
|
71
73
|
int shutdown_called;
|
72
74
|
int is_server_cq;
|
75
|
+
/** Can the server cq accept incoming channels */
|
76
|
+
int is_non_listening_server_cq;
|
73
77
|
int num_pluckers;
|
74
78
|
plucker pluckers[GRPC_MAX_COMPLETION_QUEUE_PLUCKERS];
|
75
79
|
grpc_closure pollset_shutdown_done;
|
@@ -84,12 +88,13 @@ struct grpc_completion_queue {
|
|
84
88
|
};
|
85
89
|
|
86
90
|
#define POLLSET_FROM_CQ(cq) ((grpc_pollset *)(cq + 1))
|
91
|
+
#define CQ_FROM_POLLSET(ps) (((grpc_completion_queue *)ps) - 1)
|
87
92
|
|
88
93
|
static gpr_mu g_freelist_mu;
|
89
94
|
static grpc_completion_queue *g_freelist;
|
90
95
|
|
91
96
|
static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *cc,
|
92
|
-
|
97
|
+
grpc_error *error);
|
93
98
|
|
94
99
|
void grpc_cq_global_init(void) { gpr_mu_init(&g_freelist_mu); }
|
95
100
|
|
@@ -149,6 +154,7 @@ grpc_completion_queue *grpc_completion_queue_create(void *reserved) {
|
|
149
154
|
cc->shutdown = 0;
|
150
155
|
cc->shutdown_called = 0;
|
151
156
|
cc->is_server_cq = 0;
|
157
|
+
cc->is_non_listening_server_cq = 0;
|
152
158
|
cc->num_pluckers = 0;
|
153
159
|
#ifndef NDEBUG
|
154
160
|
cc->outstanding_tag_count = 0;
|
@@ -172,7 +178,7 @@ void grpc_cq_internal_ref(grpc_completion_queue *cc) {
|
|
172
178
|
}
|
173
179
|
|
174
180
|
static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *arg,
|
175
|
-
|
181
|
+
grpc_error *error) {
|
176
182
|
grpc_completion_queue *cc = arg;
|
177
183
|
GRPC_CQ_INTERNAL_UNREF(cc, "pollset_destroy");
|
178
184
|
}
|
@@ -215,7 +221,7 @@ void grpc_cq_begin_op(grpc_completion_queue *cc, void *tag) {
|
|
215
221
|
event, then enter shutdown mode */
|
216
222
|
/* Queue a GRPC_OP_COMPLETED operation */
|
217
223
|
void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
|
218
|
-
void *tag,
|
224
|
+
void *tag, grpc_error *error,
|
219
225
|
void (*done)(grpc_exec_ctx *exec_ctx, void *done_arg,
|
220
226
|
grpc_cq_completion *storage),
|
221
227
|
void *done_arg, grpc_cq_completion *storage) {
|
@@ -227,16 +233,24 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
|
|
227
233
|
#endif
|
228
234
|
|
229
235
|
GPR_TIMER_BEGIN("grpc_cq_end_op", 0);
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
236
|
+
if (grpc_api_trace ||
|
237
|
+
(grpc_trace_operation_failures && error != GRPC_ERROR_NONE)) {
|
238
|
+
const char *errmsg = grpc_error_string(error);
|
239
|
+
GRPC_API_TRACE(
|
240
|
+
"grpc_cq_end_op(exec_ctx=%p, cc=%p, tag=%p, error=%s, done=%p, "
|
241
|
+
"done_arg=%p, storage=%p)",
|
242
|
+
7, (exec_ctx, cc, tag, errmsg, done, done_arg, storage));
|
243
|
+
if (grpc_trace_operation_failures) {
|
244
|
+
gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg);
|
245
|
+
}
|
246
|
+
grpc_error_free_string(errmsg);
|
247
|
+
}
|
234
248
|
|
235
249
|
storage->tag = tag;
|
236
250
|
storage->done = done;
|
237
251
|
storage->done_arg = done_arg;
|
238
|
-
storage->next =
|
239
|
-
|
252
|
+
storage->next = ((uintptr_t)&cc->completed_head) |
|
253
|
+
((uintptr_t)(error == GRPC_ERROR_NONE));
|
240
254
|
|
241
255
|
gpr_mu_lock(cc->mu);
|
242
256
|
#ifndef NDEBUG
|
@@ -263,8 +277,15 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
|
|
263
277
|
break;
|
264
278
|
}
|
265
279
|
}
|
266
|
-
|
280
|
+
grpc_error *kick_error =
|
281
|
+
grpc_pollset_kick(POLLSET_FROM_CQ(cc), pluck_worker);
|
267
282
|
gpr_mu_unlock(cc->mu);
|
283
|
+
if (kick_error != GRPC_ERROR_NONE) {
|
284
|
+
const char *msg = grpc_error_string(kick_error);
|
285
|
+
gpr_log(GPR_ERROR, "Kick failed: %s", msg);
|
286
|
+
grpc_error_free_string(msg);
|
287
|
+
GRPC_ERROR_UNREF(kick_error);
|
288
|
+
}
|
268
289
|
} else {
|
269
290
|
cc->completed_tail->next =
|
270
291
|
((uintptr_t)storage) | (1u & (uintptr_t)cc->completed_tail->next);
|
@@ -278,6 +299,8 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
|
|
278
299
|
}
|
279
300
|
|
280
301
|
GPR_TIMER_END("grpc_cq_end_op", 0);
|
302
|
+
|
303
|
+
GRPC_ERROR_UNREF(error);
|
281
304
|
}
|
282
305
|
|
283
306
|
grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
|
@@ -293,9 +316,9 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
|
|
293
316
|
GRPC_API_TRACE(
|
294
317
|
"grpc_completion_queue_next("
|
295
318
|
"cc=%p, "
|
296
|
-
"deadline=gpr_timespec { tv_sec: %
|
319
|
+
"deadline=gpr_timespec { tv_sec: %"PRId64", tv_nsec: %d, clock_type: %d }, "
|
297
320
|
"reserved=%p)",
|
298
|
-
5, (cc,
|
321
|
+
5, (cc, deadline.tv_sec, deadline.tv_nsec,
|
299
322
|
(int)deadline.clock_type, reserved));
|
300
323
|
GPR_ASSERT(!reserved);
|
301
324
|
|
@@ -343,8 +366,18 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
|
|
343
366
|
gpr_mu_lock(cc->mu);
|
344
367
|
continue;
|
345
368
|
} else {
|
346
|
-
grpc_pollset_work(&exec_ctx, POLLSET_FROM_CQ(cc),
|
347
|
-
|
369
|
+
grpc_error *err = grpc_pollset_work(&exec_ctx, POLLSET_FROM_CQ(cc),
|
370
|
+
&worker, now, iteration_deadline);
|
371
|
+
if (err != GRPC_ERROR_NONE) {
|
372
|
+
gpr_mu_unlock(cc->mu);
|
373
|
+
const char *msg = grpc_error_string(err);
|
374
|
+
gpr_log(GPR_ERROR, "Completion queue next failed: %s", msg);
|
375
|
+
grpc_error_free_string(msg);
|
376
|
+
GRPC_ERROR_UNREF(err);
|
377
|
+
memset(&ret, 0, sizeof(ret));
|
378
|
+
ret.type = GRPC_QUEUE_TIMEOUT;
|
379
|
+
break;
|
380
|
+
}
|
348
381
|
}
|
349
382
|
}
|
350
383
|
GRPC_SURFACE_TRACE_RETURNED_EVENT(cc, &ret);
|
@@ -395,9 +428,9 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
|
|
395
428
|
GRPC_API_TRACE(
|
396
429
|
"grpc_completion_queue_pluck("
|
397
430
|
"cc=%p, tag=%p, "
|
398
|
-
"deadline=gpr_timespec { tv_sec: %
|
431
|
+
"deadline=gpr_timespec { tv_sec: %"PRId64", tv_nsec: %d, clock_type: %d }, "
|
399
432
|
"reserved=%p)",
|
400
|
-
6, (cc, tag,
|
433
|
+
6, (cc, tag, deadline.tv_sec, deadline.tv_nsec,
|
401
434
|
(int)deadline.clock_type, reserved));
|
402
435
|
GPR_ASSERT(!reserved);
|
403
436
|
|
@@ -460,8 +493,19 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
|
|
460
493
|
grpc_exec_ctx_flush(&exec_ctx);
|
461
494
|
gpr_mu_lock(cc->mu);
|
462
495
|
} else {
|
463
|
-
grpc_pollset_work(&exec_ctx, POLLSET_FROM_CQ(cc),
|
464
|
-
|
496
|
+
grpc_error *err = grpc_pollset_work(&exec_ctx, POLLSET_FROM_CQ(cc),
|
497
|
+
&worker, now, iteration_deadline);
|
498
|
+
if (err != GRPC_ERROR_NONE) {
|
499
|
+
del_plucker(cc, tag, &worker);
|
500
|
+
gpr_mu_unlock(cc->mu);
|
501
|
+
const char *msg = grpc_error_string(err);
|
502
|
+
gpr_log(GPR_ERROR, "Completion queue next failed: %s", msg);
|
503
|
+
grpc_error_free_string(msg);
|
504
|
+
GRPC_ERROR_UNREF(err);
|
505
|
+
memset(&ret, 0, sizeof(ret));
|
506
|
+
ret.type = GRPC_QUEUE_TIMEOUT;
|
507
|
+
break;
|
508
|
+
}
|
465
509
|
}
|
466
510
|
del_plucker(cc, tag, &worker);
|
467
511
|
}
|
@@ -511,6 +555,18 @@ grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc) {
|
|
511
555
|
return POLLSET_FROM_CQ(cc);
|
512
556
|
}
|
513
557
|
|
558
|
+
grpc_completion_queue *grpc_cq_from_pollset(grpc_pollset *ps) {
|
559
|
+
return CQ_FROM_POLLSET(ps);
|
560
|
+
}
|
561
|
+
|
562
|
+
void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc) {
|
563
|
+
cc->is_non_listening_server_cq = 1;
|
564
|
+
}
|
565
|
+
|
566
|
+
bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc) {
|
567
|
+
return (cc->is_non_listening_server_cq == 1);
|
568
|
+
}
|
569
|
+
|
514
570
|
void grpc_cq_mark_server_cq(grpc_completion_queue *cc) { cc->is_server_cq = 1; }
|
515
571
|
|
516
572
|
int grpc_cq_is_server_cq(grpc_completion_queue *cc) { return cc->is_server_cq; }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
*
|
3
|
-
* Copyright 2015, Google Inc.
|
3
|
+
* Copyright 2015-2016, Google Inc.
|
4
4
|
* All rights reserved.
|
5
5
|
*
|
6
6
|
* Redistribution and use in source and binary forms, with or without
|
@@ -39,6 +39,8 @@
|
|
39
39
|
#include <grpc/grpc.h>
|
40
40
|
#include "src/core/lib/iomgr/pollset.h"
|
41
41
|
|
42
|
+
extern int grpc_trace_operation_failures;
|
43
|
+
|
42
44
|
typedef struct grpc_cq_completion {
|
43
45
|
/** user supplied tag */
|
44
46
|
void *tag;
|
@@ -75,13 +77,16 @@ void grpc_cq_begin_op(grpc_completion_queue *cc, void *tag);
|
|
75
77
|
/* Queue a GRPC_OP_COMPLETED operation; tag must correspond to the tag passed to
|
76
78
|
grpc_cq_begin_op */
|
77
79
|
void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
|
78
|
-
void *tag,
|
80
|
+
void *tag, grpc_error *error,
|
79
81
|
void (*done)(grpc_exec_ctx *exec_ctx, void *done_arg,
|
80
82
|
grpc_cq_completion *storage),
|
81
83
|
void *done_arg, grpc_cq_completion *storage);
|
82
84
|
|
83
85
|
grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc);
|
86
|
+
grpc_completion_queue *grpc_cq_from_pollset(grpc_pollset *ps);
|
84
87
|
|
88
|
+
void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc);
|
89
|
+
bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc);
|
85
90
|
void grpc_cq_mark_server_cq(grpc_completion_queue *cc);
|
86
91
|
int grpc_cq_is_server_cq(grpc_completion_queue *cc);
|
87
92
|
|