Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
88
Issues
88
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louiz’
biboumi
Commits
fa3d44e7
Commit
fa3d44e7
authored
Feb 28, 2017
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use AI_NUMERICHOST when using getaddrinfo to bind() our client sockets
parent
73915e88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
louloulibs/network/tcp_client_socket_handler.cpp
louloulibs/network/tcp_client_socket_handler.cpp
+5
-1
No files found.
louloulibs/network/tcp_client_socket_handler.cpp
View file @
fa3d44e7
...
...
@@ -35,7 +35,11 @@ void TCPClientSocketHandler::init_socket(const struct addrinfo* rp)
// Convert the address from string format to a sockaddr that can be
// used in bind()
struct
addrinfo
*
result
;
int
err
=
::
getaddrinfo
(
this
->
bind_addr
.
data
(),
nullptr
,
nullptr
,
&
result
);
struct
addrinfo
hints
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_flags
=
AI_NUMERICHOST
;
hints
.
ai_family
=
AF_UNSPEC
;
int
err
=
::
getaddrinfo
(
this
->
bind_addr
.
data
(),
nullptr
,
&
hints
,
&
result
);
if
(
err
!=
0
||
!
result
)
log_error
(
"Failed to bind socket to "
,
this
->
bind_addr
,
": "
,
gai_strerror
(
err
));
...
...
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