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
0
Merge Requests
0
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
fe3f09d6
Commit
fe3f09d6
authored
Feb 28, 2006
by
Pekka Pessi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problems in stun/tport.
darcs-hash:20060228153641-65a35-aafb48c6e8a8e075a2005a09e12003ab3872ae0b.gz
parent
8cf0ea4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
stun.c
libsofia-sip-ua/stun/stun.c
+3
-0
tport.c
libsofia-sip-ua/tport/tport.c
+12
-9
No files found.
libsofia-sip-ua/stun/stun.c
View file @
fe3f09d6
...
...
@@ -2532,6 +2532,9 @@ int stun_keepalive_destroy(stun_handle_t *sh, su_socket_t s)
stun_request_t
*
req
;
stun_action_t
action
=
stun_action_keepalive
;
if
(
sh
==
NULL
)
return
1
;
/* Go through the request queue and destroy keepalive requests
* associated with the given socket. */
for
(
req
=
sh
->
sh_requests
;
req
;
req
=
req
->
sr_next
)
{
...
...
libsofia-sip-ua/tport/tport.c
View file @
fe3f09d6
...
...
@@ -3013,7 +3013,7 @@ static void tport_recv_event(tport_t *self, int event)
su_strerror
(
EAGAIN
),
EAGAIN
));
}
}
else
if
(
again
==
1
)
/* STUN keepalive */
else
if
(
again
==
3
)
/* STUN keepalive */
return
;
self
->
tp_time
=
su_time_ms
(
now
);
...
...
@@ -3217,9 +3217,11 @@ tport_delivered_using_udvm(tport_t *tp, msg_t const *msg,
static
int
tport_recv_stream
(
tport_t
*
self
);
static
int
tport_recv_dgram
(
tport_t
*
self
);
static
int
tport_recv_dgram_r
(
tport_t
const
*
self
,
msg_t
**
mmsg
,
int
N
);
#if HAVE_SOFIA_STUN
static
int
tport_recv_try_stun_dgram
(
tport_t
const
*
self
);
#endif
#if HAVE_TLS
static
int
tport_recv_tls
(
tport_t
*
self
);
#endif
...
...
@@ -3234,6 +3236,7 @@ static int tport_recv_sctp(tport_t *self);
* @retval 0 end-of-stream
* @retval 1 normal receive
* @retval 2 incomplete recv, recv again
* @retval 3 STUN keepalive, ignore
*/
static
int
tport_recv_data
(
tport_t
*
self
)
...
...
@@ -3380,6 +3383,9 @@ int tport_recv_dgram(tport_t *self)
*
* @retval -1 error
* @retval 0 end-of-stream
* @retval 1 normal receive (should never happen)
* @retval 2 incomplete recv, recv again (should never happen)
* @retval 3 STUN keepalive, ignore
*/
static
int
tport_recv_dgram_r
(
tport_t
const
*
self
,
msg_t
**
mmsg
,
int
N
)
...
...
@@ -3393,11 +3399,9 @@ int tport_recv_dgram_r(tport_t const *self, msg_t **mmsg, int N)
assert
(
*
mmsg
==
NULL
);
#if HAVE_SOFIA_STUN
{
/* Check always if incoming data is STUN keepalive */
if
(
tport_recv_try_stun_dgram
(
self
)
>=
0
)
return
1
;
}
/* Check always if incoming data is STUN keepalive */
if
(
tport_recv_try_stun_dgram
(
self
)
>=
0
)
return
3
;
#endif
veclen
=
tport_recv_iovec
(
self
,
mmsg
,
iovec
,
N
,
1
);
...
...
@@ -3439,7 +3443,7 @@ int tport_keepalive(tport_t *tp, tp_name_t *tpn)
stun_handle_t
*
sh
=
mr
->
mr_nat
->
stun
;
su_sockaddr_t
sa
[
1
]
=
{{
0
}};
if
(
tp
->
tp_has_keepalive
==
1
)
if
(
tp
->
tp_has_keepalive
==
1
||
sh
==
NULL
)
return
0
;
inet_pton
(
AF_INET
,
tpn
->
tpn_host
,
(
void
*
)
&
sa
->
su_sin
.
sin_addr
.
s_addr
);
...
...
@@ -3462,7 +3466,6 @@ int tport_keepalive(tport_t *tp, tp_name_t *tpn)
return
0
;
}
/** Receive STUN datagram.
*
* @retval -1 error
...
...
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