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
63ed60f0
Commit
63ed60f0
authored
7 years ago
by
Makarand Dharmapurikar
Browse files
Options
Downloads
Patches
Plain Diff
using grpc_base64_decode_with_len to simplify code
parent
7fb4036a
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/lib/channel/http_server_filter.c
+5
-5
5 additions, 5 deletions
src/core/lib/channel/http_server_filter.c
with
5 additions
and
5 deletions
src/core/lib/channel/http_server_filter.c
+
5
−
5
View file @
63ed60f0
...
...
@@ -228,8 +228,6 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
if
(
offset
<
path_length
)
{
grpc_slice
query_slice
=
grpc_slice_sub
(
path_slice
,
offset
+
1
,
path_length
);
/* add a trailing '\0' before decoding */
const
char
*
b64_data
=
grpc_slice_to_c_string
(
query_slice
);
/* substitute path metadata with just the path (not query) */
grpc_mdelem
mdelem_path_without_query
=
grpc_mdelem_from_slices
(
...
...
@@ -240,12 +238,14 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
/* decode payload from query and add to the slice buffer to be returned */
const
int
k_url_safe
=
1
;
grpc_slice_buffer_add
(
&
calld
->
read_slice_buffer
,
grpc_base64_decode
(
exec_ctx
,
b64_data
,
k_url_safe
));
grpc_slice_buffer_add
(
&
calld
->
read_slice_buffer
,
grpc_base64_decode_with_len
(
exec_ctx
,
(
const
char
*
)
GRPC_SLICE_START_PTR
(
query_slice
),
GRPC_SLICE_LENGTH
(
query_slice
),
k_url_safe
));
grpc_slice_buffer_stream_init
(
&
calld
->
read_stream
,
&
calld
->
read_slice_buffer
,
0
);
calld
->
seen_path_with_query
=
true
;
gpr_free
((
void
*
)
b64_data
);
grpc_slice_unref_internal
(
exec_ctx
,
query_slice
);
}
else
{
gpr_log
(
GPR_ERROR
,
"GET request without QUERY"
);
...
...
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