Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-daemon
Commits
9dce0b2c
Commit
9dce0b2c
authored
11 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
ip_utils: allow to specify address family when resolving domains
parent
f78d6edf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/ip_utils.cpp
+2
-2
2 additions, 2 deletions
daemon/src/ip_utils.cpp
daemon/src/ip_utils.h
+2
-2
2 additions, 2 deletions
daemon/src/ip_utils.h
with
4 additions
and
4 deletions
daemon/src/ip_utils.cpp
+
2
−
2
View file @
9dce0b2c
...
@@ -104,12 +104,12 @@ ip_utils::addrToStr(const std::string& ip_str, bool include_port, bool force_ipv
...
@@ -104,12 +104,12 @@ ip_utils::addrToStr(const std::string& ip_str, bool include_port, bool force_ipv
}
}
pj_sockaddr
pj_sockaddr
ip_utils
::
strToAddr
(
const
std
::
string
&
str
)
ip_utils
::
strToAddr
(
const
std
::
string
&
str
,
pj_uint16_t
family
)
{
{
pj_str_t
pjstring
;
pj_str_t
pjstring
;
pj_cstr
(
&
pjstring
,
str
.
c_str
());
pj_cstr
(
&
pjstring
,
str
.
c_str
());
pj_sockaddr
ip
;
pj_sockaddr
ip
;
auto
status
=
pj_sockaddr_parse
(
pj_AF_UNSPEC
()
,
0
,
&
pjstring
,
&
ip
);
auto
status
=
pj_sockaddr_parse
(
family
,
0
,
&
pjstring
,
&
ip
);
if
(
status
!=
PJ_SUCCESS
)
if
(
status
!=
PJ_SUCCESS
)
ip
.
addr
.
sa_family
=
pj_AF_UNSPEC
();
ip
.
addr
.
sa_family
=
pj_AF_UNSPEC
();
return
ip
;
return
ip
;
...
...
This diff is collapsed.
Click to expand it.
daemon/src/ip_utils.h
+
2
−
2
View file @
9dce0b2c
...
@@ -59,10 +59,10 @@ namespace ip_utils {
...
@@ -59,10 +59,10 @@ namespace ip_utils {
/**
/**
* Convert a string representation of an IP adress to its binary counterpart.
* Convert a string representation of an IP adress to its binary counterpart.
*
*
* Performs hostname resolution if necessary.
* Performs hostname resolution if necessary
(with given address family)
.
* If conversion fails, returned adress will have its family set to PJ_AF_UNSPEC.
* If conversion fails, returned adress will have its family set to PJ_AF_UNSPEC.
*/
*/
pj_sockaddr
strToAddr
(
const
std
::
string
&
str
);
pj_sockaddr
strToAddr
(
const
std
::
string
&
str
,
pj_uint16_t
family
=
pj_AF_UNSPEC
()
);
/**
/**
* Return the generic "any host" IP address of the specified family.
* Return the generic "any host" IP address of the specified family.
...
...
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