Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libnice
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
libnice
Commits
ddb6df15
Commit
ddb6df15
authored
Nov 03, 2008
by
Youness Alaoui
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'tester/nice-stund' into nice-kakaroto
Conflicts: stun/tools/stund.c
parents
b4246f04
eab8bebc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
stun/tools/stund.c
stun/tools/stund.c
+17
-6
No files found.
stun/tools/stund.c
View file @
ddb6df15
...
...
@@ -192,7 +192,7 @@ ssize_t send_safe (int fd, const struct msghdr *msg)
}
static
int
dgram_process
(
int
sock
,
StunAgent
*
agent
)
static
int
dgram_process
(
int
sock
,
StunAgent
*
oldagent
,
StunAgent
*
new
agent
)
{
struct
sockaddr_storage
addr
;
uint8_t
buf
[
STUN_MAX_MESSAGE_SIZE
];
...
...
@@ -201,6 +201,7 @@ static int dgram_process (int sock, StunAgent *agent)
StunMessage
request
;
StunMessage
response
;
StunValidationStatus
validation
;
StunAgent
*
agent
=
NULL
;
struct
msghdr
mh
=
{
...
...
@@ -216,7 +217,15 @@ static int dgram_process (int sock, StunAgent *agent)
if
(
len
==
(
size_t
)
-
1
)
return
-
1
;
validation
=
stun_agent_validate
(
agent
,
&
request
,
buf
,
len
,
NULL
,
0
);
validation
=
stun_agent_validate
(
newagent
,
&
request
,
buf
,
len
,
NULL
,
0
);
if
(
validation
==
STUN_VALIDATION_SUCCESS
)
{
agent
=
newagent
;
}
else
{
validation
=
stun_agent_validate
(
oldagent
,
&
request
,
buf
,
len
,
NULL
,
0
);
agent
=
oldagent
;
}
/* Unknown attributes */
if
(
validation
==
STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE
)
...
...
@@ -260,17 +269,19 @@ send_buf:
static
int
run
(
int
family
,
int
protocol
,
unsigned
port
)
{
StunAgent
agent
;
StunAgent
oldagent
;
StunAgent
newagent
;
int
sock
=
listen_socket
(
family
,
SOCK_DGRAM
,
protocol
,
htons
(
port
));
if
(
sock
==
-
1
)
return
-
1
;
stun_agent_init
(
&
agent
,
known_attributes
,
stun_agent_init
(
&
oldagent
,
known_attributes
,
STUN_COMPATIBILITY_RFC3489
,
0
);
stun_agent_init
(
&
newagent
,
known_attributes
,
STUN_COMPATIBILITY_RFC5389
,
STUN_AGENT_USAGE_USE_FINGERPRINT
);
for
(;;)
dgram_process
(
sock
,
&
agent
);
dgram_process
(
sock
,
&
oldagent
,
&
new
agent
);
}
...
...
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