Final patches for rename

pull/3423/head
Craig Tiller 10 years ago
parent e7db29f8c7
commit 8af4c33718
  1. 3
      BUILD
  2. 2
      Makefile
  3. 11
      build.yaml
  4. 1
      gRPC.podspec
  5. 2
      src/core/channel/channel_stack.c
  6. 6
      src/core/channel/client_channel.c
  7. 6
      src/core/channel/connected_channel.c
  8. 6
      src/core/channel/http_client_filter.c
  9. 6
      src/core/channel/http_server_filter.c
  10. 8
      src/core/client_config/lb_policy.h
  11. 6
      src/core/client_config/resolver.h
  12. 18
      src/core/client_config/subchannel.c
  13. 18
      src/core/client_config/subchannel.h
  14. 10
      src/core/httpcli/httpcli.c
  15. 2
      src/core/httpcli/httpcli.h
  16. 2
      src/core/httpcli/httpcli_security_connector.c
  17. 6
      src/core/iomgr/alarm.c
  18. 2
      src/core/iomgr/alarm_internal.h
  19. 16
      src/core/iomgr/closure.c
  20. 5
      src/core/iomgr/closure.h
  21. 62
      src/core/iomgr/exec_ctx.c
  22. 11
      src/core/iomgr/exec_ctx.h
  23. 4
      src/core/iomgr/iomgr.c
  24. 12
      src/core/iomgr/pollset_posix.c
  25. 2
      src/core/iomgr/tcp_client_posix.c
  26. 20
      src/core/iomgr/tcp_posix.c
  27. 2
      src/core/iomgr/tcp_server_posix.c
  28. 11
      src/core/iomgr/workqueue.h
  29. 8
      src/core/iomgr/workqueue_posix.c
  30. 5
      src/core/security/credentials.c
  31. 4
      src/core/security/google_default_credentials.c
  32. 6
      src/core/security/jwt_verifier.c
  33. 6
      src/core/security/secure_endpoint.c
  34. 4
      src/core/security/security_connector.c
  35. 4
      src/core/security/server_secure_chttp2.c
  36. 14
      src/core/surface/call.c
  37. 4
      src/core/surface/channel.c
  38. 8
      src/core/surface/channel_connectivity.c
  39. 2
      src/core/surface/channel_create.c
  40. 2
      src/core/surface/completion_queue.c
  41. 2
      src/core/surface/completion_queue.h
  42. 2
      src/core/surface/lame_client.c
  43. 2
      src/core/surface/secure_channel_create.c
  44. 8
      src/core/surface/server.c
  45. 2
      src/core/surface/server.h
  46. 6
      src/core/surface/server_chttp2.c
  47. 6
      src/core/surface/version.c
  48. 10
      src/core/transport/chttp2/parsing.c
  49. 10
      src/core/transport/chttp2_transport.c
  50. 6
      test/core/bad_client/bad_client.c
  51. 6
      test/core/end2end/fixtures/h2_sockpair+trace.c
  52. 6
      test/core/end2end/fixtures/h2_sockpair.c
  53. 6
      test/core/end2end/fixtures/h2_sockpair_1byte.c
  54. 28
      test/core/iomgr/alarm_list_test.c
  55. 2
      test/core/iomgr/endpoint_tests.c
  56. 2
      test/core/security/oauth2_utils.c
  57. 10
      test/core/util/port_posix.c
  58. 2
      test/core/util/reconnect_server.c
  59. 1
      tools/doxygen/Doxyfile.core.internal
  60. 2
      tools/run_tests/sources_and_headers.json
  61. 2
      vsprojects/vcxproj/grpc/grpc.vcxproj
  62. 3
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  63. 2
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  64. 3
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters

