Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
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
nghttp2
Commits
eb951c2c
Commit
eb951c2c
authored
Feb 12, 2018
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Define nghttp2_inet_pton wrapper to avoid inet_pton macro
parent
39f0ce7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/util.cc
src/util.cc
+12
-4
No files found.
src/util.cc
View file @
eb951c2c
...
...
@@ -70,9 +70,16 @@ namespace nghttp2 {
namespace
util
{
#ifdef _WIN32
#ifndef _WIN32
namespace
{
int
nghttp2_inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
)
{
return
inet_pton
(
af
,
src
,
dst
);
}
}
// namespace
#else // _WIN32
namespace
{
// inet_pton-wrapper for Windows
static
int
inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
)
{
int
nghttp2_
inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
)
{
#if _WIN32_WINNT >= 0x0600
return
InetPtonA
(
af
,
src
,
dst
);
#else
...
...
@@ -88,6 +95,7 @@ static int inet_pton(int af, const char *src, void *dst) {
return
0
;
#endif
}
}
// namespace
#endif // _WIN32
const
char
UPPER_XDIGITS
[]
=
"0123456789ABCDEF"
;
...
...
@@ -662,7 +670,7 @@ bool numeric_host(const char *hostname, int family) {
int
rv
;
std
::
array
<
uint8_t
,
sizeof
(
struct
in6_addr
)
>
dst
;
rv
=
inet_pton
(
family
,
hostname
,
dst
.
data
());
rv
=
nghttp2_
inet_pton
(
family
,
hostname
,
dst
.
data
());
return
rv
==
1
;
}
...
...
@@ -959,7 +967,7 @@ int get_socket_error(int fd) {
bool
ipv6_numeric_addr
(
const
char
*
host
)
{
uint8_t
dst
[
16
];
return
inet_pton
(
AF_INET6
,
host
,
dst
)
==
1
;
return
nghttp2_
inet_pton
(
AF_INET6
,
host
,
dst
)
==
1
;
}
namespace
{
...
...
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