Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
3b047f92
Commit
3b047f92
authored
Nov 09, 2016
by
Ghislain MARY
Browse files
One more fix for the dual resolver in the case a DNS request is not needed.
parent
48be0501
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
src/belle_sip_resolver.c
src/belle_sip_resolver.c
+6
-7
No files found.
src/belle_sip_resolver.c
View file @
3b047f92
...
...
@@ -160,6 +160,9 @@ struct belle_sip_dual_resolver_context{
belle_sip_resolver_context_t
*
aaaa_ctx
;
struct
addrinfo
*
a_results
;
struct
addrinfo
*
aaaa_results
;
uint8_t
a_notified
;
uint8_t
aaaa_notified
;
uint8_t
pad
[
2
];
};
void
belle_sip_resolver_context_init
(
belle_sip_resolver_context_t
*
obj
,
belle_sip_stack_t
*
stack
){
...
...
@@ -407,10 +410,6 @@ static belle_sip_list_t *srv_select_by_weight(belle_sip_list_t *srv_list){
return
srv_list
;
/*no weight election was necessary, return original list*/
}
static
uint8_t
belle_sip_resolver_context_notified
(
belle_sip_resolver_context_t
*
obj
)
{
return
obj
->
notified
;
}
static
void
simple_resolver_context_notify
(
belle_sip_resolver_context_t
*
obj
)
{
belle_sip_simple_resolver_context_t
*
ctx
=
BELLE_SIP_SIMPLE_RESOLVER_CONTEXT
(
obj
);
if
((
ctx
->
type
==
DNS_T_A
)
||
(
ctx
->
type
==
DNS_T_AAAA
))
{
...
...
@@ -1042,9 +1041,7 @@ static uint8_t belle_sip_resolver_context_can_be_cancelled(belle_sip_resolver_co
#define belle_sip_resolver_context_can_be_notified(obj) belle_sip_resolver_context_can_be_cancelled(obj)
static
void
dual_resolver_context_check_finished
(
belle_sip_dual_resolver_context_t
*
ctx
)
{
if
(
belle_sip_resolver_context_can_be_notified
(
BELLE_SIP_RESOLVER_CONTEXT
(
ctx
))
&&
(
ctx
->
a_ctx
!=
NULL
)
&&
belle_sip_resolver_context_notified
(
BELLE_SIP_RESOLVER_CONTEXT
(
ctx
->
a_ctx
))
&&
(
ctx
->
aaaa_ctx
!=
NULL
)
&&
belle_sip_resolver_context_notified
(
BELLE_SIP_RESOLVER_CONTEXT
(
ctx
->
aaaa_ctx
)))
{
if
(
belle_sip_resolver_context_can_be_notified
(
BELLE_SIP_RESOLVER_CONTEXT
(
ctx
))
&&
(
ctx
->
a_notified
==
TRUE
)
&&
(
ctx
->
aaaa_notified
==
TRUE
))
{
belle_sip_resolver_context_notify
(
BELLE_SIP_RESOLVER_CONTEXT
(
ctx
));
}
}
...
...
@@ -1052,12 +1049,14 @@ static void dual_resolver_context_check_finished(belle_sip_dual_resolver_context
static
void
on_ipv4_results
(
void
*
data
,
const
char
*
name
,
struct
addrinfo
*
ai_list
)
{
belle_sip_dual_resolver_context_t
*
ctx
=
BELLE_SIP_DUAL_RESOLVER_CONTEXT
(
data
);
ctx
->
a_results
=
ai_list
;
ctx
->
a_notified
=
TRUE
;
dual_resolver_context_check_finished
(
ctx
);
}
static
void
on_ipv6_results
(
void
*
data
,
const
char
*
name
,
struct
addrinfo
*
ai_list
)
{
belle_sip_dual_resolver_context_t
*
ctx
=
BELLE_SIP_DUAL_RESOLVER_CONTEXT
(
data
);
ctx
->
aaaa_results
=
ai_list
;
ctx
->
aaaa_notified
=
TRUE
;
dual_resolver_context_check_finished
(
ctx
);
}
...
...
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