Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
71aa40c5
Unverified
Commit
71aa40c5
authored
Sep 10, 2020
by
jamesge
Committed by
GitHub
Sep 10, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1139 from TousakaRin/use_443_as_default_port_for_https
For https naming service, use 443 as default port
parents
7bda11bc
fdb4e77d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
global.cpp
src/brpc/global.cpp
+5
-2
domain_naming_service.cpp
src/brpc/policy/domain_naming_service.cpp
+5
-3
domain_naming_service.h
src/brpc/policy/domain_naming_service.h
+3
-1
No files found.
src/brpc/global.cpp
View file @
71aa40c5
...
...
@@ -115,7 +115,9 @@ const char* const DUMMY_SERVER_PORT_FILE = "dummy_server.port";
struct
GlobalExtensions
{
GlobalExtensions
()
:
ch_mh_lb
(
CONS_HASH_LB_MURMUR3
)
:
dns
(
80
)
,
dns_with_ssl
(
443
)
,
ch_mh_lb
(
CONS_HASH_LB_MURMUR3
)
,
ch_md5_lb
(
CONS_HASH_LB_MD5
)
,
ch_ketama_lb
(
CONS_HASH_LB_KETAMA
)
,
constant_cl
(
0
)
{
...
...
@@ -127,6 +129,7 @@ struct GlobalExtensions {
FileNamingService
fns
;
ListNamingService
lns
;
DomainNamingService
dns
;
DomainNamingService
dns_with_ssl
;
RemoteFileNamingService
rfns
;
ConsulNamingService
cns
;
DiscoveryNamingService
dcns
;
...
...
@@ -346,7 +349,7 @@ static void GlobalInitializeOrDieImpl() {
NamingServiceExtension
()
->
RegisterOrDie
(
"file"
,
&
g_ext
->
fns
);
NamingServiceExtension
()
->
RegisterOrDie
(
"list"
,
&
g_ext
->
lns
);
NamingServiceExtension
()
->
RegisterOrDie
(
"http"
,
&
g_ext
->
dns
);
NamingServiceExtension
()
->
RegisterOrDie
(
"https"
,
&
g_ext
->
dns
);
NamingServiceExtension
()
->
RegisterOrDie
(
"https"
,
&
g_ext
->
dns
_with_ssl
);
NamingServiceExtension
()
->
RegisterOrDie
(
"redis"
,
&
g_ext
->
dns
);
NamingServiceExtension
()
->
RegisterOrDie
(
"remotefile"
,
&
g_ext
->
rfns
);
NamingServiceExtension
()
->
RegisterOrDie
(
"consul"
,
&
g_ext
->
cns
);
...
...
src/brpc/policy/domain_naming_service.cpp
View file @
71aa40c5
...
...
@@ -28,7 +28,9 @@
namespace
brpc
{
namespace
policy
{
DomainNamingService
::
DomainNamingService
()
:
_aux_buf_len
(
0
)
{}
DomainNamingService
::
DomainNamingService
(
int
default_port
)
:
_aux_buf_len
(
0
)
,
_default_port
(
default_port
)
{}
int
DomainNamingService
::
GetServers
(
const
char
*
dns_name
,
std
::
vector
<
ServerNode
>*
servers
)
{
...
...
@@ -51,7 +53,7 @@ int DomainNamingService::GetServers(const char* dns_name,
}
buf
[
i
]
=
'\0'
;
int
port
=
80
;
// default port of HTTP
int
port
=
_default_port
;
if
(
dns_name
[
i
]
==
':'
)
{
++
i
;
char
*
end
=
NULL
;
...
...
@@ -142,7 +144,7 @@ void DomainNamingService::Describe(
}
NamingService
*
DomainNamingService
::
New
()
const
{
return
new
DomainNamingService
;
return
new
DomainNamingService
(
_default_port
)
;
}
void
DomainNamingService
::
Destroy
()
{
...
...
src/brpc/policy/domain_naming_service.h
View file @
71aa40c5
...
...
@@ -28,7 +28,8 @@ namespace policy {
class
DomainNamingService
:
public
PeriodicNamingService
{
public
:
DomainNamingService
();
DomainNamingService
(
int
default_port
);
DomainNamingService
()
:
DomainNamingService
(
80
)
{}
private
:
int
GetServers
(
const
char
*
service_name
,
...
...
@@ -43,6 +44,7 @@ private:
private
:
std
::
unique_ptr
<
char
[]
>
_aux_buf
;
size_t
_aux_buf_len
;
int
_default_port
;
};
}
// namespace policy
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment