Commit 9bc0702e authored by Youness Alaoui's avatar Youness Alaoui

only create the unknown-attributes error if we are going to send it

parent eee6c8ae
...@@ -2714,14 +2714,13 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream, ...@@ -2714,14 +2714,13 @@ gboolean conn_check_handle_inbound_stun (NiceAgent *agent, Stream *stream,
if (valid == STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE) { if (valid == STUN_VALIDATION_UNKNOWN_REQUEST_ATTRIBUTE) {
nice_debug ("Agent %p : Unknown mandatory attributes in message.", agent); nice_debug ("Agent %p : Unknown mandatory attributes in message.", agent);
rbuf_len = stun_agent_build_unknown_attributes_error (&agent->stun_agent,
&msg, rbuf, rbuf_len, &req);
if (len == 0)
return FALSE;
if (agent->compatibility != NICE_COMPATIBILITY_MSN && if (agent->compatibility != NICE_COMPATIBILITY_MSN &&
agent->compatibility != NICE_COMPATIBILITY_OC2007) { agent->compatibility != NICE_COMPATIBILITY_OC2007) {
nice_socket_send (socket, from, rbuf_len, (const gchar*)rbuf); rbuf_len = stun_agent_build_unknown_attributes_error (&agent->stun_agent,
&msg, rbuf, rbuf_len, &req);
if (rbuf_len != 0)
nice_socket_send (socket, from, rbuf_len, (const gchar*)rbuf);
} }
return TRUE; return TRUE;
} }
......
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