diff options
author | Mark D. Roth <roth@google.com> | 2016-10-07 10:08:07 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-10-07 10:08:07 -0700 |
commit | 5f1c4b58a8fa36c8d2334ee8d50ffadcb600e5fc (patch) | |
tree | 42b29a5d5c8f29a94dd0168ed981e1a554dedac1 /src | |
parent | 499b0121032a2c04299c2c5eaa75a83cd06d5b99 (diff) | |
parent | 9efab2176a541a61546230ac64be305f3b810bed (diff) |
Merge remote-tracking branch 'upstream/master' into service_config
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ext/client_config/lb_policy.h | 21 | ||||
-rw-r--r-- | src/core/ext/lb_policy/grpclb/grpclb.c | 2 | ||||
-rw-r--r-- | src/core/ext/transport/cronet/transport/cronet_transport.c | 2 |
3 files changed, 14 insertions, 11 deletions
diff --git a/src/core/ext/client_config/lb_policy.h b/src/core/ext/client_config/lb_policy.h index 6cc3e1ebd3..110d08fcac 100644 --- a/src/core/ext/client_config/lb_policy.h +++ b/src/core/ext/client_config/lb_policy.h @@ -142,15 +142,18 @@ void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy); void grpc_lb_policy_init(grpc_lb_policy *policy, const grpc_lb_policy_vtable *vtable); -/** Find an appropriate target for this call, based on \a pick_args. - Picking can be synchronous or asynchronous. In the synchronous case, when a - pick is readily available, it'll be returned in \a target and a non-zero - value will be returned. - In the asynchronous case, zero is returned and \a on_complete will be called - once \a target and \a user_data have been set. Any IO should be done under - \a pick_args->pollent. The opaque \a user_data output argument corresponds - to information that may need be propagated from the LB policy. It may be - NULL. Errors are signaled by receiving a NULL \a *target. */ +/** Finds an appropriate subchannel for a call, based on \a pick_args. + + \a target will be set to the selected subchannel, or NULL on failure. + Upon success, \a user_data will be set to whatever opaque information + may need to be propagated from the LB policy, or NULL if not needed. + + If the pick succeeds and a result is known immediately, a non-zero + value will be returned. Otherwise, \a on_complete will be invoked + once the pick is complete with its error argument set to indicate + success or failure. + + Any I/O should be done under \a pick_args->pollent. */ int grpc_lb_policy_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, const grpc_lb_policy_pick_args *pick_args, grpc_connected_subchannel **target, void **user_data, diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index 0acc9c6058..a50c632bd7 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -766,7 +766,7 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, GRPC_ERROR_CREATE("No mdelem storage for the LB token. Load reporting " "won't work without it. Failing"), NULL); - return 1; + return 0; } glb_lb_policy *glb_policy = (glb_lb_policy *)pol; diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 00a5be419e..25ad40b935 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -543,7 +543,7 @@ static void create_grpc_frame(gpr_slice_buffer *write_slice_buffer, static void convert_metadata_to_cronet_headers( grpc_linked_mdelem *head, const char *host, char **pp_url, cronet_bidirectional_stream_header **pp_headers, size_t *p_num_headers, - const char ** method) { + const char **method) { grpc_linked_mdelem *curr = head; /* Walk the linked list and get number of header fields */ size_t num_headers_available = 0; |