summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2014-04-22 20:13:52 (GMT)
committerOlivier CrĂȘte <olivier.crete@collabora.com>2014-04-25 01:04:30 (GMT)
commit59a23cfee39624cf5f7d6289294f545191c1c4c4 (patch)
treec0d1c7a17e64b53937dec58c3c05c925a1a8b25e
parent25effd7e11f55bfabb69f570348e4df8d4e3203f (diff)
downloadlibnice-59a23cfee39624cf5f7d6289294f545191c1c4c4.tar.gz
libnice-59a23cfee39624cf5f7d6289294f545191c1c4c4.tar.xz
discovery: Remove duplicated element between CandidateRefresh and NiceCandidate
-rw-r--r--agent/conncheck.c15
-rw-r--r--agent/discovery.c8
-rw-r--r--agent/discovery.h2
3 files changed, 11 insertions, 14 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 8d84a53..90d5bd0 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -798,10 +798,10 @@ static void priv_turn_allocate_refresh_tick_unlocked (CandidateRefresh *cand)
StunUsageTurnCompatibility turn_compat =
agent_to_turn_compatibility (cand->agent);
- username = (uint8_t *)cand->turn->username;
- username_len = (size_t) strlen (cand->turn->username);
- password = (uint8_t *)cand->turn->password;
- password_len = (size_t) strlen (cand->turn->password);
+ username = (uint8_t *)cand->candidate->turn->username;
+ username_len = (size_t) strlen (cand->candidate->turn->username);
+ password = (uint8_t *)cand->candidate->turn->password;
+ password_len = (size_t) strlen (cand->candidate->turn->password);
if (turn_compat == STUN_USAGE_TURN_COMPATIBILITY_MSN ||
turn_compat == STUN_USAGE_TURN_COMPATIBILITY_OC2007) {
@@ -2333,9 +2333,7 @@ priv_add_new_turn_refresh (CandidateDiscovery *cdisco, NiceCandidate *relay_cand
cand->candidate = relay_cand;
cand->nicesock = cdisco->nicesock;
- cand->relay_socket = relay_cand->sockptr;
cand->server = cdisco->server;
- cand->turn = cdisco->turn;
cand->stream = cdisco->stream;
cand->component = cdisco->component;
cand->agent = cdisco->agent;
@@ -2803,9 +2801,10 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
for (i = agent->refresh_list; i; i = i->next) {
CandidateRefresh *r = i->data;
nice_debug ("Comparing %p to %p, %p to %p and %p and %p to %p", r->stream,
- stream, r->component, component, r->nicesock, r->relay_socket, nicesock);
+ stream, r->component, component, r->nicesock, r->candidate->sockptr,
+ nicesock);
if (r->stream == stream && r->component == component &&
- (r->nicesock == nicesock || r->relay_socket == nicesock)) {
+ (r->nicesock == nicesock || r->candidate->sockptr == nicesock)) {
valid = stun_agent_validate (&r->stun_agent, &req,
(uint8_t *) buf, len, conncheck_stun_validater, &validater_data);
nice_debug ("Validating gave %d", valid);
diff --git a/agent/discovery.c b/agent/discovery.c
index 2d9c975..516e2cc 100644
--- a/agent/discovery.c
+++ b/agent/discovery.c
@@ -155,10 +155,10 @@ void refresh_free_item (gpointer data, gpointer user_data)
cand->tick_source = NULL;
}
- username = (uint8_t *)cand->turn->username;
- username_len = (size_t) strlen (cand->turn->username);
- password = (uint8_t *)cand->turn->password;
- password_len = (size_t) strlen (cand->turn->password);
+ username = (uint8_t *)cand->candidate->turn->username;
+ username_len = (size_t) strlen (cand->candidate->turn->username);
+ password = (uint8_t *)cand->candidate->turn->password;
+ password_len = (size_t) strlen (cand->candidate->turn->password);
if (turn_compat == STUN_USAGE_TURN_COMPATIBILITY_MSN ||
turn_compat == STUN_USAGE_TURN_COMPATIBILITY_OC2007) {
diff --git a/agent/discovery.h b/agent/discovery.h
index 5f228ff..b72e941 100644
--- a/agent/discovery.h
+++ b/agent/discovery.h
@@ -70,12 +70,10 @@ typedef struct
{
NiceAgent *agent; /**< back pointer to owner */
NiceSocket *nicesock; /**< existing socket to use */
- NiceSocket *relay_socket; /**< relay socket from which we receive */
NiceAddress server; /**< STUN/TURN server address */
NiceCandidate *candidate; /**< candidate to refresh */
Stream *stream;
Component *component;
- TurnServer *turn;
StunAgent stun_agent;
GSource *timer_source;
GSource *tick_source;