We are currently experiencing downtime impacting viewing & cloning the Mesa repo, and some GitLab pages returning 503. Please see #freedesktop on IRC for more updates.

Commit 920e299a authored by Olivier Crête's avatar Olivier Crête 👻

agent: Remove useless checks in io_ctx_new

parent 6fe9b797
...@@ -1294,7 +1294,7 @@ agent_candidate_pair_priority (NiceAgent *agent, NiceCandidate *local, NiceCandi ...@@ -1294,7 +1294,7 @@ agent_candidate_pair_priority (NiceAgent *agent, NiceCandidate *local, NiceCandi
return nice_candidate_pair_priority (remote->priority, local->priority); return nice_candidate_pair_priority (remote->priority, local->priority);
} }
static gboolean static void
priv_add_new_candidate_discovery_stun (NiceAgent *agent, priv_add_new_candidate_discovery_stun (NiceAgent *agent,
NiceSocket *socket, NiceAddress server, NiceSocket *socket, NiceAddress server,
Stream *stream, guint component_id) Stream *stream, guint component_id)
...@@ -1320,11 +1320,9 @@ priv_add_new_candidate_discovery_stun (NiceAgent *agent, ...@@ -1320,11 +1320,9 @@ priv_add_new_candidate_discovery_stun (NiceAgent *agent,
agent->discovery_list = g_slist_append (agent->discovery_list, cdisco); agent->discovery_list = g_slist_append (agent->discovery_list, cdisco);
++agent->discovery_unsched_items; ++agent->discovery_unsched_items;
return TRUE;
} }
static gboolean static void
priv_add_new_candidate_discovery_turn (NiceAgent *agent, priv_add_new_candidate_discovery_turn (NiceAgent *agent,
NiceSocket *socket, TurnServer *turn, NiceSocket *socket, TurnServer *turn,
Stream *stream, guint component_id) Stream *stream, guint component_id)
...@@ -1391,8 +1389,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent, ...@@ -1391,8 +1389,7 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
agent_to_turn_socket_compatibility (agent)); agent_to_turn_socket_compatibility (agent));
if (!cdisco->nicesock) { if (!cdisco->nicesock) {
g_slice_free (CandidateDiscovery, cdisco); g_error ("Could not create tcp turn socket");
return FALSE;
} }
agent_attach_stream_component_socket (agent, stream, agent_attach_stream_component_socket (agent, stream,
...@@ -1429,8 +1426,6 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent, ...@@ -1429,8 +1426,6 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
agent, cdisco); agent, cdisco);
agent->discovery_list = g_slist_append (agent->discovery_list, cdisco); agent->discovery_list = g_slist_append (agent->discovery_list, cdisco);
++agent->discovery_unsched_items; ++agent->discovery_unsched_items;
return TRUE;
} }
NICEAPI_EXPORT guint NICEAPI_EXPORT guint
...@@ -1772,20 +1767,13 @@ nice_agent_gather_candidates ( ...@@ -1772,20 +1767,13 @@ nice_agent_gather_candidates (
agent->stun_server_ip) { agent->stun_server_ip) {
NiceAddress stun_server; NiceAddress stun_server;
if (nice_address_set_from_string (&stun_server, agent->stun_server_ip)) { if (nice_address_set_from_string (&stun_server, agent->stun_server_ip)) {
gboolean res;
nice_address_set_port (&stun_server, agent->stun_server_port); nice_address_set_port (&stun_server, agent->stun_server_port);
res = priv_add_new_candidate_discovery_stun (agent,
priv_add_new_candidate_discovery_stun (agent, host_candidate->sockptr,
host_candidate->sockptr, stun_server,
stun_server, stream,
stream, n + 1);
n + 1);
if (res != TRUE) {
/* note: memory allocation failure, return error */
g_error ("Memory allocation failure?");
}
} }
} }
...@@ -1795,17 +1783,11 @@ nice_agent_gather_candidates ( ...@@ -1795,17 +1783,11 @@ nice_agent_gather_candidates (
for (item = component->turn_servers; item; item = item->next) { for (item = component->turn_servers; item; item = item->next) {
TurnServer *turn = item->data; TurnServer *turn = item->data;
gboolean res = priv_add_new_candidate_discovery_turn (agent,
priv_add_new_candidate_discovery_turn (agent, host_candidate->sockptr,
host_candidate->sockptr, turn,
turn, stream,
stream, n + 1);
n + 1);
if (res != TRUE) {
/* note: memory allocation failure, return error */
g_error ("Memory allocation failure?");
}
} }
} }
} }
...@@ -2440,14 +2422,13 @@ io_ctx_new ( ...@@ -2440,14 +2422,13 @@ io_ctx_new (
IOCtx *ctx; IOCtx *ctx;
ctx = g_slice_new0 (IOCtx); ctx = g_slice_new0 (IOCtx);
if (ctx) { ctx->agent = agent;
ctx->agent = agent; ctx->stream = stream;
ctx->stream = stream; ctx->component = component;
ctx->component = component; ctx->socket = socket;
ctx->socket = socket; ctx->channel = channel;
ctx->channel = channel; ctx->source = source;
ctx->source = source;
}
return ctx; return ctx;
} }
......
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