@ -316,6 +316,7 @@ cc_library(
"src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/fd_posix.c",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iomgr.c",
@ -580,6 +581,7 @@ cc_library(
"src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/fd_posix.c",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iomgr.c",
@ -1102,6 +1104,7 @@ objc_library(
"src/core/iomgr/endpoint.c",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/fd_posix.c",
"src/core/iomgr/iocp_windows.c",
"src/core/iomgr/iomgr.c",

@ -4079,6 +4079,7 @@ LIBGRPC_SRC = \
src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \
src/core/iomgr/endpoint_pair_windows.c \
src/core/iomgr/exec_ctx.c \
src/core/iomgr/fd_posix.c \
src/core/iomgr/iocp_windows.c \
src/core/iomgr/iomgr.c \
@ -4360,6 +4361,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \
src/core/iomgr/endpoint_pair_windows.c \
src/core/iomgr/exec_ctx.c \
src/core/iomgr/fd_posix.c \
src/core/iomgr/iocp_windows.c \
src/core/iomgr/iomgr.c \

@ -99,11 +99,12 @@ filegroups:
src/core/debug/trace.c, src/core/httpcli/format_request.c, src/core/httpcli/httpcli.c,
src/core/httpcli/parser.c, src/core/iomgr/alarm.c, src/core/iomgr/alarm_heap.c,
src/core/iomgr/closure.c, src/core/iomgr/endpoint.c, src/core/iomgr/endpoint_pair_posix.c,
src/core/iomgr/endpoint_pair_windows.c, src/core/iomgr/fd_posix.c, src/core/iomgr/iocp_windows.c,
src/core/iomgr/iomgr.c, src/core/iomgr/iomgr_posix.c, src/core/iomgr/iomgr_windows.c,
src/core/iomgr/pollset_multipoller_with_epoll.c, src/core/iomgr/pollset_multipoller_with_poll_posix.c,
src/core/iomgr/pollset_posix.c, src/core/iomgr/pollset_set_posix.c, src/core/iomgr/pollset_set_windows.c,
src/core/iomgr/pollset_windows.c, src/core/iomgr/resolve_address_posix.c, src/core/iomgr/resolve_address_windows.c,
src/core/iomgr/endpoint_pair_windows.c, src/core/iomgr/exec_ctx.c, src/core/iomgr/fd_posix.c,
src/core/iomgr/iocp_windows.c, src/core/iomgr/iomgr.c, src/core/iomgr/iomgr_posix.c,
src/core/iomgr/iomgr_windows.c, src/core/iomgr/pollset_multipoller_with_epoll.c,
src/core/iomgr/pollset_multipoller_with_poll_posix.c, src/core/iomgr/pollset_posix.c,
src/core/iomgr/pollset_set_posix.c, src/core/iomgr/pollset_set_windows.c, src/core/iomgr/pollset_windows.c,
src/core/iomgr/resolve_address_posix.c, src/core/iomgr/resolve_address_windows.c,
src/core/iomgr/sockaddr_utils.c, src/core/iomgr/socket_utils_common_posix.c, src/core/iomgr/socket_utils_linux.c,
src/core/iomgr/socket_utils_posix.c, src/core/iomgr/socket_windows.c, src/core/iomgr/tcp_client_posix.c,
src/core/iomgr/tcp_client_windows.c, src/core/iomgr/tcp_posix.c, src/core/iomgr/tcp_server_posix.c,

@ -325,6 +325,7 @@ Pod::Spec.new do |s|
'src/core/iomgr/endpoint.c',
'src/core/iomgr/endpoint_pair_posix.c',
'src/core/iomgr/endpoint_pair_windows.c',
'src/core/iomgr/exec_ctx.c',
'src/core/iomgr/fd_posix.c',
'src/core/iomgr/iocp_windows.c',
'src/core/iomgr/iomgr.c',

@ -120,7 +120,7 @@ grpc_channel_stack_init (grpc_exec_ctx * exec_ctx, const grpc_channel_filter **
{
elems[i].filter = filters[i];
elems[i].channel_data = user_data;
elems[i].filter->init_channel_elem (&elems[i], master, args, metadata_context, i == 0, i == (exec_ctx, filter_count - 1));
elems[i].filter->init_channel_elem (exec_ctx, &elems[i], master, args, metadata_context, i == 0, i == (filter_count - 1));
user_data += ROUND_UP_TO_ALIGNMENT_SIZE (filters[i]->sizeof_channel_data);
call_size += ROUND_UP_TO_ALIGNMENT_SIZE (filters[i]->sizeof_call_data);
}

@ -491,10 +491,10 @@ on_lb_policy_state_changed_locked (grpc_exec_ctx * exec_ctx, lb_policy_connectiv
if (w->lb_policy != w->chand->lb_policy)
return;
grpc_connectivity_state_set (&w->chand->state_tracker, w->state, "lb_changed", cl);
grpc_connectivity_state_set (exec_ctx, &w->chand->state_tracker, w->state, "lb_changed");
if (w->state != GRPC_CHANNEL_FATAL_FAILURE)
{
watch_lb_policy (w->chand, w->lb_policy, w->state, cl);
watch_lb_policy (exec_ctx, w->chand, w->lb_policy, w->state);
}
}
@ -554,7 +554,7 @@ cc_on_config_changed (grpc_exec_ctx * exec_ctx, void *arg, int iomgr_success)
chand->lb_policy = lb_policy;
if (lb_policy != NULL || chand->resolver == NULL /* disconnected */ )
{
grpc_closure_list_move (exec_ctx, &chand->waiting_for_config_closures);
grpc_exec_ctx_enqueue_list (exec_ctx, &chand->waiting_for_config_closures);
}
if (lb_policy != NULL && chand->exit_idle_when_lb_policy_arrives)
{

@ -73,7 +73,7 @@ con_start_transport_stream_op (grpc_exec_ctx * exec_ctx, grpc_call_element * ele
GPR_ASSERT (elem->filter == &grpc_connected_channel_filter);
GRPC_CALL_LOG_OP (GPR_INFO, elem, op);
grpc_transport_perform_stream_op (chand->transport, TRANSPORT_STREAM_FROM_CALL_DATA (exec_ctx, calld), op);
grpc_transport_perform_stream_op (exec_ctx, chand->transport, TRANSPORT_STREAM_FROM_CALL_DATA (calld), op);
}
static void
@ -92,7 +92,7 @@ init_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem, const void *
int r;
GPR_ASSERT (elem->filter == &grpc_connected_channel_filter);
r = grpc_transport_init_stream (chand->transport, TRANSPORT_STREAM_FROM_CALL_DATA (exec_ctx, calld), server_transport_data, initial_op);
r = grpc_transport_init_stream (exec_ctx, chand->transport, TRANSPORT_STREAM_FROM_CALL_DATA (calld), server_transport_data, initial_op);
GPR_ASSERT (r == 0);
}
@ -103,7 +103,7 @@ destroy_call_elem (grpc_exec_ctx * exec_ctx, grpc_call_element * elem)
call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
GPR_ASSERT (elem->filter == &grpc_connected_channel_filter);
grpc_transport_destroy_stream (chand->transport, TRANSPORT_STREAM_FROM_CALL_DATA (exec_ctx, calld));
grpc_transport_destroy_stream (exec_ctx, chand->transport, TRANSPORT_STREAM_FROM_CALL_DATA (calld));
}
/* Constructor for channel_data */

@ -72,7 +72,7 @@ typedef struct channel_data
typedef struct
{
grpc_call_element *elem;
grpc_closure_list *closure_list;
grpc_exec_ctx *exec_ctx;
} client_recv_filter_args;
static grpc_mdelem *
@ -87,7 +87,7 @@ client_recv_filter (void *user_data, grpc_mdelem * md)
}
else if (md->key == channeld->status->key)
{
grpc_call_element_send_cancel (elem, a->closure_list);
grpc_call_element_send_cancel (a->exec_ctx, elem);
return NULL;
}
else if (md->key == channeld->content_type->key)
@ -113,7 +113,7 @@ hc_on_recv (grpc_exec_ctx * exec_ctx, void *user_data, int success)
continue;
calld->got_initial_metadata = 1;
a.elem = elem;
a.closure_list = closure_list;
a.exec_ctx = exec_ctx;
grpc_metadata_batch_filter (&op->data.metadata, client_recv_filter, &a);
}
calld->on_done_recv->cb (exec_ctx, calld->on_done_recv->cb_arg, success);

@ -79,7 +79,7 @@ typedef struct channel_data
typedef struct
{
grpc_call_element *elem;
grpc_closure_list *closure_list;
grpc_exec_ctx *exec_ctx;
} server_filter_args;
static grpc_mdelem *
@ -134,7 +134,7 @@ server_filter (void *user_data, grpc_mdelem * md)
/* swallow it and error everything out. */
/* TODO(klempner): We ought to generate more descriptive error messages
on the wire here. */
grpc_call_element_send_cancel (elem, a->closure_list);
grpc_call_element_send_cancel (a->exec_ctx, elem);
return NULL;
}
else if (md->key == channeld->path_key)
@ -186,7 +186,7 @@ hs_on_recv (grpc_exec_ctx * exec_ctx, void *user_data, int success)
continue;
calld->got_initial_metadata = 1;
a.elem = elem;
a.closure_list = closure_list;
a.exec_ctx = exec_ctx;
grpc_metadata_batch_filter (&op->data.metadata, server_filter, &a);
/* Have we seen the required http2 transport headers?
(:method, :scheme, content-type, with :path and :authority covered

@ -76,13 +76,13 @@ struct grpc_lb_policy_vtable
#ifdef GRPC_LB_POLICY_REFCOUNT_DEBUG
#define GRPC_LB_POLICY_REF(p, r) \
grpc_lb_policy_ref((p), __FILE__, __LINE__, (r))
#define GRPC_LB_POLICY_UNREF(p, r, cl) \
grpc_lb_policy_unref((p), (cl), __FILE__, __LINE__, (r))
#define GRPC_LB_POLICY_UNREF(exec_ctx, p, r) \
grpc_lb_policy_unref((exec_ctx), (p), __FILE__, __LINE__, (r))
void grpc_lb_policy_ref (grpc_lb_policy * policy, const char *file, int line, const char *reason);
void grpc_lb_policy_unref (grpc_lb_policy * policy, grpc_closure_list * closure_list, const char *file, int line, const char *reason);
void grpc_lb_policy_unref (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy, const char *file, int line, const char *reason);
#else
#define GRPC_LB_POLICY_REF(p, r) grpc_lb_policy_ref((p))
#define GRPC_LB_POLICY_UNREF(p, r, cl) grpc_lb_policy_unref((p), (cl))
#define GRPC_LB_POLICY_UNREF(cl, p, r) grpc_lb_policy_unref((cl), (p))
void grpc_lb_policy_ref (grpc_lb_policy * policy);
void grpc_lb_policy_unref (grpc_exec_ctx * exec_ctx, grpc_lb_policy * policy);
#endif

@ -59,13 +59,13 @@ struct grpc_resolver_vtable
#ifdef GRPC_RESOLVER_REFCOUNT_DEBUG
#define GRPC_RESOLVER_REF(p, r) grpc_resolver_ref((p), __FILE__, __LINE__, (r))
#define GRPC_RESOLVER_UNREF(p, r, cl) \
grpc_resolver_unref((p), (cl), __FILE__, __LINE__, (r))
#define GRPC_RESOLVER_UNREF(cl, p, r) \
grpc_resolver_unref((cl), (p), __FILE__, __LINE__, (r))
void grpc_resolver_ref (grpc_resolver * policy, const char *file, int line, const char *reason);
void grpc_resolver_unref (grpc_resolver * policy, grpc_closure_list * closure_list, const char *file, int line, const char *reason);
#else
#define GRPC_RESOLVER_REF(p, r) grpc_resolver_ref((p))
#define GRPC_RESOLVER_UNREF(p, r, cl) grpc_resolver_unref((p), (cl))
#define GRPC_RESOLVER_UNREF(cl, p, r) grpc_resolver_unref((cl), (p))
void grpc_resolver_ref (grpc_resolver * policy);
void grpc_resolver_unref (grpc_exec_ctx * exec_ctx, grpc_resolver * policy);
#endif

@ -159,7 +159,7 @@ static int
subchannel_unref_locked (grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
GRPC_MUST_USE_RESULT;
static void connection_ref_locked (connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
static grpc_subchannel *connection_unref_locked (connection * c, grpc_closure_list * closure_list GRPC_SUBCHANNEL_REF_EXTRA_ARGS) GRPC_MUST_USE_RESULT;
static grpc_subchannel *connection_unref_locked (grpc_exec_ctx *exec_ctx, connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS) GRPC_MUST_USE_RESULT;
static void subchannel_destroy (grpc_exec_ctx * exec_ctx, grpc_subchannel * c);
#ifdef GRPC_SUBCHANNEL_REFCOUNT_DEBUG
@ -169,8 +169,8 @@ subchannel_unref_locked (grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
subchannel_unref_locked((p), __FILE__, __LINE__, (r))
#define CONNECTION_REF_LOCKED(p, r) \
connection_ref_locked((p), __FILE__, __LINE__, (r))
#define CONNECTION_UNREF_LOCKED(p, r, cl) \
connection_unref_locked((p), (cl), __FILE__, __LINE__, (r))
#define CONNECTION_UNREF_LOCKED(cl, p, r) \
connection_unref_locked((cl), (p), __FILE__, __LINE__, (r))
#define REF_PASS_ARGS , file, line, reason
#define REF_LOG(name, p) \
gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG, "%s: %p ref %d -> %d %s", \
@ -182,7 +182,7 @@ subchannel_unref_locked (grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
#define SUBCHANNEL_REF_LOCKED(p, r) subchannel_ref_locked((p))
#define SUBCHANNEL_UNREF_LOCKED(p, r) subchannel_unref_locked((p))
#define CONNECTION_REF_LOCKED(p, r) connection_ref_locked((p))
#define CONNECTION_UNREF_LOCKED(p, r, cl) connection_unref_locked((p), (cl))
#define CONNECTION_UNREF_LOCKED(cl, p, r) connection_unref_locked((cl), (p))
#define REF_PASS_ARGS
#define REF_LOG(name, p) \
do { \
@ -199,7 +199,7 @@ subchannel_unref_locked (grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
static void connection_destroy (grpc_exec_ctx * exec_ctx, connection * c)
{
GPR_ASSERT (c->refs == 0);
grpc_channel_stack_destroy (CHANNEL_STACK_FROM_CONNECTION (exec_ctx, c));
grpc_channel_stack_destroy (exec_ctx, CHANNEL_STACK_FROM_CONNECTION (c));
gpr_free (c);
}
@ -212,7 +212,7 @@ connection_ref_locked (connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
}
static grpc_subchannel *
connection_unref_locked (connection * c, grpc_closure_list * closure_list GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
connection_unref_locked (grpc_exec_ctx *exec_ctx, connection * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
{
grpc_subchannel *destroy = NULL;
UNREF_LOG ("CONNECTION", c);
@ -254,7 +254,7 @@ grpc_subchannel_ref (grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
}
void
grpc_subchannel_unref (grpc_subchannel * c, grpc_closure_list * closure_list GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
grpc_subchannel_unref (grpc_exec_ctx *exec_ctx, grpc_subchannel * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
{
int destroy;
gpr_mu_lock (&c->mu);
@ -761,13 +761,13 @@ grpc_subchannel_call_ref (grpc_subchannel_call * c GRPC_SUBCHANNEL_REF_EXTRA_ARG
}
void
grpc_subchannel_call_unref (grpc_subchannel_call * c, grpc_closure_list * closure_list GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
grpc_subchannel_call_unref (grpc_exec_ctx *exec_ctx, grpc_subchannel_call * c GRPC_SUBCHANNEL_REF_EXTRA_ARGS)
{
if (gpr_unref (&c->refs))
{
gpr_mu *mu = &c->connection->subchannel->mu;
grpc_subchannel *destroy;
grpc_call_stack_destroy (SUBCHANNEL_CALL_TO_CALL_STACK (exec_ctx, c));
grpc_call_stack_destroy (exec_ctx, SUBCHANNEL_CALL_TO_CALL_STACK (c));
gpr_mu_lock (mu);
destroy = CONNECTION_UNREF_LOCKED (exec_ctx, c->connection, "call");
gpr_mu_unlock (mu);

@ -47,27 +47,27 @@ typedef struct grpc_subchannel_args grpc_subchannel_args;
#ifdef GRPC_SUBCHANNEL_REFCOUNT_DEBUG
#define GRPC_SUBCHANNEL_REF(p, r) \
grpc_subchannel_ref((p), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_UNREF(p, r, cl) \
grpc_subchannel_unref((p), (cl), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_UNREF(cl, p, r) \
grpc_subchannel_unref((cl), (p), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_CALL_REF(p, r) \
grpc_subchannel_call_ref((p), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_CALL_UNREF(p, r, cl) \
grpc_subchannel_call_unref((p), (cl), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_CALL_UNREF(cl, p, r) \
grpc_subchannel_call_unref((cl), (p), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_REF_EXTRA_ARGS \
, const char *file, int line, const char *reason
#else
#define GRPC_SUBCHANNEL_REF(p, r) grpc_subchannel_ref((p))
#define GRPC_SUBCHANNEL_UNREF(p, r, cl) grpc_subchannel_unref((p), (cl))
#define GRPC_SUBCHANNEL_UNREF(cl, p, r) grpc_subchannel_unref((cl), (p))
#define GRPC_SUBCHANNEL_CALL_REF(p, r) grpc_subchannel_call_ref((p))
#define GRPC_SUBCHANNEL_CALL_UNREF(p, r, cl) \
grpc_subchannel_call_unref((p), (cl))
#define GRPC_SUBCHANNEL_CALL_UNREF(cl, p, r) \
grpc_subchannel_call_unref((cl), (p))
#define GRPC_SUBCHANNEL_REF_EXTRA_ARGS
#endif
void grpc_subchannel_ref (grpc_subchannel * channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_unref (grpc_subchannel * channel, grpc_closure_list * closure_list GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_unref (grpc_exec_ctx *exec_ctx, grpc_subchannel * channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_call_ref (grpc_subchannel_call * call GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_call_unref (grpc_subchannel_call * call, grpc_closure_list * closure_list GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_call_unref (grpc_exec_ctx *exec_ctx, grpc_subchannel_call * call GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
/** construct a call (possibly asynchronously) */
void grpc_subchannel_create_call (grpc_exec_ctx * exec_ctx, grpc_subchannel * subchannel, grpc_pollset * pollset, grpc_subchannel_call ** target, grpc_closure * notify);

