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
64f1f8d0
Commit
64f1f8d0
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
clang-format
parent
bfbfca43
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/ext/client_config/lb_policy_factory.h
+5
-5
5 additions, 5 deletions
src/core/ext/client_config/lb_policy_factory.h
src/core/ext/lb_policy/grpclb/grpclb.c
+5
-5
5 additions, 5 deletions
src/core/ext/lb_policy/grpclb/grpclb.c
with
10 additions
and
10 deletions
src/core/ext/client_config/lb_policy_factory.h
+
5
−
5
View file @
64f1f8d0
...
@@ -55,7 +55,7 @@ struct grpc_lb_policy_factory {
...
@@ -55,7 +55,7 @@ struct grpc_lb_policy_factory {
typedef
struct
grpc_lb_address
{
typedef
struct
grpc_lb_address
{
grpc_resolved_address
address
;
grpc_resolved_address
address
;
bool
is_balancer
;
bool
is_balancer
;
char
*
balancer_name
;
/* For secure naming. */
char
*
balancer_name
;
/* For secure naming. */
void
*
user_data
;
void
*
user_data
;
}
grpc_lb_address
;
}
grpc_lb_address
;
...
@@ -66,20 +66,20 @@ typedef struct grpc_lb_addresses {
...
@@ -66,20 +66,20 @@ typedef struct grpc_lb_addresses {
/** Returns a grpc_addresses struct with enough space for
/** Returns a grpc_addresses struct with enough space for
* \a num_addresses addresses. */
* \a num_addresses addresses. */
grpc_lb_addresses
*
grpc_lb_addresses_create
(
size_t
num_addresses
);
grpc_lb_addresses
*
grpc_lb_addresses_create
(
size_t
num_addresses
);
/** Sets the value of the address at index \a index of \a addresses.
/** Sets the value of the address at index \a index of \a addresses.
* \a address is a socket address of length \a address_len.
* \a address is a socket address of length \a address_len.
* Takes ownership of \a balancer_name. */
* Takes ownership of \a balancer_name. */
void
grpc_lb_addresses_set_address
(
grpc_lb_addresses
*
addresses
,
size_t
index
,
void
grpc_lb_addresses_set_address
(
grpc_lb_addresses
*
addresses
,
size_t
index
,
void
*
address
,
size_t
address_len
,
void
*
address
,
size_t
address_len
,
bool
is_balancer
,
char
*
balancer_name
,
bool
is_balancer
,
char
*
balancer_name
,
void
*
user_data
);
void
*
user_data
);
/** Destroys \a addresses. If \a user_data_destroy is not NULL, it will
/** Destroys \a addresses. If \a user_data_destroy is not NULL, it will
* be invoked to destroy the \a user_data field of each address. */
* be invoked to destroy the \a user_data field of each address. */
void
grpc_lb_addresses_destroy
(
grpc_lb_addresses
*
addresses
,
void
grpc_lb_addresses_destroy
(
grpc_lb_addresses
*
addresses
,
void
(
*
user_data_destroy
)(
void
*
));
void
(
*
user_data_destroy
)(
void
*
));
/** Arguments passed to LB policies. */
/** Arguments passed to LB policies. */
typedef
struct
grpc_lb_policy_args
{
typedef
struct
grpc_lb_policy_args
{
...
...
This diff is collapsed.
Click to expand it.
src/core/ext/lb_policy/grpclb/grpclb.c
+
5
−
5
View file @
64f1f8d0
...
@@ -353,7 +353,7 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx,
...
@@ -353,7 +353,7 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx,
/* populate \a addresses according to \a serverlist. Returns the number of
/* populate \a addresses according to \a serverlist. Returns the number of
* addresses successfully parsed and added to \a addresses */
* addresses successfully parsed and added to \a addresses */
static
grpc_lb_addresses
*
process_serverlist
(
static
grpc_lb_addresses
*
process_serverlist
(
const
grpc_grpclb_serverlist
*
serverlist
)
{
const
grpc_grpclb_serverlist
*
serverlist
)
{
size_t
num_valid
=
0
;
size_t
num_valid
=
0
;
/* first pass: count how many are valid in order to allocate the necessary
/* first pass: count how many are valid in order to allocate the necessary
...
@@ -398,7 +398,7 @@ static grpc_lb_addresses* process_serverlist(
...
@@ -398,7 +398,7 @@ static grpc_lb_addresses* process_serverlist(
}
}
/* lb token processing */
/* lb token processing */
void
*
user_data
;
void
*
user_data
;
if
(
server
->
has_load_balance_token
)
{
if
(
server
->
has_load_balance_token
)
{
const
size_t
lb_token_size
=
const
size_t
lb_token_size
=
GPR_ARRAY_SIZE
(
server
->
load_balance_token
)
-
1
;
GPR_ARRAY_SIZE
(
server
->
load_balance_token
)
-
1
;
...
@@ -414,8 +414,8 @@ static grpc_lb_addresses* process_serverlist(
...
@@ -414,8 +414,8 @@ static grpc_lb_addresses* process_serverlist(
user_data
=
GRPC_MDELEM_LOAD_REPORTING_INITIAL_EMPTY
;
user_data
=
GRPC_MDELEM_LOAD_REPORTING_INITIAL_EMPTY
;
}
}
grpc_lb_addresses_set_address
(
lb_addresses
,
addr_idx
,
&
addr
.
addr
,
grpc_lb_addresses_set_address
(
lb_addresses
,
addr_idx
,
&
addr
.
addr
,
addr
.
len
,
addr
.
len
,
false
/* is_balancer */
,
false
/* is_balancer */
,
NULL
/* balancer_name */
,
user_data
);
NULL
/* balancer_name */
,
user_data
);
++
addr_idx
;
++
addr_idx
;
}
}
...
@@ -424,7 +424,7 @@ static grpc_lb_addresses* process_serverlist(
...
@@ -424,7 +424,7 @@ static grpc_lb_addresses* process_serverlist(
return
lb_addresses
;
return
lb_addresses
;
}
}
static
void
lb_token_destroy
(
void
*
token
)
{
static
void
lb_token_destroy
(
void
*
token
)
{
if
(
token
!=
NULL
)
GRPC_MDELEM_UNREF
(
token
);
if
(
token
!=
NULL
)
GRPC_MDELEM_UNREF
(
token
);
}
}
...
...
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