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
bfa5b926
Commit
bfa5b926
authored
Feb 11, 2013
by
Ghislain MARY
Browse files
Lower timeout for resolver timeout test.
parent
d5f56712
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/belle-sip/sipstack.h
View file @
bfa5b926
...
...
@@ -43,20 +43,22 @@ BELLESIP_EXPORT belle_sip_stack_t * belle_sip_stack_new(const char *properties);
BELLESIP_EXPORT
belle_sip_listening_point_t
*
belle_sip_stack_create_listening_point
(
belle_sip_stack_t
*
s
,
const
char
*
ipaddress
,
int
port
,
const
char
*
transport
);
void
belle_sip_stack_delete_listening_point
(
belle_sip_stack_t
*
s
,
belle_sip_listening_point_t
*
lp
);
BELLESIP_EXPORT
void
belle_sip_stack_delete_listening_point
(
belle_sip_stack_t
*
s
,
belle_sip_listening_point_t
*
lp
);
BELLESIP_EXPORT
belle_sip_provider_t
*
belle_sip_stack_create_provider
(
belle_sip_stack_t
*
s
,
belle_sip_listening_point_t
*
lp
);
BELLESIP_EXPORT
belle_sip_main_loop_t
*
belle_sip_stack_get_main_loop
(
belle_sip_stack_t
*
stack
);
void
belle_sip_stack_main
(
belle_sip_stack_t
*
stack
);
BELLESIP_EXPORT
void
belle_sip_stack_main
(
belle_sip_stack_t
*
stack
);
BELLESIP_EXPORT
void
belle_sip_stack_sleep
(
belle_sip_stack_t
*
stack
,
unsigned
int
milliseconds
);
int
belle_sip_stack_get_transport_timeout
(
const
belle_sip_stack_t
*
stack
);
BELLESIP_EXPORT
int
belle_sip_stack_get_transport_timeout
(
const
belle_sip_stack_t
*
stack
);
BELLESIP_EXPORT
int
belle_sip_stack_get_dns_timeout
(
const
belle_sip_stack_t
*
stack
);
BELLESIP_EXPORT
void
belle_sip_stack_set_dns_timeout
(
belle_sip_stack_t
*
stack
,
int
timeout
);
void
belle_sip_hop_free
(
belle_sip_hop_t
*
hop
);
/**
...
...
src/sipstack.c
View file @
bfa5b926
...
...
@@ -50,6 +50,10 @@ int belle_sip_stack_get_dns_timeout(const belle_sip_stack_t *stack) {
return
stack
->
dns_timeout
;
}
void
belle_sip_stack_set_dns_timeout
(
belle_sip_stack_t
*
stack
,
int
timeout
)
{
stack
->
dns_timeout
=
timeout
;
}
belle_sip_listening_point_t
*
belle_sip_stack_create_listening_point
(
belle_sip_stack_t
*
s
,
const
char
*
ipaddress
,
int
port
,
const
char
*
transport
){
belle_sip_listening_point_t
*
lp
=
NULL
;
if
(
strcasecmp
(
transport
,
"UDP"
)
==
0
)
{
...
...
tester/belle_sip_resolver_tester.c
View file @
bfa5b926
...
...
@@ -38,9 +38,11 @@ typedef struct endpoint {
}
endpoint_t
;
static
unsigned
int
wait_for
(
belle_sip_stack_t
*
stack
,
int
*
current_value
,
int
expected_value
,
int
timeout
)
{
int
retry
=
0
;
#define ITER 100
while
((
*
current_value
!=
expected_value
)
&&
(
retry
++
<
(
timeout
/
ITER
)))
{
uint64_t
begin
,
end
;
begin
=
belle_sip_time_ms
();
end
=
begin
+
timeout
;
while
((
*
current_value
!=
expected_value
)
&&
(
belle_sip_time_ms
()
<
end
))
{
if
(
stack
)
belle_sip_stack_sleep
(
stack
,
ITER
);
}
if
(
*
current_value
!=
expected_value
)
return
FALSE
;
...
...
@@ -134,15 +136,15 @@ static void ipv4_a_query_send_failure(void) {
/* IPv4 A query timeout */
static
void
ipv4_a_query_timeout
(
void
)
{
int
timeout
;
int
timeout
=
500
;
endpoint_t
*
client
=
create_endpoint
();
CU_ASSERT_PTR_NOT_NULL_FATAL
(
client
);
timeout
=
belle_sip_stack_
g
et_dns_timeout
(
client
->
stack
);
belle_sip_stack_set_resolver_tx_delay
(
client
->
stack
,
timeout
+
4
000
);
belle_sip_stack_
s
et_dns_timeout
(
client
->
stack
,
timeout
);
belle_sip_stack_set_resolver_tx_delay
(
client
->
stack
,
timeout
*
4
);
client
->
resolver_id
=
belle_sip_resolve
(
client
->
stack
,
IPV4_SIP_DOMAIN
,
SIP_PORT
,
AF_INET
,
resolve_done
,
client
,
belle_sip_stack_get_main_loop
(
client
->
stack
));
CU_ASSERT_NOT_EQUAL
(
client
->
resolver_id
,
0
);
CU_ASSERT_FALSE
(
wait_for
(
client
->
stack
,
&
client
->
resolve_done
,
1
,
timeout
+
2
000
));
CU_ASSERT_FALSE
(
wait_for
(
client
->
stack
,
&
client
->
resolve_done
,
1
,
timeout
*
2
));
CU_ASSERT_PTR_EQUAL
(
client
->
result
,
NULL
);
belle_sip_stack_set_resolver_tx_delay
(
client
->
stack
,
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