Commit 9d27ed2d authored by Dafydd Harries's avatar Dafydd Harries

remove nice_agent_recv

darcs-hash:20070208153623-c9803-e44549d1eddb5b5a42695ad2a1130e315a0c372d.gz
parent 40d68516
......@@ -308,6 +308,7 @@ nice_agent_add_remote_candidate (
}
#if 0
static NiceCandidate *
_local_candidate_lookup (NiceAgent *agent, guint candidate_id)
{
......@@ -323,6 +324,7 @@ _local_candidate_lookup (NiceAgent *agent, guint candidate_id)
return NULL;
}
#endif
static NiceCandidate *
......@@ -688,35 +690,6 @@ _nice_agent_candidate_recv (
}
/**
* nice_agent_recv:
* @agent: The agent to notify
* @candidate_id: The ID of the candidate that has data waiting on its socket
*
* Tell the agent to try receiving a packet on @candidate's socket. This is
* useful for integrating the agent into a select()-loop. This function will
* block if the socket is blocking.
**/
void
nice_agent_recv (
NiceAgent *agent,
guint candidate_id)
{
NiceCandidate *candidate;
/* XXX: this is a probably a good place to start optimizing, as it gets
* called once for each packet recieved
*/
candidate = _local_candidate_lookup (agent, candidate_id);
if (candidate == NULL)
return;
_nice_agent_candidate_recv (agent, candidate);
}
/**
* nice_agent_component_recv:
* @agent: a NiceAgent
......
......@@ -59,11 +59,6 @@ nice_agent_add_remote_candidate (
gchar *username,
gchar *password);
void
nice_agent_recv (
NiceAgent *agent,
guint candidate_id);
guint
nice_agent_component_recv (
NiceAgent *agent,
......
......@@ -28,9 +28,7 @@ main (void)
{
NiceAgent *agent;
NiceAddress addr = {0,};
NiceCandidate *candidate;
NiceUDPSocketFactory factory;
NiceUDPSocket *sock;
nice_udp_fake_socket_factory_init (&factory);
......@@ -42,11 +40,21 @@ main (void)
g_assert (agent->local_candidates != NULL);
/* recieve an RTP packet */
{
NiceCandidate *candidate;
NiceUDPSocket *sock;
guint len;
gchar buf[1024];
candidate = agent->local_candidates->data;
sock = &(candidate->sock);
nice_udp_fake_socket_push_recv (sock, &addr, 7, "\x80lalala");
nice_agent_recv (agent, candidate->id);
g_assert (cb_called == TRUE);
len = nice_agent_component_recv (agent, candidate->stream_id,
candidate->component_id, 1024, buf);
g_assert (len == 7);
g_assert (0 == strncmp (buf, "\x80lalala", 7));
}
/* clean up */
nice_agent_free (agent);
......
......@@ -43,7 +43,7 @@ send_connectivity_check (
stun_message_free (msg);
}
nice_agent_recv (agent, 1);
nice_agent_poll_read (agent, NULL);
{
StunMessage *msg;
......
......@@ -48,7 +48,7 @@ test_stun_no_password (
}
/* tell the agent there's a packet waiting */
nice_agent_recv (agent, candidate->id);
nice_agent_poll_read (agent, NULL);
/* error response should have been sent */
len = nice_udp_fake_socket_pop_send (sock, &to, sizeof (buf) / sizeof (gchar),
......@@ -104,7 +104,7 @@ test_stun_invalid_password (
}
/* tell the agent there's a packet waiting */
nice_agent_recv (agent, candidate->id);
nice_agent_poll_read (agent, NULL);
/* error should have been sent */
len = nice_udp_fake_socket_pop_send (sock, &to, sizeof (buf) / sizeof (gchar),
......@@ -182,7 +182,7 @@ test_stun_valid_password (
g_free (username);
/* tell the agent there's a packet waiting */
nice_agent_recv (agent, candidate->id);
nice_agent_poll_read (agent, NULL);
/* compare sent packet to expected */
len = nice_udp_fake_socket_pop_send (sock, &to,
......
......@@ -14,7 +14,6 @@ T nice_agent_free
T nice_agent_get_local_candidates
T nice_agent_new
T nice_agent_poll_read
T nice_agent_recv
T nice_agent_send
T nice_candidate_free
T nice_candidate_ice_priority
......
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