Commit 313c2cd7 authored by Dafydd Harries's avatar Dafydd Harries

separate STUN message type checking from binding request handling; ignore...

separate STUN message type checking from binding request handling; ignore incoming binding responses

darcs-hash:20070206122212-c9803-018cf714ab31a5fa8ab1fd5513a0f4d948f35e06.gz
parent edfd0065
...@@ -366,7 +366,7 @@ _stream_lookup (NiceAgent *agent, guint stream_id) ...@@ -366,7 +366,7 @@ _stream_lookup (NiceAgent *agent, guint stream_id)
static void static void
_handle_stun ( _handle_stun_binding_request (
NiceAgent *agent, NiceAgent *agent,
Stream *stream, Stream *stream,
NiceCandidate *local, NiceCandidate *local,
...@@ -378,10 +378,6 @@ _handle_stun ( ...@@ -378,10 +378,6 @@ _handle_stun (
gchar *username = NULL; gchar *username = NULL;
NiceCandidate *remote = NULL; NiceCandidate *remote = NULL;
if (msg->type != STUN_MESSAGE_BINDING_REQUEST)
/* XXX: send error response */
return;
/* msg should have either: /* msg should have either:
* *
* Jingle P2P: * Jingle P2P:
...@@ -571,6 +567,31 @@ ERROR: ...@@ -571,6 +567,31 @@ ERROR:
*/ */
} }
static void
_handle_stun (
NiceAgent *agent,
Stream *stream,
NiceCandidate *local,
NiceAddress from,
StunMessage *msg)
{
switch (msg->type)
{
case STUN_MESSAGE_BINDING_REQUEST:
_handle_stun_binding_request (agent, stream, local, from, msg);
break;
case STUN_MESSAGE_BINDING_RESPONSE:
/* XXX: check it matches a request we sent */
break;
default:
/* a message type we don't know how to handle */
/* XXX: send error response */
break;
}
}
static void static void
_nice_agent_recv ( _nice_agent_recv (
NiceAgent *agent, NiceAgent *agent,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment