Commit edfd0065 authored by Dafydd Harries's avatar Dafydd Harries

split out stream lookup from _nice_agent_recv

darcs-hash:20070206120957-c9803-bf90664d67d871b8d1b11cd9b4e65aaa5707f6fb.gz
parent 100efcd2
......@@ -574,6 +574,7 @@ ERROR:
static void
_nice_agent_recv (
NiceAgent *agent,
Stream *stream,
NiceCandidate *candidate)
{
guint len;
......@@ -609,14 +610,6 @@ _nice_agent_recv (
* version number is 2. The top two bits of a STUN message are always 0.
*/
Stream *stream;
stream = _stream_lookup (agent, candidate->stream_id);
if (stream == NULL)
/* odd: a candidate that doesn't belong to a stream */
return;
if ((buf[0] & 0xc0) == 0x80)
{
/* looks like RTP */
......@@ -648,6 +641,23 @@ _nice_agent_recv (
}
static void
_nice_agent_candidate_recv (
NiceAgent *agent,
NiceCandidate *candidate)
{
Stream *stream;
stream = _stream_lookup (agent, candidate->stream_id);
if (stream == NULL)
/* odd: a candidate that doesn't belong to a stream */
return;
_nice_agent_recv (agent, stream, candidate);
}
/**
* nice_agent_recv:
* @agent: The agent to notify
......@@ -673,7 +683,7 @@ nice_agent_recv (
if (candidate == NULL)
return;
_nice_agent_recv (agent, candidate);
_nice_agent_candidate_recv (agent, candidate);
}
......@@ -739,7 +749,7 @@ nice_agent_poll_read (NiceAgent *agent, GSList *other_fds)
NiceCandidate *candidate = i->data;
if (candidate->sock.fileno == j)
_nice_agent_recv (agent, candidate);
_nice_agent_candidate_recv (agent, candidate);
}
}
......
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