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
1856db41
Commit
1856db41
authored
10 years ago
by
vjpai
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of github.com:vjpai/grpc
parents
9b0ff3ba
8dafd52c
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
include/grpc++/server_context.h
+3
-0
3 additions, 0 deletions
include/grpc++/server_context.h
src/cpp/server/server_context.cc
+6
-0
6 additions, 0 deletions
src/cpp/server/server_context.cc
with
9 additions
and
0 deletions
include/grpc++/server_context.h
+
3
−
0
View file @
1856db41
...
@@ -78,6 +78,8 @@ class ServerContext {
...
@@ -78,6 +78,8 @@ class ServerContext {
void
AddInitialMetadata
(
const
grpc
::
string
&
key
,
const
grpc
::
string
&
value
);
void
AddInitialMetadata
(
const
grpc
::
string
&
key
,
const
grpc
::
string
&
value
);
void
AddTrailingMetadata
(
const
grpc
::
string
&
key
,
const
grpc
::
string
&
value
);
void
AddTrailingMetadata
(
const
grpc
::
string
&
key
,
const
grpc
::
string
&
value
);
bool
IsCancelled
();
const
std
::
multimap
<
grpc
::
string
,
grpc
::
string
>&
client_metadata
()
{
const
std
::
multimap
<
grpc
::
string
,
grpc
::
string
>&
client_metadata
()
{
return
client_metadata_
;
return
client_metadata_
;
}
}
...
@@ -110,6 +112,7 @@ class ServerContext {
...
@@ -110,6 +112,7 @@ class ServerContext {
std
::
chrono
::
system_clock
::
time_point
deadline_
;
std
::
chrono
::
system_clock
::
time_point
deadline_
;
grpc_call
*
call_
;
grpc_call
*
call_
;
CompletionQueue
*
cq_
;
bool
sent_initial_metadata_
;
bool
sent_initial_metadata_
;
std
::
multimap
<
grpc
::
string
,
grpc
::
string
>
client_metadata_
;
std
::
multimap
<
grpc
::
string
,
grpc
::
string
>
client_metadata_
;
std
::
multimap
<
grpc
::
string
,
grpc
::
string
>
initial_metadata_
;
std
::
multimap
<
grpc
::
string
,
grpc
::
string
>
initial_metadata_
;
...
...
This diff is collapsed.
Click to expand it.
src/cpp/server/server_context.cc
+
6
−
0
View file @
1856db41
...
@@ -94,6 +94,7 @@ bool ServerContext::CompletionOp::FinalizeResult(void** tag, bool* status) {
...
@@ -94,6 +94,7 @@ bool ServerContext::CompletionOp::FinalizeResult(void** tag, bool* status) {
ServerContext
::
ServerContext
()
ServerContext
::
ServerContext
()
:
completion_op_
(
nullptr
),
:
completion_op_
(
nullptr
),
call_
(
nullptr
),
call_
(
nullptr
),
cq_
(
nullptr
),
sent_initial_metadata_
(
false
)
{}
sent_initial_metadata_
(
false
)
{}
ServerContext
::
ServerContext
(
gpr_timespec
deadline
,
grpc_metadata
*
metadata
,
ServerContext
::
ServerContext
(
gpr_timespec
deadline
,
grpc_metadata
*
metadata
,
...
@@ -101,6 +102,7 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata,
...
@@ -101,6 +102,7 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata,
:
completion_op_
(
nullptr
),
:
completion_op_
(
nullptr
),
deadline_
(
Timespec2Timepoint
(
deadline
)),
deadline_
(
Timespec2Timepoint
(
deadline
)),
call_
(
nullptr
),
call_
(
nullptr
),
cq_
(
nullptr
),
sent_initial_metadata_
(
false
)
{
sent_initial_metadata_
(
false
)
{
for
(
size_t
i
=
0
;
i
<
metadata_count
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
metadata_count
;
i
++
)
{
client_metadata_
.
insert
(
std
::
make_pair
(
client_metadata_
.
insert
(
std
::
make_pair
(
...
@@ -135,4 +137,8 @@ void ServerContext::AddTrailingMetadata(const grpc::string& key,
...
@@ -135,4 +137,8 @@ void ServerContext::AddTrailingMetadata(const grpc::string& key,
trailing_metadata_
.
insert
(
std
::
make_pair
(
key
,
value
));
trailing_metadata_
.
insert
(
std
::
make_pair
(
key
,
value
));
}
}
bool
ServerContext
::
IsCancelled
()
{
return
completion_op_
&&
completion_op_
->
CheckCancelled
(
cq_
);
}
}
// namespace grpc
}
// namespace grpc
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