Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
2035906c
Commit
2035906c
authored
8 years ago
by
David Garcia Quintas
Browse files
Options
Downloads
Patches
Plain Diff
clang-format
parent
2530a660
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/ext/lb_policy/grpclb/grpclb.c
+27
-27
27 additions, 27 deletions
src/core/ext/lb_policy/grpclb/grpclb.c
with
27 additions
and
27 deletions
src/core/ext/lb_policy/grpclb/grpclb.c
+
27
−
27
View file @
2035906c
...
...
@@ -416,35 +416,35 @@ static void lb_token_destroy(void *token) {
/* perform a pick over \a rr_policy. Given that a pick can return immediately
* (ignoring its completion callback) we need to perform the cleanups this
* callback would be otherwise resposible for */
static
bool
pick_from_internal_rr_locked
(
grpc_exec_ctx
*
exec_ctx
,
grpc_lb_policy
*
rr_policy
,
const
grpc_lb_policy_pick_args
*
pick_args
,
grpc_connected_subchannel
**
t
arg
et
,
wrapped_rr_closure_arg
*
wc_arg
)
{
GPR_ASSERT
(
rr_policy
!=
NULL
);
const
bool
pick_done
=
grpc_lb_policy_pick
(
exec_ctx
,
rr_policy
,
pick_args
,
target
,
(
void
**
)
&
wc_arg
->
lb_token
,
&
wc_arg
->
wrapper_closure
);
if
(
pick_done
)
{
/* synchronous grpc_lb_policy_pick call. Unref the RR policy. */
if
(
grpc_lb_glb_trace
)
{
gpr_log
(
GPR_INFO
,
"Unreffing RR (0x%"
PRIxPTR
")"
,
(
intptr_t
)
wc_arg
->
rr_policy
);
}
GRPC_LB_POLICY_UNREF
(
exec_ctx
,
wc_arg
->
rr_policy
,
"glb_pick"
);
static
bool
pick_from_internal_rr_locked
(
grpc_exec_ctx
*
exec_ctx
,
grpc_lb_policy
*
rr_policy
,
const
grpc_lb_policy_pick_args
*
pick_
arg
s
,
grpc_connected_subchannel
**
target
,
wrapped_rr_closure_arg
*
wc_arg
)
{
GPR_ASSERT
(
rr_policy
!=
NULL
);
const
bool
pick_done
=
grpc_lb_policy_pick
(
exec_ctx
,
rr_policy
,
pick_args
,
target
,
(
void
**
)
&
wc_arg
->
lb_token
,
&
wc_arg
->
wrapper_closure
);
if
(
pick_done
)
{
/* synchronous grpc_lb_policy_pick call. Unref the RR policy. */
if
(
grpc_lb_glb_trace
)
{
gpr_log
(
GPR_INFO
,
"Unreffing RR (0x%"
PRIxPTR
")"
,
(
intptr_t
)
wc_arg
->
rr_policy
);
}
GRPC_LB_POLICY_UNREF
(
exec_ctx
,
wc_arg
->
rr_policy
,
"glb_pick"
);
/* add the load reporting initial metadata */
initial_metadata_add_lb_token
(
pick_args
->
initial_metadata
,
pick_args
->
lb_token_mdelem_storage
,
GRPC_MDELEM_REF
(
wc_arg
->
lb_token
));
/* add the load reporting initial metadata */
initial_metadata_add_lb_token
(
pick_args
->
initial_metadata
,
pick_args
->
lb_token_mdelem_storage
,
GRPC_MDELEM_REF
(
wc_arg
->
lb_token
));
gpr_free
(
wc_arg
);
}
/* else, the pending pick will be registered and taken care of by the
* pending pick list inside the RR policy (glb_policy->rr_policy).
* Eventually, wrapped_on_complete will be called, which will -among other
* things- add the LB token to the call's initial metadata */
gpr_free
(
wc_arg
);
}
/* else, the pending pick will be registered and taken care of by the
* pending pick list inside the RR policy (glb_policy->rr_policy).
* Eventually, wrapped_on_complete will be called, which will -among other
* things- add the LB token to the call's initial metadata */
return
pick_done
;
return
pick_done
;
}
static
grpc_lb_policy
*
create_rr_locked
(
...
...
@@ -810,7 +810,7 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
wc_arg
->
initial_metadata
=
pick_args
->
initial_metadata
;
wc_arg
->
free_when_done
=
wc_arg
;
pick_done
=
pick_from_internal_rr_locked
(
exec_ctx
,
glb_policy
->
rr_policy
,
pick_args
,
target
,
wc_arg
);
pick_args
,
target
,
wc_arg
);
}
else
{
add_pending_pick
(
&
glb_policy
->
pending_picks
,
pick_args
,
target
,
on_complete
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment