Commit a5315715 authored by Olivier Crête's avatar Olivier Crête

agent: Bail out early on empty message

This can happen if a lower layer has consumed the message, bail out earlier in
that case.
parent 75fbbb4c
......@@ -2726,7 +2726,12 @@ agent_recv_message_unlocked (
goto done;
}
if (nice_debug_is_enabled () && message->length > 0) {
if (retval == RECV_OOB || message->length == 0) {
retval = RECV_OOB;
goto done;
}
if (nice_debug_is_enabled ()) {
gchar tmpbuf[INET6_ADDRSTRLEN];
nice_address_to_string (message->from, tmpbuf);
nice_debug ("Agent %p : Packet received on local socket %d from [%s]:%u (%" G_GSSIZE_FORMAT " octets).", agent,
......@@ -2750,11 +2755,16 @@ agent_recv_message_unlocked (
if (cand->type == NICE_CANDIDATE_TYPE_RELAYED &&
cand->stream_id == stream->id &&
cand->component_id == component->id) {
nice_turn_socket_parse_recv_message (cand->sockptr, &socket, message);
retval = nice_turn_socket_parse_recv_message (cand->sockptr, &socket,
message);
break;
}
}
}
if (retval == RECV_OOB)
goto done;
agent->media_after_tick = TRUE;
/* If the message’s stated length is equal to its actual length, it’s probably
......@@ -2806,7 +2816,7 @@ agent_recv_message_unlocked (
nice_debug ("%s: Queued %" G_GSSIZE_FORMAT " bytes for agent %p.",
G_STRFUNC, vec->size, agent);
return 0;
return RECV_OOB;
} else {
process_queued_tcp_packets (agent, stream, component);
}
......
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