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
d3c25948
Commit
d3c25948
authored
8 years ago
by
Muxi Yan
Browse files
Options
Downloads
Patches
Plain Diff
Fix test errors on string copy
parent
a36bdc16
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/objective-c/GRPCClient/private/GRPCWrappedCall.m
+9
-5
9 additions, 5 deletions
src/objective-c/GRPCClient/private/GRPCWrappedCall.m
src/objective-c/GRPCClient/private/NSDictionary+GRPC.m
+3
-1
3 additions, 1 deletion
src/objective-c/GRPCClient/private/NSDictionary+GRPC.m
with
12 additions
and
6 deletions
src/objective-c/GRPCClient/private/GRPCWrappedCall.m
+
9
−
5
View file @
d3c25948
...
...
@@ -215,11 +215,15 @@
__weak
typeof
(
self
)
weakSelf
=
self
;
_handler
=
^
{
__strong
typeof
(
self
)
strongSelf
=
weakSelf
;
NSError
*
error
=
[
NSError
grpc_errorFromStatusCode
:
strongSelf
->
_statusCode
details:
(
char
*
)
GRPC_SLICE_START_PTR
(
strongSelf
->
_details
)];
NSDictionary
*
trailers
=
[
NSDictionary
grpc_dictionaryFromMetadataArray:
strongSelf
->
_trailers
];
handler
(
error
,
trailers
);
if
(
strongSelf
)
{
char
*
details
=
grpc_slice_to_c_string
(
strongSelf
->
_details
);
NSError
*
error
=
[
NSError
grpc_errorFromStatusCode
:
strongSelf
->
_statusCode
details:
details
];
NSDictionary
*
trailers
=
[
NSDictionary
grpc_dictionaryFromMetadataArray:
strongSelf
->
_trailers
];
handler
(
error
,
trailers
);
gpr_free
(
details
);
}
};
}
}
...
...
This diff is collapsed.
Click to expand it.
src/objective-c/GRPCClient/private/NSDictionary+GRPC.m
+
3
−
1
View file @
d3c25948
...
...
@@ -88,8 +88,10 @@
+
(
instancetype
)
grpc_dictionaryFromMetadata
:(
grpc_metadata
*
)
entries
count
:(
size_t
)
count
{
NSMutableDictionary
*
metadata
=
[
NSMutableDictionary
dictionaryWithCapacity
:
count
];
for
(
grpc_metadata
*
entry
=
entries
;
entry
<
entries
+
count
;
entry
++
)
{
NSString
*
name
=
[
NSString
stringWithCString
:(
char
*
)
GRPC_SLICE_START_PTR
(
entry
->
key
)
char
*
key
=
grpc_slice_to_c_string
(
entry
->
key
);
NSString
*
name
=
[
NSString
stringWithCString
:
key
encoding:
NSASCIIStringEncoding
];
gpr_free
(
key
);
if
(
!
name
||
metadata
[
name
])
{
// Log if name is nil?
continue
;
...
...
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