Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
d5cd9f25
Commit
d5cd9f25
authored
Dec 26, 2018
by
hydratim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug Fix
parent
a32b5db1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/common/net.cc
src/common/net.cc
+4
-2
No files found.
src/common/net.cc
View file @
d5cd9f25
...
@@ -97,7 +97,7 @@ Ipv6::toString() const {
...
@@ -97,7 +97,7 @@ Ipv6::toString() const {
inet_ntop
(
AF_INET6
,
&
addr
,
buff6
,
INET6_ADDRSTRLEN
);
inet_ntop
(
AF_INET6
,
&
addr
,
buff6
,
INET6_ADDRSTRLEN
);
return
std
::
string
(
"["
)
+
std
::
string
(
buff6
)
+
std
::
string
(
"]"
);
return
std
::
string
(
buff6
);
}
}
void
Ipv6
::
toNetwork
(
in6_addr
*
addr6
)
const
{
void
Ipv6
::
toNetwork
(
in6_addr
*
addr6
)
const
{
...
@@ -196,7 +196,8 @@ Address::init(const std::string& addr) {
...
@@ -196,7 +196,8 @@ Address::init(const std::string& addr) {
unsigned
long
s_pos
=
addr
.
find
(
'['
);
unsigned
long
s_pos
=
addr
.
find
(
'['
);
if
(
pos
!=
std
::
string
::
npos
&&
s_pos
!=
std
::
string
::
npos
)
{
if
(
pos
!=
std
::
string
::
npos
&&
s_pos
!=
std
::
string
::
npos
)
{
//IPv6 address
//IPv6 address
host_
=
addr
.
substr
(
s_pos
,
pos
+
1
);
host_
=
addr
.
substr
(
s_pos
+
1
,
pos
-
1
);
family_
=
AF_INET6
;
try
{
try
{
in6_addr
addr6
;
in6_addr
addr6
;
char
buff6
[
INET6_ADDRSTRLEN
+
1
];
char
buff6
[
INET6_ADDRSTRLEN
+
1
];
...
@@ -212,6 +213,7 @@ Address::init(const std::string& addr) {
...
@@ -212,6 +213,7 @@ Address::init(const std::string& addr) {
if
(
pos
==
std
::
string
::
npos
)
if
(
pos
==
std
::
string
::
npos
)
throw
std
::
invalid_argument
(
"Invalid address"
);
throw
std
::
invalid_argument
(
"Invalid address"
);
host_
=
addr
.
substr
(
0
,
pos
);
host_
=
addr
.
substr
(
0
,
pos
);
family_
=
AF_INET
;
if
(
host_
==
"*"
)
{
if
(
host_
==
"*"
)
{
host_
=
"0.0.0.0"
;
host_
=
"0.0.0.0"
;
}
}
...
...
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