@ -73,7 +73,7 @@ static grpc_httpcli_get_override g_get_override = NULL;
static grpc_httpcli_post_override g_post_override = NULL;
static void
plaintext_handshake (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list))
plaintext_handshake (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint))
{
on_done (exec_ctx, arg, endpoint);
}
@ -155,7 +155,7 @@ on_read (grpc_exec_ctx * exec_ctx, void *user_data, int success)
}
else
{
finish (req, grpc_httpcli_parser_eof (exec_ctx, &req->parser));
finish (exec_ctx, req, grpc_httpcli_parser_eof (&req->parser));
}
}
@ -226,7 +226,7 @@ next_address (grpc_exec_ctx * exec_ctx, internal_request * req)
}
addr = &req->addresses->addrs[req->next_address++];
grpc_closure_init (&req->connected, on_connected, req);
grpc_tcp_client_connect (&req->connected, &req->ep, &req->context->pollset_set, (exec_ctx, struct sockaddr *) &addr->addr, addr->len, req->deadline);
grpc_tcp_client_connect (exec_ctx, &req->connected, &req->ep, &req->context->pollset_set, (struct sockaddr *) &addr->addr, addr->len, req->deadline);
}
static void
@ -276,7 +276,7 @@ grpc_httpcli_get (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grpc
return;
}
gpr_asprintf (&name, "HTTP:GET:%s:%s", request->host, request->path);
internal_request_begin (context, pollset, request, deadline, on_response, user_data, name, grpc_httpcli_format_get_request (exec_ctx, request));
internal_request_begin (exec_ctx, context, pollset, request, deadline, on_response, user_data, name, grpc_httpcli_format_get_request (request));
gpr_free (name);
}
@ -289,7 +289,7 @@ grpc_httpcli_post (grpc_exec_ctx * exec_ctx, grpc_httpcli_context * context, grp
return;
}
gpr_asprintf (&name, "HTTP:POST:%s:%s", request->host, request->path);
internal_request_begin (context, pollset, request, deadline, on_response, user_data, name, grpc_httpcli_format_post_request (exec_ctx, request, body_bytes, body_size));
internal_request_begin (exec_ctx, context, pollset, request, deadline, on_response, user_data, name, grpc_httpcli_format_post_request (request, body_bytes, body_size));
gpr_free (name);
}

@ -64,7 +64,7 @@ typedef struct grpc_httpcli_context
typedef struct
{
const char *default_port;
void (*handshake) (void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list));
void (*handshake) (grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint * endpoint, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint));
} grpc_httpcli_handshaker;
extern const grpc_httpcli_handshaker grpc_httpcli_plaintext;

@ -164,7 +164,7 @@ on_secure_transport_setup_done (grpc_exec_ctx * exec_ctx, void *rp, grpc_securit
}
static void
ssl_handshake (void *arg, grpc_endpoint * tcp, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint, grpc_closure_list * closure_list))
ssl_handshake (grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint * tcp, const char *host, void (*on_done) (grpc_exec_ctx * exec_ctx, void *arg, grpc_endpoint * endpoint))
{
grpc_channel_security_connector *sc = NULL;
const unsigned char *pem_root_certs = NULL;

@ -105,10 +105,10 @@ grpc_alarm_list_init (gpr_timespec now)
}
void
grpc_alarm_list_shutdown (grpc_closure_list * closure_list)
grpc_alarm_list_shutdown (grpc_exec_ctx *exec_ctx)
{
int i;
run_some_expired_alarms (gpr_inf_future (exec_ctx, g_clock_type), NULL, 0);
run_some_expired_alarms (exec_ctx, gpr_inf_future (g_clock_type), NULL, 0);
for (i = 0; i < NUM_SHARDS; i++)
{
shard_type *shard = &g_shards[i];
@ -373,7 +373,7 @@ int
grpc_alarm_check (grpc_exec_ctx * exec_ctx, gpr_timespec now, gpr_timespec * next)
{
GPR_ASSERT (now.clock_type == g_clock_type);
return run_some_expired_alarms (now, next, gpr_time_cmp (now, gpr_inf_future (exec_ctx, now.clock_type)) != 0);
return run_some_expired_alarms (exec_ctx, now, next, gpr_time_cmp (now, gpr_inf_future (now.clock_type)) != 0);
}
gpr_timespec

@ -51,7 +51,7 @@
int grpc_alarm_check (grpc_exec_ctx * exec_ctx, gpr_timespec now, gpr_timespec * next);
void grpc_alarm_list_init (gpr_timespec now);
void grpc_alarm_list_shutdown (grpc_closure_list * closure_list);
void grpc_alarm_list_shutdown (grpc_exec_ctx * exec_ctx);
gpr_timespec grpc_alarm_list_next_timeout (void);

@ -59,22 +59,6 @@ grpc_closure_list_add (grpc_closure_list * closure_list, grpc_closure * closure,
closure_list->tail = closure;
}
void
grpc_closure_list_run (grpc_closure_list * closure_list)
{
while (!grpc_closure_list_empty (*closure_list))
{
grpc_closure *c = closure_list->head;
closure_list->head = closure_list->tail = NULL;
while (c != NULL)
{
grpc_closure *next = c->next;
c->cb (exec_ctx, c->cb_arg, c->success);
c = next;
}
}
}
int
grpc_closure_list_empty (grpc_closure_list closure_list)
{

@ -39,6 +39,10 @@
struct grpc_closure;
typedef struct grpc_closure grpc_closure;
/* forward declaration for exec_ctx.h */
struct grpc_exec_ctx;
typedef struct grpc_exec_ctx grpc_exec_ctx;
typedef struct grpc_closure_list
{
grpc_closure *head;
@ -77,7 +81,6 @@ void grpc_closure_init (grpc_closure * closure, grpc_iomgr_cb_func cb, void *cb_
{ NULL, NULL }
void grpc_closure_list_add (grpc_closure_list * list, grpc_closure * closure, int success);
void grpc_closure_list_run (grpc_closure_list * list);
void grpc_closure_list_move (grpc_closure_list * src, grpc_closure_list * dst);
int grpc_closure_list_empty (grpc_closure_list list);

@ -0,0 +1,62 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "src/core/iomgr/exec_ctx.h"
void
grpc_exec_ctx_flush (grpc_exec_ctx *exec_ctx)
{
while (!grpc_closure_list_empty (exec_ctx->closure_list))
{
grpc_closure *c = closure_list->head;
closure_list->head = closure_list->tail = NULL;
while (c != NULL)
{
grpc_closure *next = c->next;
c->cb (exec_ctx, c->cb_arg, c->success);
c = next;
}
}
}
void grpc_exec_ctx_finish(grpc_exec_ctx *exec_ctx) {
grpc_exec_ctx_flush(exec_ctx);
}
void grpc_exec_ctx_enqueue(grpc_exec_ctx *exec_ctx, grpc_closure *closure, int success) {
grpc_closure_list_add(&exec_ctx->closure_list, closure, success);
}
void grpc_exec_ctx_enqueue_list(grpc_exec_ctx *exec_ctx, grpc_closure_list *list) {
grpc_closure_list_move(list, &exec_ctx->closure_list);
}

@ -36,4 +36,15 @@
#include "src/core/iomgr/closure.h"
struct grpc_exec_ctx {
grpc_closure_list closure_list;
};
#define GRPC_EXEC_CTX_INIT { GRPC_CLOSURE_LIST_INIT }
void grpc_exec_ctx_finish(grpc_exec_ctx *exec_ctx);
void grpc_exec_ctx_flush(grpc_exec_ctx *exec_ctx);
void grpc_exec_ctx_enqueue(grpc_exec_ctx *exec_ctx, grpc_closure *closure, int success);
void grpc_exec_ctx_enqueue_list(grpc_exec_ctx *exec_ctx, grpc_closure_list *list);
#endif

@ -113,7 +113,7 @@ grpc_iomgr_shutdown (void)
}
last_warning_time = gpr_now (GPR_CLOCK_REALTIME);
}
if (grpc_alarm_check (gpr_inf_future (&exec_ctx, GPR_CLOCK_MONOTONIC), NULL))
if (grpc_alarm_check (&exec_ctx, gpr_inf_future (GPR_CLOCK_MONOTONIC), NULL))
{
gpr_mu_unlock (&g_mu);
grpc_exec_ctx_finish (&exec_ctx);
@ -142,7 +142,7 @@ grpc_iomgr_shutdown (void)
}
gpr_mu_unlock (&g_mu);
grpc_alarm_list_shutdown (&closure_list);
grpc_alarm_list_shutdown (&exec_ctx);
grpc_exec_ctx_finish (&exec_ctx);
/* ensure all threads have left g_mu */

@ -217,7 +217,7 @@ grpc_pollset_work (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollse
grpc_wakeup_fd_init (&worker->wakeup_fd);
if (!grpc_pollset_has_workers (pollset) && !grpc_closure_list_empty (pollset->idle_jobs))
{
grpc_closure_list_move (exec_ctx, &pollset->idle_jobs);
grpc_exec_ctx_enqueue_list (exec_ctx, &pollset->idle_jobs);
goto done;
}
if (grpc_alarm_check (exec_ctx, now, &deadline))
@ -251,7 +251,7 @@ grpc_pollset_work (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollse
done:
if (!locked)
{
grpc_closure_list_run (closure_list);
grpc_exec_ctx_flush (exec_ctx);
gpr_mu_lock (&pollset->mu);
locked = 1;
}
@ -271,7 +271,7 @@ done:
pollset->called_shutdown = 1;
gpr_mu_unlock (&pollset->mu);
finish_shutdown (exec_ctx, pollset);
grpc_closure_list_run (closure_list);
grpc_exec_ctx_flush (exec_ctx);
/* Continuing to access pollset here is safe -- it is the caller's
* responsibility to not destroy when it has outstanding calls to
* grpc_pollset_work.
@ -397,7 +397,7 @@ basic_do_promote (grpc_exec_ctx * exec_ctx, void *args, int success)
if (fds[0] && !grpc_fd_is_orphaned (fds[0]))
{
grpc_platform_become_multipoller (pollset, fds, GPR_ARRAY_SIZE (exec_ctx, fds));
grpc_platform_become_multipoller (exec_ctx, pollset, fds, GPR_ARRAY_SIZE (fds));
GRPC_FD_UNREF (fds[0], "basicpoll");
}
else
@ -417,8 +417,6 @@ basic_do_promote (grpc_exec_ctx * exec_ctx, void *args, int success)
/* Matching ref in basic_pollset_add_fd */
GRPC_FD_UNREF (fd, "basicpoll_add");
grpc_closure_list_run (closure_list);
}
static void
@ -445,7 +443,7 @@ basic_pollset_add_fd (grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_fd
}
else if (!grpc_fd_is_orphaned (fds[0]))
{
grpc_platform_become_multipoller (pollset, fds, GPR_ARRAY_SIZE (exec_ctx, fds));
grpc_platform_become_multipoller (exec_ctx, pollset, fds, GPR_ARRAY_SIZE (fds));
GRPC_FD_UNREF (fds[0], "basicpoll");
}
else

@ -315,7 +315,7 @@ grpc_tcp_client_connect (grpc_exec_ctx * exec_ctx, grpc_closure * closure, grpc_
}
gpr_mu_lock (&ac->mu);
grpc_alarm_init (&ac->alarm, gpr_convert_clock_type (deadline, GPR_CLOCK_MONOTONIC), tc_on_alarm, ac, gpr_now (exec_ctx, GPR_CLOCK_MONOTONIC));
grpc_alarm_init (exec_ctx, &ac->alarm, gpr_convert_clock_type (deadline, GPR_CLOCK_MONOTONIC), tc_on_alarm, ac, gpr_now (GPR_CLOCK_MONOTONIC));
grpc_fd_notify_on_write (exec_ctx, ac->fd, &ac->write_closure);
gpr_mu_unlock (&ac->mu);

@ -95,10 +95,8 @@ typedef struct
char *peer_string;
} grpc_tcp;
static void tcp_handle_read (void *arg /* grpc_tcp */ , int success,
grpc_closure_list * closure_list);
static void tcp_handle_write (void *arg /* grpc_tcp */ , int success,
grpc_closure_list * closure_list);
static void tcp_handle_read (grpc_exec_ctx * exec_ctx, void *arg /* grpc_tcp */ , int success);
static void tcp_handle_write (grpc_exec_ctx * exec_ctx, void *arg /* grpc_tcp */ , int success);
static void
tcp_shutdown (grpc_exec_ctx * exec_ctx, grpc_endpoint * ep)
@ -117,11 +115,11 @@ tcp_free (grpc_exec_ctx * exec_ctx, grpc_tcp * tcp)
/*#define GRPC_TCP_REFCOUNT_DEBUG*/
#ifdef GRPC_TCP_REFCOUNT_DEBUG
#define TCP_UNREF(tcp, reason, cl) \
tcp_unref((tcp), (cl), (reason), __FILE__, __LINE__)
#define TCP_UNREF(cl, tcp, reason) \
tcp_unref((cl), (tcp), (reason), __FILE__, __LINE__)
#define TCP_REF(tcp, reason) tcp_ref((tcp), (reason), __FILE__, __LINE__)
static void
tcp_unref (grpc_tcp * tcp, grpc_closure_list * closure_list, const char *reason, const char *file, int line)
tcp_unref (grpc_exec_ctx *exec_ctx, grpc_tcp * tcp, const char *reason, const char *file, int line)
{
gpr_log (file, line, GPR_LOG_SEVERITY_DEBUG, "TCP unref %p : %s %d -> %d", tcp, reason, tcp->refcount.count, tcp->refcount.count - 1);
if (gpr_unref (&tcp->refcount))
@ -137,7 +135,7 @@ tcp_ref (grpc_tcp * tcp, const char *reason, const char *file, int line)
gpr_ref (&tcp->refcount);
}
#else
#define TCP_UNREF(tcp, reason, cl) tcp_unref((tcp), (cl))
#define TCP_UNREF(cl, tcp, reason) tcp_unref((cl), (tcp))
#define TCP_REF(tcp, reason) tcp_ref((tcp))
static void
tcp_unref (grpc_exec_ctx * exec_ctx, grpc_tcp * tcp)
@ -273,8 +271,7 @@ tcp_continue_read (grpc_exec_ctx * exec_ctx, grpc_tcp * tcp)
}
static void
tcp_handle_read (void *arg /* grpc_tcp */ , int success,
grpc_closure_list * closure_list)
tcp_handle_read (grpc_exec_ctx * exec_ctx, void *arg /* grpc_tcp */ , int success)
{
grpc_tcp *tcp = (grpc_tcp *) arg;
GPR_ASSERT (!tcp->finished_edge);
@ -401,8 +398,7 @@ tcp_flush (grpc_tcp * tcp)
}
static void
tcp_handle_write (void *arg /* grpc_tcp */ , int success,
grpc_closure_list * closure_list)
tcp_handle_write (grpc_exec_ctx *exec_ctx, void *arg /* grpc_tcp */ , int success)
{
grpc_tcp *tcp = (grpc_tcp *) arg;
flush_result status;

@ -387,7 +387,7 @@ on_read (grpc_exec_ctx * exec_ctx, void *arg, int success)
{
grpc_pollset_add_fd (exec_ctx, sp->server->pollsets[i], fdobj);
}
sp->server->on_accept_cb (sp->server->on_accept_cb_arg, grpc_tcp_create (exec_ctx, fdobj, GRPC_TCP_DEFAULT_READ_SLICE_SIZE, addr_str));
sp->server->on_accept_cb (exec_ctx, sp->server->on_accept_cb_arg, grpc_tcp_create (fdobj, GRPC_TCP_DEFAULT_READ_SLICE_SIZE, addr_str));
gpr_free (name);
gpr_free (addr_str);

@ -37,6 +37,7 @@
#include "src/core/iomgr/iomgr.h"
#include "src/core/iomgr/pollset.h"
#include "src/core/iomgr/closure.h"
#include "src/core/iomgr/exec_ctx.h"
#ifdef GPR_POSIX_SOCKET
#include "src/core/iomgr/workqueue_posix.h"
@ -51,7 +52,7 @@ struct grpc_workqueue;
typedef struct grpc_workqueue grpc_workqueue;
/** Create a work queue */
grpc_workqueue *grpc_workqueue_create (grpc_closure_list * closure_list);
grpc_workqueue *grpc_workqueue_create (grpc_exec_ctx *exec_ctx);
void grpc_workqueue_flush (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue);
@ -59,13 +60,13 @@ void grpc_workqueue_flush (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue)
#ifdef GRPC_WORKQUEUE_REFCOUNT_DEBUG
#define GRPC_WORKQUEUE_REF(p, r) \
grpc_workqueue_ref((p), __FILE__, __LINE__, (r))
#define GRPC_WORKQUEUE_UNREF(p, r, cl) \
grpc_workqueue_unref((p), (cl), __FILE__, __LINE__, (r))
#define GRPC_WORKQUEUE_UNREF(cl, p, r) \
grpc_workqueue_unref((cl), (p), __FILE__, __LINE__, (r))
void grpc_workqueue_ref (grpc_workqueue * workqueue, const char *file, int line, const char *reason);
void grpc_workqueue_unref (grpc_workqueue * workqueue, grpc_closure_list * closure_list, const char *file, int line, const char *reason);
void grpc_workqueue_unref (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue, const char *file, int line, const char *reason);
#else
#define GRPC_WORKQUEUE_REF(p, r) grpc_workqueue_ref((p))
#define GRPC_WORKQUEUE_UNREF(p, r, cl) grpc_workqueue_unref((p), (cl))
#define GRPC_WORKQUEUE_UNREF(cl, p, r) grpc_workqueue_unref((cl), (p))
void grpc_workqueue_ref (grpc_workqueue * workqueue);
void grpc_workqueue_unref (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue);
#endif

@ -48,7 +48,7 @@
static void on_readable (grpc_exec_ctx * exec_ctx, void *arg, int success);
grpc_workqueue *
grpc_workqueue_create (grpc_closure_list * closure_list)
grpc_workqueue_create (grpc_exec_ctx *exec_ctx)
{
char name[32];
grpc_workqueue *workqueue = gpr_malloc (sizeof (grpc_workqueue));
@ -85,7 +85,7 @@ grpc_workqueue_ref (grpc_workqueue * workqueue)
#ifdef GRPC_WORKQUEUE_REFCOUNT_DEBUG
void
grpc_workqueue_unref (grpc_workqueue * workqueue, grpc_closure_list * closure_list, const char *file, int line, const char *reason)
grpc_workqueue_unref (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue, const char *file, int line, const char *reason)
{
gpr_log (file, line, GPR_LOG_SEVERITY_DEBUG, "WORKQUEUE:%p unref %d -> %d %s", workqueue, (int) workqueue->refs.count, (int) workqueue->refs.count - 1, reason);
#else
@ -109,7 +109,7 @@ void
grpc_workqueue_flush (grpc_exec_ctx * exec_ctx, grpc_workqueue * workqueue)
{
gpr_mu_lock (&workqueue->mu);
grpc_closure_list_move (exec_ctx, &workqueue->closure_list);
grpc_closure_list_move (&exec_ctx->closure_list, &workqueue->closure_list);
gpr_mu_unlock (&workqueue->mu);
}
@ -130,7 +130,7 @@ on_readable (grpc_exec_ctx * exec_ctx, void *arg, int success)
else
{
gpr_mu_lock (&workqueue->mu);
grpc_closure_list_move (exec_ctx, &workqueue->closure_list);
grpc_closure_list_move (&exec_ctx->closure_list, &workqueue->closure_list);
grpc_wakeup_fd_consume_wakeup (&workqueue->wakeup_fd);
gpr_mu_unlock (&workqueue->mu);
grpc_fd_notify_on_read (exec_ctx, workqueue->wakeup_read_fd, &workqueue->read_closure);

@ -676,7 +676,7 @@ oauth2_token_fetcher_get_request_metadata (grpc_exec_ctx * exec_ctx, grpc_creden
}
else
{
c->fetch_func (grpc_credentials_metadata_request_create (creds, cb, user_data), &c->httpcli_context, pollset, on_oauth2_token_fetcher_http_response, gpr_time_add (gpr_now (exec_ctx, GPR_CLOCK_REALTIME), refresh_threshold));
c->fetch_func (exec_ctx, grpc_credentials_metadata_request_create (creds, cb, user_data), &c->httpcli_context, pollset, on_oauth2_token_fetcher_http_response, gpr_time_add (gpr_now (GPR_CLOCK_REALTIME), refresh_threshold));
}
}
@ -755,7 +755,7 @@ refresh_token_fetch_oauth2 (grpc_exec_ctx * exec_ctx, grpc_credentials_metadata_
request.hdr_count = 1;
request.hdrs = &header;
request.handshaker = &grpc_httpcli_ssl;
grpc_httpcli_post (httpcli_context, pollset, &request, body, strlen (exec_ctx, body), deadline, response_cb, metadata_req);
grpc_httpcli_post (exec_ctx,httpcli_context, pollset, &request, body, strlen ( body), deadline, response_cb, metadata_req);
gpr_free (body);
}
@ -1075,7 +1075,6 @@ composite_metadata_cb (grpc_exec_ctx * exec_ctx, void *user_data, grpc_credentia
/* We're done!. */
ctx->cb (exec_ctx, ctx->user_data, ctx->md_elems->entries, ctx->md_elems->num_entries, GRPC_CREDENTIALS_OK);
composite_md_context_destroy (ctx);
grpc_closure_list_run (closure_list);
}
static void

@ -121,7 +121,7 @@ is_stack_running_on_compute_engine (void)
grpc_httpcli_context_init (&context);
grpc_httpcli_get (&context, &detector.pollset, &request, gpr_time_add (gpr_now (&exec_ctx, GPR_CLOCK_REALTIME), max_detection_delay), on_compute_engine_detection_http_response, &detector);
grpc_httpcli_get (&exec_ctx, &context, &detector.pollset, &request, gpr_time_add (gpr_now (GPR_CLOCK_REALTIME), max_detection_delay), on_compute_engine_detection_http_response, &detector);
grpc_exec_ctx_finish (&exec_ctx);
@ -131,7 +131,7 @@ is_stack_running_on_compute_engine (void)
while (!detector.is_done)
{
grpc_pollset_worker worker;
grpc_pollset_work (&detector.pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), gpr_inf_future (&exec_ctx, GPR_CLOCK_MONOTONIC));
grpc_pollset_work (&exec_ctx, &detector.pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), gpr_inf_future (GPR_CLOCK_MONOTONIC));
}
gpr_mu_unlock (GRPC_POLLSET_MU (&detector.pollset));

@ -774,7 +774,7 @@ on_openid_config_retrieved (grpc_exec_ctx * exec_ctx, void *user_data, const grp
{
*(req.host + (req.path - jwks_uri)) = '\0';
}
grpc_httpcli_get (&ctx->verifier->http_ctx, ctx->pollset, &req, gpr_time_add (gpr_now (exec_ctx, GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), on_keys_retrieved, ctx);
grpc_httpcli_get (exec_ctx, &ctx->verifier->http_ctx, ctx->pollset, &req, gpr_time_add (gpr_now (GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), on_keys_retrieved, ctx);
grpc_json_destroy (json);
gpr_free (req.host);
return;
@ -893,7 +893,7 @@ retrieve_key_and_verify (grpc_exec_ctx * exec_ctx, verifier_cb_ctx * ctx)
http_cb = on_openid_config_retrieved;
}
grpc_httpcli_get (&ctx->verifier->http_ctx, ctx->pollset, &req, gpr_time_add (gpr_now (exec_ctx, GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), http_cb, ctx);
grpc_httpcli_get (exec_ctx, &ctx->verifier->http_ctx, ctx->pollset, &req, gpr_time_add (gpr_now (GPR_CLOCK_REALTIME), grpc_jwt_verifier_max_delay), http_cb, ctx);
gpr_free (req.host);
gpr_free (req.path);
return;
@ -943,7 +943,7 @@ grpc_jwt_verifier_verify (grpc_exec_ctx * exec_ctx, grpc_jwt_verifier * verifier
signature = grpc_base64_decode (cur, 1);
if (GPR_SLICE_IS_EMPTY (signature))
goto error;
retrieve_key_and_verify (verifier_cb_ctx_create (exec_ctx, verifier, pollset, header, claims, audience, signature, jwt, signed_jwt_len, user_data, cb));
retrieve_key_and_verify (exec_ctx, verifier_cb_ctx_create (verifier, pollset, header, claims, audience, signature, jwt, signed_jwt_len, user_data, cb));
return;
error:

@ -85,8 +85,8 @@ destroy (grpc_exec_ctx * exec_ctx, secure_endpoint * secure_ep)
/*#define GRPC_SECURE_ENDPOINT_REFCOUNT_DEBUG*/
#ifdef GRPC_SECURE_ENDPOINT_REFCOUNT_DEBUG
#define SECURE_ENDPOINT_UNREF(ep, reason, cl) \
secure_endpoint_unref((ep), (cl), (reason), __FILE__, __LINE__)
#define SECURE_ENDPOINT_UNREF(exec_ctx, ep, reason) \
secure_endpoint_unref((exec_ctx), (ep), (reason), __FILE__, __LINE__)
#define SECURE_ENDPOINT_REF(ep, reason) \
secure_endpoint_ref((ep), (reason), __FILE__, __LINE__)
static void
@ -106,7 +106,7 @@ secure_endpoint_ref (secure_endpoint * ep, const char *reason, const char *file,
gpr_ref (&ep->ref);
}
#else
#define SECURE_ENDPOINT_UNREF(ep, reason, cl) secure_endpoint_unref((ep), (cl))
#define SECURE_ENDPOINT_UNREF(exec_ctx, ep, reason) secure_endpoint_unref((exec_ctx), (ep))
#define SECURE_ENDPOINT_REF(ep, reason) secure_endpoint_ref((ep))
static void
secure_endpoint_unref (grpc_exec_ctx * exec_ctx, secure_endpoint * ep)

@ -315,13 +315,13 @@ fake_channel_check_call_host (grpc_exec_ctx * exec_ctx, grpc_channel_security_co
static void
fake_channel_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data)
{
grpc_do_security_handshake (tsi_create_fake_handshaker (exec_ctx, 1), sc, nonsecure_endpoint, cb, user_data);
grpc_do_security_handshake (exec_ctx, tsi_create_fake_handshaker (1), sc, nonsecure_endpoint, cb, user_data);
}
static void
fake_server_do_handshake (grpc_exec_ctx * exec_ctx, grpc_security_connector * sc, grpc_endpoint * nonsecure_endpoint, grpc_security_handshake_done_cb cb, void *user_data)
{
grpc_do_security_handshake (tsi_create_fake_handshaker (exec_ctx, 0), sc, nonsecure_endpoint, cb, user_data);
grpc_do_security_handshake (exec_ctx, tsi_create_fake_handshaker (0), sc, nonsecure_endpoint, cb, user_data);
}
static grpc_security_connector_vtable fake_channel_vtable = {

@ -104,7 +104,7 @@ setup_transport (grpc_exec_ctx * exec_ctx, void *statep, grpc_transport * transp
args_to_add[0] = grpc_security_connector_to_arg (state->sc);
args_to_add[1] = grpc_auth_metadata_processor_to_arg (&state->creds->processor);
args_copy = grpc_channel_args_copy_and_add (grpc_server_get_channel_args (state->server), args_to_add, GPR_ARRAY_SIZE (args_to_add));
grpc_server_setup_transport (state->server, transport, extra_filters, GPR_ARRAY_SIZE (exec_ctx, extra_filters), mdctx, args_copy);
grpc_server_setup_transport (exec_ctx, state->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, args_copy);
grpc_channel_args_destroy (args_copy);
}
@ -146,7 +146,7 @@ on_secure_handshake_done (grpc_exec_ctx * exec_ctx, void *statep, grpc_security_
if (!state->is_shutdown)
{
mdctx = grpc_mdctx_create ();
transport = grpc_create_chttp2_transport (grpc_server_get_channel_args (exec_ctx, state->server), secure_endpoint, mdctx, 0);
transport = grpc_create_chttp2_transport (exec_ctx, grpc_server_get_channel_args (state->server), secure_endpoint, mdctx, 0);
setup_transport (exec_ctx, state, transport, mdctx);
grpc_chttp2_transport_start_reading (exec_ctx, transport, NULL, 0);
}

@ -355,7 +355,7 @@ grpc_call_create (grpc_channel * channel, grpc_call * parent_call, gpr_uint32 pr
GRPC_CALL_INTERNAL_REF (call, "receiving");
initial_op_ptr = &initial_op;
}
grpc_call_stack_init (channel_stack, server_transport_data, initial_op_ptr, CALL_STACK_FROM_CALL (&exec_ctx, call));
grpc_call_stack_init (&exec_ctx, channel_stack, server_transport_data, initial_op_ptr, CALL_STACK_FROM_CALL (call));
if (parent_call != NULL)
{
GRPC_CALL_INTERNAL_REF (parent_call, "child");
@ -473,7 +473,7 @@ destroy_call (grpc_exec_ctx * exec_ctx, grpc_call * call)
{
size_t i;
grpc_call *c = call;
grpc_call_stack_destroy (CALL_STACK_FROM_CALL (exec_ctx, c));
grpc_call_stack_destroy (exec_ctx, CALL_STACK_FROM_CALL (c));
GRPC_CHANNEL_INTERNAL_UNREF (exec_ctx, c->channel, "call");
gpr_mu_destroy (&c->mu);
gpr_mu_destroy (&c->completion_mu);
@ -1554,7 +1554,7 @@ set_deadline_alarm (grpc_exec_ctx * exec_ctx, grpc_call * call, gpr_timespec dea
GRPC_CALL_INTERNAL_REF (call, "alarm");
call->have_alarm = 1;
call->send_deadline = gpr_convert_clock_type (deadline, GPR_CLOCK_MONOTONIC);
grpc_alarm_init (&call->alarm, call->send_deadline, call_alarm, call, gpr_now (exec_ctx, GPR_CLOCK_MONOTONIC));
grpc_alarm_init (exec_ctx, &call->alarm, call->send_deadline, call_alarm, call, gpr_now (GPR_CLOCK_MONOTONIC));
}
/* we offset status by a small amount when storing it into transport metadata
@ -1714,13 +1714,13 @@ set_cancelled_value (grpc_status_code status, void *dest)
static void
finish_batch (grpc_exec_ctx * exec_ctx, grpc_call * call, int success, void *tag)
{
grpc_cq_end_op (call->cq, tag, success, done_completion, call, allocate_completion (exec_ctx, call));
grpc_cq_end_op (exec_ctx,call->cq, tag, success, done_completion, call, allocate_completion ( call));
}
static void
finish_batch_with_close (grpc_exec_ctx * exec_ctx, grpc_call * call, int success, void *tag)
{
grpc_cq_end_op (call->cq, tag, 1, done_completion, call, allocate_completion (exec_ctx, call));
grpc_cq_end_op (exec_ctx,call->cq, tag, 1, done_completion, call, allocate_completion ( call));
}
static int
@ -1740,7 +1740,7 @@ grpc_call_start_batch (grpc_call * call, const grpc_op * ops, size_t nops, void
size_t out;
const grpc_op *op;
grpc_ioreq *req;
void (*finish_func) (grpc_call *, int, void *, grpc_closure_list *) = finish_batch;
void (*finish_func) (grpc_exec_ctx *, grpc_call *, int, void *) = finish_batch;
grpc_call_error error;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@ -1756,7 +1756,7 @@ grpc_call_start_batch (grpc_call * call, const grpc_op * ops, size_t nops, void
{
grpc_cq_begin_op (call->cq);
GRPC_CALL_INTERNAL_REF (call, "completion");
grpc_cq_end_op (call->cq, tag, 1, done_completion, call, allocate_completion (&exec_ctx, call));
grpc_cq_end_op (&exec_ctx, call->cq, tag, 1, done_completion, call, allocate_completion (call));
error = GRPC_CALL_OK;
goto done;
}

@ -187,7 +187,7 @@ grpc_channel_create_from_filters (grpc_exec_ctx * exec_ctx, const char *target,
gpr_free (default_authority);
}
grpc_channel_stack_init (filters, num_filters, channel, args, channel->metadata_context, CHANNEL_STACK_FROM_CHANNEL (exec_ctx, channel));
grpc_channel_stack_init (exec_ctx, filters, num_filters, channel, args, channel->metadata_context, CHANNEL_STACK_FROM_CHANNEL (channel));
return channel;
}
@ -265,7 +265,7 @@ static void
destroy_channel (grpc_exec_ctx * exec_ctx, grpc_channel * channel)
{
size_t i;
grpc_channel_stack_destroy (CHANNEL_STACK_FROM_CHANNEL (exec_ctx, channel));
grpc_channel_stack_destroy (exec_ctx,CHANNEL_STACK_FROM_CHANNEL ( channel));
for (i = 0; i < NUM_CACHED_STATUS_ELEMS; i++)
{
GRPC_MDELEM_UNREF (channel->grpc_status_elem[i]);

@ -127,7 +127,7 @@ partly_done (grpc_exec_ctx * exec_ctx, state_watcher * w, int due_to_completion)
{
w->removed = 1;
client_channel_elem = grpc_channel_stack_last_element (grpc_channel_get_channel_stack (w->channel));
grpc_client_channel_del_interested_party (client_channel_elem, grpc_cq_pollset (exec_ctx, w->cq));
grpc_client_channel_del_interested_party (exec_ctx, client_channel_elem, grpc_cq_pollset (w->cq));
}
gpr_mu_unlock (&w->mu);
if (due_to_completion)
@ -195,17 +195,17 @@ grpc_channel_watch_connectivity_state (grpc_channel * channel, grpc_connectivity
w->tag = tag;
w->channel = channel;
grpc_alarm_init (&w->alarm, gpr_convert_clock_type (deadline, GPR_CLOCK_MONOTONIC), timeout_complete, w, gpr_now (&exec_ctx, GPR_CLOCK_MONOTONIC));
grpc_alarm_init (&exec_ctx, &w->alarm, gpr_convert_clock_type (deadline, GPR_CLOCK_MONOTONIC), timeout_complete, w, gpr_now (GPR_CLOCK_MONOTONIC));
if (client_channel_elem->filter != &grpc_client_channel_filter)
{
gpr_log (GPR_ERROR, "grpc_channel_watch_connectivity_state called on something that is " "not a client channel, but '%s'", client_channel_elem->filter->name);
grpc_closure_list_add (&closure_list, &w->on_complete, 1);
grpc_exec_ctx_enqueue(&exec_ctx, &w->on_complete ,1);
}
else
{
GRPC_CHANNEL_INTERNAL_REF (channel, "watch_connectivity");
grpc_client_channel_add_interested_party (client_channel_elem, grpc_cq_pollset (&exec_ctx, cq));
grpc_client_channel_add_interested_party (&exec_ctx, client_channel_elem, grpc_cq_pollset (cq));
grpc_client_channel_watch_connectivity_state (&exec_ctx, client_channel_elem, &w->state, &w->on_complete);
}

@ -224,7 +224,7 @@ grpc_insecure_channel_create (const char *target, const grpc_channel_args * args
return NULL;
}
grpc_client_channel_set_resolver (grpc_channel_get_channel_stack (&exec_ctx, channel), resolver);
grpc_client_channel_set_resolver (&exec_ctx, grpc_channel_get_channel_stack (channel), resolver);
GRPC_RESOLVER_UNREF (&exec_ctx, resolver, "create");
grpc_subchannel_factory_unref (&exec_ctx, &f->base);

@ -144,7 +144,7 @@ grpc_cq_begin_op (grpc_completion_queue * cc)
event, then enter shutdown mode */
/* Queue a GRPC_OP_COMPLETED operation */
void
grpc_cq_end_op (grpc_completion_queue * cc, void *tag, int success, void (*done) (grpc_exec_ctx * exec_ctx, void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list), void *done_arg, grpc_cq_completion * storage)
grpc_cq_end_op (grpc_exec_ctx * exec_ctx,grpc_completion_queue * cc, void *tag, int success, void (*done) (grpc_exec_ctx * exec_ctx, void *done_arg, grpc_cq_completion * storage), void *done_arg, grpc_cq_completion * storage)
{
int shutdown;
int i;

@ -70,7 +70,7 @@ void grpc_cq_internal_unref (grpc_completion_queue * cc);
void grpc_cq_begin_op (grpc_completion_queue * cc);
/* Queue a GRPC_OP_COMPLETED operation */
void grpc_cq_end_op (grpc_completion_queue * cc, void *tag, int success, void (*done) (grpc_exec_ctx * exec_ctx, void *done_arg, grpc_cq_completion * storage, grpc_closure_list * closure_list), void *done_arg, grpc_cq_completion * storage);
void grpc_cq_end_op (grpc_exec_ctx * exec_ctx, grpc_completion_queue * cc, void *tag, int success, void (*done) (grpc_exec_ctx * exec_ctx,void *done_arg, grpc_cq_completion * storage), void *done_arg, grpc_cq_completion * storage);
grpc_pollset *grpc_cq_pollset (grpc_completion_queue * cc);

@ -165,7 +165,7 @@ grpc_lame_client_channel_create (const char *target, grpc_status_code error_code
channel_data *chand;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
static const grpc_channel_filter *filters[] = { &lame_filter };
channel = grpc_channel_create_from_filters (target, filters, 1, NULL, grpc_mdctx_create (&exec_ctx, ), 1);
channel = grpc_channel_create_from_filters (&exec_ctx, target, filters, 1, NULL, grpc_mdctx_create (), 1);
elem = grpc_channel_stack_element (grpc_channel_get_channel_stack (channel), 0);
GPR_ASSERT (elem->filter == &lame_filter);
chand = (channel_data *) elem->channel_data;

@ -302,7 +302,7 @@ grpc_secure_channel_create (grpc_credentials * creds, const char *target, const
return NULL;
}
grpc_client_channel_set_resolver (grpc_channel_get_channel_stack (&exec_ctx, channel), resolver);
grpc_client_channel_set_resolver (&exec_ctx, grpc_channel_get_channel_stack (channel), resolver);
GRPC_RESOLVER_UNREF (&exec_ctx, resolver, "create");
grpc_subchannel_factory_unref (&exec_ctx, &f->base);
GRPC_SECURITY_CONNECTOR_UNREF (&connector->base, "channel_create");

@ -752,7 +752,7 @@ channel_connectivity_changed (grpc_exec_ctx * exec_ctx, void *cd, int iomgr_stat
grpc_transport_op op;
memset (&op, 0, sizeof (op));
op.on_connectivity_state_change = &chand->channel_connectivity_changed, op.connectivity_state = &chand->connectivity_state;
grpc_channel_next_op (grpc_channel_stack_element (grpc_channel_get_channel_stack (exec_ctx, chand->channel), 0), &op);
grpc_channel_next_op (exec_ctx, grpc_channel_stack_element (grpc_channel_get_channel_stack (chand->channel), 0), &op);
}
else
{
@ -1124,7 +1124,7 @@ grpc_server_shutdown_and_notify (grpc_server * server, grpc_completion_queue * c
grpc_cq_begin_op (cq);
if (server->shutdown_published)
{
grpc_cq_end_op (cq, tag, 1, done_published_shutdown, NULL, gpr_malloc (sizeof (&exec_ctx, grpc_cq_completion)));
grpc_cq_end_op (&exec_ctx, cq, tag, 1, done_published_shutdown, NULL, gpr_malloc (sizeof (grpc_cq_completion)));
gpr_mu_unlock (&server->mu_global);
goto done;
}
@ -1202,7 +1202,7 @@ grpc_server_destroy (grpc_server * server)
}
void
grpc_server_add_listener (grpc_server * server, void *arg, void (*start) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t pollset_count), void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_closure * on_done, grpc_closure_list * closure_list))
grpc_server_add_listener (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, void (*start) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t pollset_count), void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_closure * on_done))
{
listener *l = gpr_malloc (sizeof (listener));
l->arg = arg;
@ -1402,7 +1402,7 @@ begin_call (grpc_exec_ctx * exec_ctx, grpc_server * server, call_data * calld, r
}
GRPC_CALL_INTERNAL_REF (calld->call, "server");
grpc_call_start_ioreq_and_call_back (calld->call, req, (size_t) (exec_ctx, r - req), publish, rc);
grpc_call_start_ioreq_and_call_back (exec_ctx, calld->call, req, (size_t) (r - req), publish, rc);
}
static void

@ -43,7 +43,7 @@ grpc_server *grpc_server_create_from_filters (const grpc_channel_filter ** filte
/* Add a listener to the server: when the server starts, it will call start,
and when it shuts down, it will call destroy */
void grpc_server_add_listener (grpc_server * server, void *listener, void (*start) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t npollsets), void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_closure * on_done, grpc_closure_list * closure_list));
void grpc_server_add_listener (grpc_exec_ctx * exec_ctx, grpc_server * server, void *listener, void (*start) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_pollset ** pollsets, size_t npollsets), void (*destroy) (grpc_exec_ctx * exec_ctx, grpc_server * server, void *arg, grpc_closure * on_done));
/* Setup a transport - creates a channel stack, binds the transport to the
server */

@ -48,7 +48,7 @@ setup_transport (grpc_exec_ctx * exec_ctx, void *server, grpc_transport * transp
static grpc_channel_filter const *extra_filters[] = {
&grpc_http_server_filter
};
grpc_server_setup_transport (server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (exec_ctx, server));
grpc_server_setup_transport (exec_ctx, server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (server));
}
static void
@ -62,7 +62,7 @@ new_transport (grpc_exec_ctx * exec_ctx, void *server, grpc_endpoint * tcp)
* case.
*/
grpc_mdctx *mdctx = grpc_mdctx_create ();
grpc_transport *transport = grpc_create_chttp2_transport (grpc_server_get_channel_args (exec_ctx, server), tcp, mdctx, 0);
grpc_transport *transport = grpc_create_chttp2_transport (exec_ctx, grpc_server_get_channel_args (server), tcp, mdctx, 0);
setup_transport (exec_ctx, server, transport, mdctx);
grpc_chttp2_transport_start_reading (exec_ctx, transport, NULL, 0);
}
@ -146,7 +146,7 @@ error:
}
if (tcp)
{
grpc_tcp_server_destroy (tcp, NULL, NULL);
grpc_tcp_server_destroy (&exec_ctx, tcp, NULL);
}
port_num = 0;

@ -36,8 +36,6 @@
#include <grpc/grpc.h>
const char *
grpc_version_string (void)
{
return "0.11.0.0";
const char *grpc_version_string(void) {
return "0.11.0.0";
}

@ -119,7 +119,7 @@ grpc_chttp2_publish_reads (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_globa
published later */
if (transport_parsing->goaway_received)
{
grpc_chttp2_add_incoming_goaway (transport_global, (exec_ctx, gpr_uint32) transport_parsing->goaway_error, transport_parsing->goaway_text);
grpc_chttp2_add_incoming_goaway (exec_ctx,transport_global, ( gpr_uint32) transport_parsing->goaway_error, transport_parsing->goaway_text);
transport_parsing->goaway_text = gpr_empty_slice ();
transport_parsing->goaway_received = 0;
}
@ -339,7 +339,7 @@ grpc_chttp2_perform_read (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_parsin
}
if (transport_parsing->incoming_frame_size == 0)
{
if (!parse_frame_slice (transport_parsing, gpr_empty_slice (exec_ctx, ), 1))
if (!parse_frame_slice (exec_ctx, transport_parsing, gpr_empty_slice (), 1))
{
return 0;
}
@ -360,7 +360,7 @@ grpc_chttp2_perform_read (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_parsin
GPR_ASSERT (cur < end);
if ((gpr_uint32) (end - cur) == transport_parsing->incoming_frame_size)
{
if (!parse_frame_slice (transport_parsing, gpr_slice_sub_no_ref (slice, (size_t) (cur - beg), (size_t) (exec_ctx, end - beg)), 1))
if (!parse_frame_slice (exec_ctx, transport_parsing, gpr_slice_sub_no_ref (slice, (size_t) (cur - beg), (size_t) (end - beg)), 1))
{
return 0;
}
@ -371,7 +371,7 @@ grpc_chttp2_perform_read (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_parsin
else if ((gpr_uint32) (end - cur) > transport_parsing->incoming_frame_size)
{
size_t cur_offset = (size_t) (cur - beg);
if (!parse_frame_slice (transport_parsing, gpr_slice_sub_no_ref (exec_ctx, slice, cur_offset, cur_offset + transport_parsing->incoming_frame_size), 1))
if (!parse_frame_slice (exec_ctx, transport_parsing, gpr_slice_sub_no_ref (slice, cur_offset, cur_offset + transport_parsing->incoming_frame_size), 1))
{
return 0;
}
@ -381,7 +381,7 @@ grpc_chttp2_perform_read (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_parsin
}
else
{
if (!parse_frame_slice (transport_parsing, gpr_slice_sub_no_ref (slice, (size_t) (cur - beg), (size_t) (exec_ctx, end - beg)), 0))
if (!parse_frame_slice (exec_ctx, transport_parsing, gpr_slice_sub_no_ref (slice, (size_t) (cur - beg), (size_t) (end - beg)), 0))
{
return 0;
}

@ -171,9 +171,9 @@ destruct_transport (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t)
#ifdef REFCOUNTING_DEBUG
#define REF_TRANSPORT(t, r) ref_transport(t, r, __FILE__, __LINE__)
#define UNREF_TRANSPORT(t, r, cl) unref_transport(t, cl, r, __FILE__, __LINE__)
#define UNREF_TRANSPORT(cl, t, r) unref_transport(cl, t, r, __FILE__, __LINE__)
static void
unref_transport (grpc_chttp2_transport * t, grpc_closure_list * closure_list, const char *reason, const char *file, int line)
unref_transport (grpc_exec_ctx *exec_ctx, grpc_chttp2_transport * t, const char *reason, const char *file, int line)
{
gpr_log (GPR_DEBUG, "chttp2:unref:%p %d->%d %s [%s:%d]", t, t->refs.count, t->refs.count - 1, reason, file, line);
if (!gpr_unref (&t->refs))
@ -189,7 +189,7 @@ ref_transport (grpc_chttp2_transport * t, const char *reason, const char *file,
}
#else
#define REF_TRANSPORT(t, r) ref_transport(t)
#define UNREF_TRANSPORT(t, r, cl) unref_transport(t, cl)
#define UNREF_TRANSPORT(cl, t, r) unref_transport(cl, t)
static void
unref_transport (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport * t)
{
@ -704,7 +704,7 @@ perform_stream_op_locked (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global
if (op->bind_pollset)
{
add_to_pollset_locked (TRANSPORT_FROM_GLOBAL (exec_ctx, transport_global), op->bind_pollset);
add_to_pollset_locked (exec_ctx,TRANSPORT_FROM_GLOBAL ( transport_global), op->bind_pollset);
}
grpc_exec_ctx_enqueue (exec_ctx, op->on_consumed, 1);
@ -1179,7 +1179,7 @@ static void
connectivity_state_set (grpc_exec_ctx * exec_ctx, grpc_chttp2_transport_global * transport_global, grpc_connectivity_state state, const char *reason)
{
GRPC_CHTTP2_IF_TRACING (gpr_log (GPR_DEBUG, "set connectivity_state=%d", state));
grpc_connectivity_state_set (&TRANSPORT_FROM_GLOBAL (exec_ctx, transport_global)->channel_callback.state_tracker, state, reason);
grpc_connectivity_state_set (exec_ctx,&TRANSPORT_FROM_GLOBAL ( transport_global)->channel_callback.state_tracker, state, reason);
}
/*

@ -77,7 +77,7 @@ server_setup_transport (void *ts, grpc_transport * transport, grpc_mdctx * mdctx
&grpc_http_server_filter
};
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_server_setup_transport (a->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (&exec_ctx, a->server));
grpc_server_setup_transport (&exec_ctx, a->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (a->server));
grpc_exec_ctx_finish (&exec_ctx);
}
@ -122,8 +122,8 @@ grpc_run_bad_client_test (grpc_bad_client_server_side_validator validator, const
grpc_exec_ctx_finish (&exec_ctx);
/* Bind everything into the same pollset */
grpc_endpoint_add_to_pollset (sfd.client, grpc_cq_pollset (&exec_ctx, a.cq));
grpc_endpoint_add_to_pollset (sfd.server, grpc_cq_pollset (&exec_ctx, a.cq));
grpc_endpoint_add_to_pollset (&exec_ctx, sfd.client, grpc_cq_pollset (a.cq));
grpc_endpoint_add_to_pollset (&exec_ctx, sfd.server, grpc_cq_pollset (a.cq));
/* Check a ground truth */
GPR_ASSERT (grpc_server_has_open_connections (a.server));

@ -65,7 +65,7 @@ server_setup_transport (void *ts, grpc_transport * transport, grpc_mdctx * mdctx
&grpc_http_server_filter
};
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_server_setup_transport (f->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (&exec_ctx, f->server));
grpc_server_setup_transport (&exec_ctx, f->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (f->server));
grpc_exec_ctx_finish (&exec_ctx);
}
@ -85,8 +85,8 @@ client_setup_transport (grpc_exec_ctx * exec_ctx, void *ts, grpc_transport * tra
&grpc_connected_channel_filter
};
size_t nfilters = sizeof (filters) / sizeof (*filters);
grpc_channel *channel = grpc_channel_create_from_filters ("socketpair-target", filters, nfilters,
cs->client_args, mdctx, 1, closure_list);
grpc_channel *channel = grpc_channel_create_from_filters (exec_ctx, "socketpair-target", filters, nfilters,
cs->client_args, mdctx, 1);
cs->f->client = channel;

@ -64,7 +64,7 @@ server_setup_transport (void *ts, grpc_transport * transport, grpc_mdctx * mdctx
&grpc_http_server_filter
};
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_server_setup_transport (f->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (&exec_ctx, f->server));
grpc_server_setup_transport (&exec_ctx, f->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (f->server));
grpc_exec_ctx_finish (&exec_ctx);
}
@ -84,8 +84,8 @@ client_setup_transport (grpc_exec_ctx * exec_ctx, void *ts, grpc_transport * tra
&grpc_connected_channel_filter
};
size_t nfilters = sizeof (filters) / sizeof (*filters);
grpc_channel *channel = grpc_channel_create_from_filters ("socketpair-target", filters, nfilters,
cs->client_args, mdctx, 1, closure_list);
grpc_channel *channel = grpc_channel_create_from_filters (exec_ctx,"socketpair-target", filters, nfilters,
cs->client_args, mdctx, 1);
cs->f->client = channel;

@ -64,7 +64,7 @@ server_setup_transport (void *ts, grpc_transport * transport, grpc_mdctx * mdctx
&grpc_http_server_filter
};
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_server_setup_transport (f->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (&exec_ctx, f->server));
grpc_server_setup_transport (&exec_ctx, f->server, transport, extra_filters, GPR_ARRAY_SIZE (extra_filters), mdctx, grpc_server_get_channel_args (f->server));
grpc_exec_ctx_finish (&exec_ctx);
}
@ -84,8 +84,8 @@ client_setup_transport (grpc_exec_ctx * exec_ctx, void *ts, grpc_transport * tra
&grpc_connected_channel_filter
};
size_t nfilters = sizeof (filters) / sizeof (*filters);
grpc_channel *channel = grpc_channel_create_from_filters ("socketpair-target", filters, nfilters,
cs->client_args, mdctx, 1, closure_list);
grpc_channel *channel = grpc_channel_create_from_filters (exec_ctx, "socketpair-target", filters, nfilters,
cs->client_args, mdctx, 1);
cs->f->client = channel;

@ -63,17 +63,17 @@ add_test (void)
/* 10 ms alarms. will expire in the current epoch */
for (i = 0; i < 10; i++)
{
grpc_alarm_init (&alarms[i], gpr_time_add (start, gpr_time_from_millis (10, GPR_TIMESPAN)), cb, (void *) (&exec_ctx, gpr_intptr) i, start);
grpc_alarm_init (&exec_ctx, &alarms[i], gpr_time_add (start, gpr_time_from_millis (10, GPR_TIMESPAN)), cb, (void *) (gpr_intptr) i, start);
}
/* 1010 ms alarms. will expire in the next epoch */
for (i = 10; i < 20; i++)
{
grpc_alarm_init (&alarms[i], gpr_time_add (start, gpr_time_from_millis (1010, GPR_TIMESPAN)), cb, (void *) (&exec_ctx, gpr_intptr) i, start);
grpc_alarm_init (&exec_ctx, &alarms[i], gpr_time_add (start, gpr_time_from_millis (1010, GPR_TIMESPAN)), cb, (void *) (gpr_intptr) i, start);
}
/* collect alarms. Only the first batch should be ready. */
GPR_ASSERT (10 == grpc_alarm_check (gpr_time_add (start, gpr_time_from_millis (&exec_ctx, 500, GPR_TIMESPAN)), NULL));
GPR_ASSERT (10 == grpc_alarm_check (&exec_ctx, gpr_time_add (start, gpr_time_from_millis (500, GPR_TIMESPAN)), NULL));
grpc_exec_ctx_finish (&exec_ctx);
for (i = 0; i < 20; i++)
{
@ -81,7 +81,7 @@ add_test (void)
GPR_ASSERT (cb_called[i][0] == 0);
}
GPR_ASSERT (0 == grpc_alarm_check (gpr_time_add (start, gpr_time_from_millis (&exec_ctx, 600, GPR_TIMESPAN)), NULL));
GPR_ASSERT (0 == grpc_alarm_check (&exec_ctx, gpr_time_add (start, gpr_time_from_millis (600, GPR_TIMESPAN)), NULL));
grpc_exec_ctx_finish (&exec_ctx);
for (i = 0; i < 30; i++)
{
@ -90,7 +90,7 @@ add_test (void)
}
/* collect the rest of the alarms */
GPR_ASSERT (10 == grpc_alarm_check (gpr_time_add (start, gpr_time_from_millis (&exec_ctx, 1500, GPR_TIMESPAN)), NULL));
GPR_ASSERT (10 == grpc_alarm_check (&exec_ctx, gpr_time_add (start, gpr_time_from_millis (1500, GPR_TIMESPAN)), NULL));
grpc_exec_ctx_finish (&exec_ctx);
for (i = 0; i < 30; i++)
{
@ -98,14 +98,14 @@ add_test (void)
GPR_ASSERT (cb_called[i][0] == 0);
}
GPR_ASSERT (0 == grpc_alarm_check (gpr_time_add (start, gpr_time_from_millis (&exec_ctx, 1600, GPR_TIMESPAN)), NULL));
GPR_ASSERT (0 == grpc_alarm_check (&exec_ctx, gpr_time_add (start, gpr_time_from_millis (1600, GPR_TIMESPAN)), NULL));
for (i = 0; i < 30; i++)
{
GPR_ASSERT (cb_called[i][1] == (i < 20));
GPR_ASSERT (cb_called[i][0] == 0);
}
grpc_alarm_list_shutdown (&closure_list);
grpc_alarm_list_shutdown (&exec_ctx);
grpc_exec_ctx_finish (&exec_ctx);
}
@ -127,12 +127,12 @@ destruction_test (void)
grpc_alarm_list_init (gpr_time_0 (GPR_CLOCK_REALTIME));
memset (cb_called, 0, sizeof (cb_called));
grpc_alarm_init (&alarms[0], tfm (100), cb, (void *) (gpr_intptr) 0, gpr_time_0 (&exec_ctx, GPR_CLOCK_REALTIME));
grpc_alarm_init (&alarms[1], tfm (3), cb, (void *) (gpr_intptr) 1, gpr_time_0 (&exec_ctx, GPR_CLOCK_REALTIME));
grpc_alarm_init (&alarms[2], tfm (100), cb, (void *) (gpr_intptr) 2, gpr_time_0 (&exec_ctx, GPR_CLOCK_REALTIME));
grpc_alarm_init (&alarms[3], tfm (3), cb, (void *) (gpr_intptr) 3, gpr_time_0 (&exec_ctx, GPR_CLOCK_REALTIME));
grpc_alarm_init (&alarms[4], tfm (1), cb, (void *) (gpr_intptr) 4, gpr_time_0 (&exec_ctx, GPR_CLOCK_REALTIME));
GPR_ASSERT (1 == grpc_alarm_check (tfm (&exec_ctx, 2), NULL));
grpc_alarm_init (&exec_ctx, &alarms[0], tfm (100), cb, (void *) (gpr_intptr) 0, gpr_time_0 (GPR_CLOCK_REALTIME));
grpc_alarm_init (&exec_ctx, &alarms[1], tfm (3), cb, (void *) (gpr_intptr) 1, gpr_time_0 (GPR_CLOCK_REALTIME));
grpc_alarm_init (&exec_ctx, &alarms[2], tfm (100), cb, (void *) (gpr_intptr) 2, gpr_time_0 (GPR_CLOCK_REALTIME));
grpc_alarm_init (&exec_ctx, &alarms[3], tfm (3), cb, (void *) (gpr_intptr) 3, gpr_time_0 (GPR_CLOCK_REALTIME));
grpc_alarm_init (&exec_ctx, &alarms[4], tfm (1), cb, (void *) (gpr_intptr) 4, gpr_time_0 (GPR_CLOCK_REALTIME));
GPR_ASSERT (1 == grpc_alarm_check (&exec_ctx,tfm ( 2), NULL));
grpc_exec_ctx_finish (&exec_ctx);
GPR_ASSERT (1 == cb_called[4][1]);
grpc_alarm_cancel (&exec_ctx, &alarms[0]);
@ -141,7 +141,7 @@ destruction_test (void)
GPR_ASSERT (1 == cb_called[0][0]);
GPR_ASSERT (1 == cb_called[3][0]);
grpc_alarm_list_shutdown (&closure_list);
grpc_alarm_list_shutdown (&exec_ctx);
grpc_exec_ctx_finish (&exec_ctx);
GPR_ASSERT (1 == cb_called[1][0]);
GPR_ASSERT (1 == cb_called[2][0]);

@ -250,7 +250,7 @@ read_and_write_test (grpc_endpoint_test_config config, size_t num_bytes, size_t
{
grpc_pollset_worker worker;
GPR_ASSERT (gpr_time_cmp (gpr_now (GPR_CLOCK_MONOTONIC), deadline) < 0);
grpc_pollset_work (g_pollset, &worker, gpr_now (&exec_ctx, GPR_CLOCK_MONOTONIC), deadline);
grpc_pollset_work (&exec_ctx, g_pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), deadline);
}
gpr_mu_unlock (GRPC_POLLSET_MU (g_pollset));
grpc_exec_ctx_finish (&exec_ctx);

@ -100,7 +100,7 @@ grpc_test_fetch_oauth2_token_with_credentials (grpc_credentials * creds)
while (!request.is_done)
{
grpc_pollset_worker worker;
grpc_pollset_work (&request.pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), gpr_inf_future (&exec_ctx, GPR_CLOCK_MONOTONIC));
grpc_pollset_work (&exec_ctx, &request.pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), gpr_inf_future (GPR_CLOCK_MONOTONIC));
}
gpr_mu_unlock (GRPC_POLLSET_MU (&request.pollset));

@ -116,12 +116,12 @@ free_port_using_server (char *server, int port)
req.path = path;
grpc_httpcli_context_init (&context);
grpc_httpcli_get (&context, &pr.pollset, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE (&exec_ctx, 10), freed_port_from_server, &pr);
grpc_httpcli_get (&exec_ctx, &context, &pr.pollset, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE (10), freed_port_from_server, &pr);
gpr_mu_lock (GRPC_POLLSET_MU (&pr.pollset));
while (!pr.done)
{
grpc_pollset_worker worker;
grpc_pollset_work (&pr.pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), GRPC_TIMEOUT_SECONDS_TO_DEADLINE (&exec_ctx, 1));
grpc_pollset_work (&exec_ctx, &pr.pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), GRPC_TIMEOUT_SECONDS_TO_DEADLINE (1));
}
gpr_mu_unlock (GRPC_POLLSET_MU (&pr.pollset));
@ -247,7 +247,7 @@ got_port_from_server (grpc_exec_ctx * exec_ctx, void *arg, const grpc_httpcli_re
req.path = "/get";
gpr_log (GPR_DEBUG, "failed port pick from server: retrying");
sleep (1);
grpc_httpcli_get (pr->ctx, &pr->pollset, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE (exec_ctx, 10), got_port_from_server, pr);
grpc_httpcli_get (exec_ctx, pr->ctx, &pr->pollset, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE (10), got_port_from_server, pr);
return;
}
GPR_ASSERT (response);
@ -287,13 +287,13 @@ pick_port_using_server (char *server)
req.path = "/get";
grpc_httpcli_context_init (&context);
grpc_httpcli_get (&context, &pr.pollset, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE (&exec_ctx, 10), got_port_from_server, &pr);
grpc_httpcli_get (&exec_ctx, &context, &pr.pollset, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE (10), got_port_from_server, &pr);
grpc_exec_ctx_finish (&exec_ctx);
gpr_mu_lock (GRPC_POLLSET_MU (&pr.pollset));
while (pr.port == -1)
{
grpc_pollset_worker worker;
grpc_pollset_work (&pr.pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), GRPC_TIMEOUT_SECONDS_TO_DEADLINE (&exec_ctx, 1));
grpc_pollset_work (&exec_ctx, &pr.pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), GRPC_TIMEOUT_SECONDS_TO_DEADLINE (1));
}
gpr_mu_unlock (GRPC_POLLSET_MU (&pr.pollset));

@ -154,7 +154,7 @@ reconnect_server_poll (reconnect_server * server, int seconds)
gpr_time_from_seconds (seconds, GPR_TIMESPAN));
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
gpr_mu_lock (GRPC_POLLSET_MU (&server->pollset));
grpc_pollset_work (&server->pollset, &worker, gpr_now (&exec_ctx, GPR_CLOCK_MONOTONIC), deadline);
grpc_pollset_work (&exec_ctx, &server->pollset, &worker, gpr_now (GPR_CLOCK_MONOTONIC), deadline);
gpr_mu_unlock (GRPC_POLLSET_MU (&server->pollset));
grpc_exec_ctx_finish (&exec_ctx);
}

@ -952,6 +952,7 @@ src/core/iomgr/closure.c \
src/core/iomgr/endpoint.c \
src/core/iomgr/endpoint_pair_posix.c \
src/core/iomgr/endpoint_pair_windows.c \
src/core/iomgr/exec_ctx.c \
src/core/iomgr/fd_posix.c \
src/core/iomgr/iocp_windows.c \
src/core/iomgr/iomgr.c \

@ -12494,6 +12494,7 @@
"src/core/iomgr/endpoint_pair.h",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/fd_posix.c",
"src/core/iomgr/fd_posix.h",
@ -12981,6 +12982,7 @@
"src/core/iomgr/endpoint_pair.h",
"src/core/iomgr/endpoint_pair_posix.c",
"src/core/iomgr/endpoint_pair_windows.c",
"src/core/iomgr/exec_ctx.c",
"src/core/iomgr/exec_ctx.h",
"src/core/iomgr/fd_posix.c",
"src/core/iomgr/fd_posix.h",

@ -476,6 +476,8 @@
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\endpoint_pair_windows.c">
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\exec_ctx.c">
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\fd_posix.c">
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\iocp_windows.c">

@ -181,6 +181,9 @@
<ClCompile Include="..\..\..\src\core\iomgr\endpoint_pair_windows.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\exec_ctx.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\fd_posix.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>

@ -415,6 +415,8 @@
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\endpoint_pair_windows.c">
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\exec_ctx.c">
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\fd_posix.c">
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\iocp_windows.c">

@ -121,6 +121,9 @@
<ClCompile Include="..\..\..\src\core\iomgr\endpoint_pair_windows.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\exec_ctx.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\core\iomgr\fd_posix.c">
<Filter>src\core\iomgr</Filter>
</ClCompile>

Loading…
Cancel
Save