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
8b4a70e3
Commit
8b4a70e3
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
Fix Windows build problem.
parent
2623728c
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/client_config/method_config.c
+8
-3
8 additions, 3 deletions
src/core/ext/client_config/method_config.c
with
8 additions
and
3 deletions
src/core/ext/client_config/method_config.c
+
8
−
3
View file @
8b4a70e3
...
@@ -222,13 +222,17 @@ static const grpc_hash_table_vtable method_config_table_vtable = {
...
@@ -222,13 +222,17 @@ static const grpc_hash_table_vtable method_config_table_vtable = {
grpc_method_config_table
*
grpc_method_config_table_create
(
grpc_method_config_table
*
grpc_method_config_table_create
(
size_t
num_entries
,
grpc_method_config_table_entry
*
entries
)
{
size_t
num_entries
,
grpc_method_config_table_entry
*
entries
)
{
grpc_hash_table_entry
hash_table_entries
[
num_entries
];
grpc_hash_table_entry
*
hash_table_entries
=
gpr_malloc
(
sizeof
(
grpc_hash_table_entry
)
*
num_entries
);
for
(
size_t
i
=
0
;
i
<
num_entries
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
num_entries
;
++
i
)
{
hash_table_entries
[
i
].
key
=
entries
[
i
].
method_name
;
hash_table_entries
[
i
].
key
=
entries
[
i
].
method_name
;
hash_table_entries
[
i
].
value
=
entries
[
i
].
method_config
;
hash_table_entries
[
i
].
value
=
entries
[
i
].
method_config
;
hash_table_entries
[
i
].
vtable
=
&
method_config_table_vtable
;
hash_table_entries
[
i
].
vtable
=
&
method_config_table_vtable
;
}
}
return
grpc_hash_table_create
(
num_entries
,
hash_table_entries
);
grpc_method_config_table
*
method_config_table
=
grpc_hash_table_create
(
num_entries
,
hash_table_entries
);
gpr_free
(
hash_table_entries
);
return
method_config_table
;
}
}
grpc_method_config_table
*
grpc_method_config_table_ref
(
grpc_method_config_table
*
grpc_method_config_table_ref
(
...
@@ -254,11 +258,12 @@ grpc_method_config* grpc_method_config_table_get_method_config(
...
@@ -254,11 +258,12 @@ grpc_method_config* grpc_method_config_table_get_method_config(
const
char
*
path_str
=
grpc_mdstr_as_c_string
(
path
);
const
char
*
path_str
=
grpc_mdstr_as_c_string
(
path
);
const
char
*
sep
=
strrchr
(
path_str
,
'/'
)
+
1
;
const
char
*
sep
=
strrchr
(
path_str
,
'/'
)
+
1
;
const
size_t
len
=
(
size_t
)(
sep
-
path_str
);
const
size_t
len
=
(
size_t
)(
sep
-
path_str
);
char
buf
[
len
+
2
]
;
// '*' and NUL
char
*
buf
=
gpr_malloc
(
len
+
2
)
;
// '*' and NUL
memcpy
(
buf
,
path_str
,
len
);
memcpy
(
buf
,
path_str
,
len
);
buf
[
len
]
=
'*'
;
buf
[
len
]
=
'*'
;
buf
[
len
+
1
]
=
'\0'
;
buf
[
len
+
1
]
=
'\0'
;
grpc_mdstr
*
wildcard_path
=
grpc_mdstr_from_string
(
buf
);
grpc_mdstr
*
wildcard_path
=
grpc_mdstr_from_string
(
buf
);
gpr_free
(
buf
);
method_config
=
grpc_hash_table_get
(
table
,
wildcard_path
);
method_config
=
grpc_hash_table_get
(
table
,
wildcard_path
);
GRPC_MDSTR_UNREF
(
wildcard_path
);
GRPC_MDSTR_UNREF
(
wildcard_path
);
}
}
...
...
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