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
0a7d8589
Commit
0a7d8589
authored
10 years ago
by
Tim Emiola
Browse files
Options
Downloads
Patches
Plain Diff
Updates rb_server.c to return the created port when it's non-zero
parent
6dc549e9
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/ruby/ext/grpc/rb_server.c
+6
-6
6 additions, 6 deletions
src/ruby/ext/grpc/rb_server.c
with
6 additions
and
6 deletions
src/ruby/ext/grpc/rb_server.c
+
6
−
6
View file @
0a7d8589
...
@@ -223,7 +223,7 @@ static VALUE grpc_rb_server_add_http2_port(int argc, VALUE *argv, VALUE self) {
...
@@ -223,7 +223,7 @@ static VALUE grpc_rb_server_add_http2_port(int argc, VALUE *argv, VALUE self) {
VALUE
port
=
Qnil
;
VALUE
port
=
Qnil
;
VALUE
is_secure
=
Qnil
;
VALUE
is_secure
=
Qnil
;
grpc_rb_server
*
s
=
NULL
;
grpc_rb_server
*
s
=
NULL
;
int
added_ok
=
0
;
int
recvd_port
=
0
;
/* "11" == 1 mandatory args, 1 (is_secure) is optional */
/* "11" == 1 mandatory args, 1 (is_secure) is optional */
rb_scan_args
(
argc
,
argv
,
"11"
,
&
port
,
&
is_secure
);
rb_scan_args
(
argc
,
argv
,
"11"
,
&
port
,
&
is_secure
);
...
@@ -233,22 +233,22 @@ static VALUE grpc_rb_server_add_http2_port(int argc, VALUE *argv, VALUE self) {
...
@@ -233,22 +233,22 @@ static VALUE grpc_rb_server_add_http2_port(int argc, VALUE *argv, VALUE self) {
rb_raise
(
rb_eRuntimeError
,
"closed!"
);
rb_raise
(
rb_eRuntimeError
,
"closed!"
);
return
Qnil
;
return
Qnil
;
}
else
if
(
is_secure
==
Qnil
||
TYPE
(
is_secure
)
!=
T_TRUE
)
{
}
else
if
(
is_secure
==
Qnil
||
TYPE
(
is_secure
)
!=
T_TRUE
)
{
added_ok
=
grpc_server_add_http2_port
(
s
->
wrapped
,
StringValueCStr
(
port
));
recvd_port
=
grpc_server_add_http2_port
(
s
->
wrapped
,
StringValueCStr
(
port
));
if
(
added_ok
==
0
)
{
if
(
recvd_port
==
0
)
{
rb_raise
(
rb_eRuntimeError
,
rb_raise
(
rb_eRuntimeError
,
"could not add port %s to server, not sure why"
,
"could not add port %s to server, not sure why"
,
StringValueCStr
(
port
));
StringValueCStr
(
port
));
}
}
}
else
if
(
TYPE
(
is_secure
)
!=
T_FALSE
)
{
}
else
if
(
TYPE
(
is_secure
)
!=
T_FALSE
)
{
added_ok
=
recvd_port
=
grpc_server_add_secure_http2_port
(
s
->
wrapped
,
StringValueCStr
(
port
));
grpc_server_add_secure_http2_port
(
s
->
wrapped
,
StringValueCStr
(
port
));
if
(
added_ok
==
0
)
{
if
(
recvd_port
==
0
)
{
rb_raise
(
rb_eRuntimeError
,
rb_raise
(
rb_eRuntimeError
,
"could not add secure port %s to server, not sure why"
,
"could not add secure port %s to server, not sure why"
,
StringValueCStr
(
port
));
StringValueCStr
(
port
));
}
}
}
}
return
Qnil
;
return
INT2NUM
(
recvd_port
)
;
}
}
void
Init_google_rpc_server
()
{
void
Init_google_rpc_server
()
{
...
...
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