Commit 59a23cfe authored by Olivier Crête's avatar Olivier Crête

discovery: Remove duplicated element between CandidateRefresh and NiceCandidate

parent 25effd7e
...@@ -798,10 +798,10 @@ static void priv_turn_allocate_refresh_tick_unlocked (CandidateRefresh *cand) ...@@ -798,10 +798,10 @@ static void priv_turn_allocate_refresh_tick_unlocked (CandidateRefresh *cand)
StunUsageTurnCompatibility turn_compat = StunUsageTurnCompatibility turn_compat =
agent_to_turn_compatibility (cand->agent); agent_to_turn_compatibility (cand->agent);
username = (uint8_t *)cand->turn->username; username = (uint8_t *)cand->candidate->turn->username;
username_len = (size_t) strlen (cand->turn->username); username_len = (size_t) strlen (cand->candidate->turn->username);
password = (uint8_t *)cand->turn->password; password = (uint8_t *)cand->candidate->turn->password;
password_len = (size_t) strlen (cand->turn->password); password_len = (size_t) strlen (cand->candidate->turn->password);
if (turn_compat == STUN_USAGE_TURN_COMPATIBILITY_MSN || if (turn_compat == STUN_USAGE_TURN_COMPATIBILITY_MSN ||
turn_compat == STUN_USAGE_TURN_COMPATIBILITY_OC2007) { turn_compat == STUN_USAGE_TURN_COMPATIBILITY_OC2007) {
...@@ -2333,9 +2333,7 @@ priv_add_new_turn_refresh (CandidateDiscovery *cdisco, NiceCandidate *relay_cand ...@@ -2333,9 +2333,7 @@ priv_add_new_turn_refresh (CandidateDiscovery *cdisco, NiceCandidate *relay_cand
cand->candidate = relay_cand; cand->candidate = relay_cand;
cand->nicesock = cdisco->nicesock; cand->nicesock = cdisco->nicesock;
cand->relay_socket = relay_cand->sockptr;
cand->server = cdisco->server; cand->server = cdisco->server;
cand->turn = cdisco->turn;
cand->stream = cdisco->stream; cand->stream = cdisco->stream;
cand->component = cdisco->component; cand->component = cdisco->component;
cand->agent = cdisco->agent; cand->agent = cdisco->agent;
...@@ -2803,9 +2801,10 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, ...@@ -2803,9 +2801,10 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
for (i = agent->refresh_list; i; i = i->next) { for (i = agent->refresh_list; i; i = i->next) {
CandidateRefresh *r = i->data; CandidateRefresh *r = i->data;
nice_debug ("Comparing %p to %p, %p to %p and %p and %p to %p", r->stream, 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 && 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, valid = stun_agent_validate (&r->stun_agent, &req,
(uint8_t *) buf, len, conncheck_stun_validater, &validater_data); (uint8_t *) buf, len, conncheck_stun_validater, &validater_data);
nice_debug ("Validating gave %d", valid); nice_debug ("Validating gave %d", valid);
......
...@@ -155,10 +155,10 @@ void refresh_free_item (gpointer data, gpointer user_data) ...@@ -155,10 +155,10 @@ void refresh_free_item (gpointer data, gpointer user_data)
cand->tick_source = NULL; cand->tick_source = NULL;
} }
username = (uint8_t *)cand->turn->username; username = (uint8_t *)cand->candidate->turn->username;
username_len = (size_t) strlen (cand->turn->username); username_len = (size_t) strlen (cand->candidate->turn->username);
password = (uint8_t *)cand->turn->password; password = (uint8_t *)cand->candidate->turn->password;
password_len = (size_t) strlen (cand->turn->password); password_len = (size_t) strlen (cand->candidate->turn->password);
if (turn_compat == STUN_USAGE_TURN_COMPATIBILITY_MSN || if (turn_compat == STUN_USAGE_TURN_COMPATIBILITY_MSN ||
turn_compat == STUN_USAGE_TURN_COMPATIBILITY_OC2007) { turn_compat == STUN_USAGE_TURN_COMPATIBILITY_OC2007) {
......
...@@ -70,12 +70,10 @@ typedef struct ...@@ -70,12 +70,10 @@ typedef struct
{ {
NiceAgent *agent; /**< back pointer to owner */ NiceAgent *agent; /**< back pointer to owner */
NiceSocket *nicesock; /**< existing socket to use */ NiceSocket *nicesock; /**< existing socket to use */
NiceSocket *relay_socket; /**< relay socket from which we receive */
NiceAddress server; /**< STUN/TURN server address */ NiceAddress server; /**< STUN/TURN server address */
NiceCandidate *candidate; /**< candidate to refresh */ NiceCandidate *candidate; /**< candidate to refresh */
Stream *stream; Stream *stream;
Component *component; Component *component;
TurnServer *turn;
StunAgent stun_agent; StunAgent stun_agent;
GSource *timer_source; GSource *timer_source;
GSource *tick_source; GSource *tick_source;
......
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