Commit 84c330b2 authored by Dafydd Harries's avatar Dafydd Harries
Browse files

agent: use stun_message_find_attribute ()

darcs-hash:20070316070638-c9803-2189e68b176266f00b4e51a5a918144c9a6aacfa.gz
parent b92c102f
......@@ -479,7 +479,7 @@ _handle_stun_binding_request (
StunMessage *msg)
{
GSList *i;
StunAttribute **attr;
StunAttribute *attr;
gchar *username = NULL;
NiceCandidate *remote = NULL;
......@@ -510,18 +510,14 @@ _handle_stun_binding_request (
* --> send error
*/
if (msg->attributes)
for (attr = msg->attributes; *attr; attr++)
if ((*attr)->type == STUN_ATTRIBUTE_USERNAME)
{
username = (*attr)->username;
break;
}
attr = stun_message_find_attribute (msg, STUN_ATTRIBUTE_USERNAME);
if (username == NULL)
if (attr == NULL)
/* no username attribute found */
goto ERROR;
username = attr->username;
/* validate username */
/* XXX: Should first try and find a remote candidate with a matching
* transport address, and fall back to matching on username only after that.
......
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