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
1a138e96
Commit
1a138e96
authored
7 years ago
by
Muxi Yan
Browse files
Options
Downloads
Patches
Plain Diff
Asan bug fix
parent
5109b38d
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c
+9
-6
9 additions, 6 deletions
...ilters/workarounds/workaround_cronet_compression_filter.c
with
9 additions
and
6 deletions
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c
+
9
−
6
View file @
1a138e96
...
@@ -161,13 +161,14 @@ static bool parse_user_agent(grpc_mdelem md) {
...
@@ -161,13 +161,14 @@ static bool parse_user_agent(grpc_mdelem md) {
char
*
user_agent_str
=
grpc_slice_to_c_string
(
GRPC_MDVALUE
(
md
));
char
*
user_agent_str
=
grpc_slice_to_c_string
(
GRPC_MDVALUE
(
md
));
bool
grpc_objc_specifier_seen
=
false
;
bool
grpc_objc_specifier_seen
=
false
;
bool
cronet_specifier_seen
=
false
;
bool
cronet_specifier_seen
=
false
;
char
*
major_version
=
user_agent_str
,
*
minor_version
;
char
*
major_version_str
=
user_agent_str
,
*
minor_version_str
;
long
major_version
,
minor_version
;
char
*
head
=
strtok
(
user_agent_str
,
" "
);
char
*
head
=
strtok
(
user_agent_str
,
" "
);
while
(
head
!=
NULL
)
{
while
(
head
!=
NULL
)
{
if
(
!
grpc_objc_specifier_seen
&&
if
(
!
grpc_objc_specifier_seen
&&
0
==
strncmp
(
head
,
grpc_objc_specifier
,
grpc_objc_specifier_len
))
{
0
==
strncmp
(
head
,
grpc_objc_specifier
,
grpc_objc_specifier_len
))
{
major_version
=
head
+
grpc_objc_specifier_len
;
major_version
_str
=
head
+
grpc_objc_specifier_len
;
grpc_objc_specifier_seen
=
true
;
grpc_objc_specifier_seen
=
true
;
}
else
if
(
grpc_objc_specifier_seen
&&
}
else
if
(
grpc_objc_specifier_seen
&&
0
==
strncmp
(
head
,
cronet_specifier
,
cronet_specifier_len
))
{
0
==
strncmp
(
head
,
cronet_specifier
,
cronet_specifier_len
))
{
...
@@ -178,14 +179,16 @@ static bool parse_user_agent(grpc_mdelem md) {
...
@@ -178,14 +179,16 @@ static bool parse_user_agent(grpc_mdelem md) {
head
=
strtok
(
NULL
,
" "
);
head
=
strtok
(
NULL
,
" "
);
}
}
if
(
grpc_objc_specifier_seen
)
{
if
(
grpc_objc_specifier_seen
)
{
major_version
=
strtok
(
major_version
,
"."
);
major_version_str
=
strtok
(
major_version_str
,
"."
);
minor_version
=
strtok
(
NULL
,
"."
);
minor_version_str
=
strtok
(
NULL
,
"."
);
major_version
=
atol
(
major_version_str
);
minor_version
=
atol
(
minor_version_str
);
}
}
gpr_free
(
user_agent_str
);
gpr_free
(
user_agent_str
);
return
(
grpc_objc_specifier_seen
&&
cronet_specifier_seen
&&
return
(
grpc_objc_specifier_seen
&&
cronet_specifier_seen
&&
(
atol
(
major_version
)
<
1
||
(
major_version
<
1
||
(
atol
(
major_version
)
==
1
&&
atol
(
minor_version
)
<=
3
)));
(
major_version
==
1
&&
minor_version
<=
3
)));
}
}
const
grpc_channel_filter
grpc_workaround_cronet_compression_filter
=
{
const
grpc_channel_filter
grpc_workaround_cronet_compression_filter
=
{
...
...
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