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
859cce41
Commit
859cce41
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
clang-format
parent
3d88341c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/lib/surface/call.c
+4
-5
4 additions, 5 deletions
src/core/lib/surface/call.c
test/core/channel/channel_stack_test.c
+4
-4
4 additions, 4 deletions
test/core/channel/channel_stack_test.c
test/core/end2end/tests/filter_latency.c
+16
-12
16 additions, 12 deletions
test/core/end2end/tests/filter_latency.c
with
24 additions
and
21 deletions
src/core/lib/surface/call.c
+
4
−
5
View file @
859cce41
...
...
@@ -313,11 +313,10 @@ grpc_error *grpc_call_create(const grpc_call_create_args *args,
GRPC_CHANNEL_INTERNAL_REF
(
args
->
channel
,
"call"
);
/* initial refcount dropped by grpc_call_destroy */
grpc_error
*
error
=
grpc_call_stack_init
(
&
exec_ctx
,
channel_stack
,
1
,
destroy_call
,
call
,
call
->
context
,
args
->
server_transport_data
,
path
,
call
->
start_time
,
send_deadline
,
CALL_STACK_FROM_CALL
(
call
));
grpc_error
*
error
=
grpc_call_stack_init
(
&
exec_ctx
,
channel_stack
,
1
,
destroy_call
,
call
,
call
->
context
,
args
->
server_transport_data
,
path
,
call
->
start_time
,
send_deadline
,
CALL_STACK_FROM_CALL
(
call
));
if
(
error
!=
GRPC_ERROR_NONE
)
{
grpc_status_code
status
;
const
char
*
error_str
;
...
...
This diff is collapsed.
Click to expand it.
test/core/channel/channel_stack_test.c
+
4
−
4
View file @
859cce41
...
...
@@ -136,10 +136,10 @@ static void test_create_channel_stack(void) {
GPR_ASSERT
(
*
channel_data
==
0
);
call_stack
=
gpr_malloc
(
channel_stack
->
call_stack_size
);
grpc_error
*
error
=
grpc_call_stack_init
(
&
exec_ctx
,
channel_stack
,
1
,
free_call
,
call_stack
,
NULL
,
NULL
,
path
,
gpr_now
(
GPR_CLOCK_MONOTONIC
),
gpr_inf_future
(
GPR_CLOCK_MONOTONIC
),
call_stack
);
grpc_error
*
error
=
grpc_call_stack_init
(
&
exec_ctx
,
channel_stack
,
1
,
free_call
,
call_stack
,
NULL
,
NULL
,
path
,
gpr_now
(
GPR_CLOCK_MONOTONIC
),
gpr_inf_future
(
GPR_CLOCK_MONOTONIC
),
call_stack
);
GPR_ASSERT
(
error
==
GRPC_ERROR_NONE
);
GPR_ASSERT
(
call_stack
->
count
==
1
);
call_elem
=
grpc_call_stack_element
(
call_stack
,
0
);
...
...
This diff is collapsed.
Click to expand it.
test/core/end2end/tests/filter_latency.c
+
16
−
12
View file @
859cce41
...
...
@@ -133,7 +133,7 @@ static void test_request(grpc_end2end_test_config config) {
g_client_latency
=
gpr_time_0
(
GPR_TIMESPAN
);
g_server_latency
=
gpr_time_0
(
GPR_TIMESPAN
);
const
gpr_timespec
start_time
=
gpr_now
(
GPR_CLOCK_MONOTONIC
);
const
gpr_timespec
start_time
=
gpr_now
(
GPR_CLOCK_MONOTONIC
);
c
=
grpc_channel_create_call
(
f
.
client
,
NULL
,
GRPC_PROPAGATE_DEFAULTS
,
f
.
cq
,
"/foo"
,
"foo.test.google.fr"
,
deadline
,
NULL
);
...
...
@@ -250,15 +250,17 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
return
GRPC_ERROR_NONE
;
}
static
void
client_destroy_call_elem
(
grpc_exec_ctx
*
exec_ctx
,
grpc_call_element
*
elem
,
const
grpc_call_final_info
*
final_info
,
void
*
and_free_memory
)
{
static
void
client_destroy_call_elem
(
grpc_exec_ctx
*
exec_ctx
,
grpc_call_element
*
elem
,
const
grpc_call_final_info
*
final_info
,
void
*
and_free_memory
)
{
g_client_latency
=
final_info
->
stats
.
latency
;
}
static
void
server_destroy_call_elem
(
grpc_exec_ctx
*
exec_ctx
,
grpc_call_element
*
elem
,
const
grpc_call_final_info
*
final_info
,
void
*
and_free_memory
)
{
static
void
server_destroy_call_elem
(
grpc_exec_ctx
*
exec_ctx
,
grpc_call_element
*
elem
,
const
grpc_call_final_info
*
final_info
,
void
*
and_free_memory
)
{
g_server_latency
=
final_info
->
stats
.
latency
;
}
...
...
@@ -300,7 +302,7 @@ static const grpc_channel_filter test_server_filter = {
*/
static
bool
maybe_add_filter
(
grpc_channel_stack_builder
*
builder
,
void
*
arg
)
{
grpc_channel_filter
*
filter
=
arg
;
grpc_channel_filter
*
filter
=
arg
;
if
(
g_enable_filter
)
{
// Want to add the filter as close to the end as possible, to make
// sure that all of the filters work well together. However, we
...
...
@@ -309,8 +311,8 @@ static bool maybe_add_filter(grpc_channel_stack_builder *builder, void *arg) {
grpc_channel_stack_builder_iterator
*
it
=
grpc_channel_stack_builder_create_iterator_at_last
(
builder
);
GPR_ASSERT
(
grpc_channel_stack_builder_move_prev
(
it
));
const
bool
retval
=
grpc_channel_stack_builder_add_filter_before
(
it
,
filter
,
NULL
,
NULL
);
const
bool
retval
=
grpc_channel_stack_builder_add_filter_before
(
it
,
filter
,
NULL
,
NULL
);
grpc_channel_stack_builder_iterator_destroy
(
it
);
return
retval
;
}
else
{
...
...
@@ -320,9 +322,11 @@ static bool maybe_add_filter(grpc_channel_stack_builder *builder, void *arg) {
static
void
init_plugin
(
void
)
{
grpc_channel_init_register_stage
(
GRPC_CLIENT_CHANNEL
,
INT_MAX
,
maybe_add_filter
,
(
void
*
)
&
test_client_filter
);
maybe_add_filter
,
(
void
*
)
&
test_client_filter
);
grpc_channel_init_register_stage
(
GRPC_SERVER_CHANNEL
,
INT_MAX
,
maybe_add_filter
,
(
void
*
)
&
test_server_filter
);
maybe_add_filter
,
(
void
*
)
&
test_server_filter
);
}
static
void
destroy_plugin
(
void
)
{}
...
...
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