Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sofia-sip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
external
sofia-sip
Commits
e5dd96c0
Commit
e5dd96c0
authored
Feb 16, 2011
by
Pekka Pessi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_tport.c: fix reuseaddr problem on Windows
parent
185d204f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
test_tport.c
libsofia-sip-ua/tport/test_tport.c
+12
-2
No files found.
libsofia-sip-ua/tport/test_tport.c
View file @
e5dd96c0
...
...
@@ -52,6 +52,7 @@ typedef struct tp_test_s tp_test_t;
#include <sofia-sip/su_wait.h>
#include <sofia-sip/su_md5.h>
#include <sofia-sip/su_localinfo.h>
#include "tport_internal.h"
/* Get SU_DEBUG_*() */
...
...
@@ -566,19 +567,26 @@ static int init_test(tp_test_t *tt)
TEST_S
(
tport_name
(
tp
)
->
tpn_ident
,
"server"
);
{
su_sockaddr_t
su
[
1
]
;
su_sockaddr_t
*
su
;
socklen_t
sulen
;
int
s
;
int
i
,
before
,
after
;
char
port
[
8
];
tp_name_t
rname
[
1
];
su_localinfo_t
*
li
,
hints
[
1
]
=
{{
0
}};
*
rname
=
*
myname
;
/* Check that we cannot bind to an already used socket */
memset
(
su
,
0
,
sulen
=
sizeof
(
su
->
su_sin
));
/* Windows allows concurrent binding to a wildcard */
memset
(
hints
,
0
,
sizeof
hints
);
if
(
strcmp
(
rname
->
tpn_host
,
"*"
))
hints
->
li_canonname
=
(
char
*
)
rname
->
tpn_host
;
TEST_1
(
su_getlocalinfo
(
hints
,
&
li
)
==
0
);
su
=
li
->
li_addr
,
sulen
=
li
->
li_addrlen
;
s
=
su_socket
(
su
->
su_family
=
AF_INET
,
SOCK_STREAM
,
0
);
TEST_1
(
s
!=
-
1
);
TEST_1
(
bind
(
s
,
&
su
->
su_sa
,
sulen
)
!=
-
1
);
TEST_1
(
listen
(
s
,
5
)
!=
-
1
);
...
...
@@ -599,6 +607,8 @@ static int init_test(tp_test_t *tt)
after
=
count_tports
(
tt
->
tt_srv_tports
);
su_freelocalinfo
(
li
);
/* Check that no new primary transports has been added by failed call */
TEST
(
before
,
after
);
...
...
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