Commit 377340e5 authored by Youness Alaoui's avatar Youness Alaoui

Check if the alternate_server is given in the bind_process, so it can now be...

Check if the alternate_server is given in the bind_process, so it can now be set to NULL if you don't want it.
parent 50cf7c0d
......@@ -93,10 +93,17 @@ StunUsageBindReturn stun_usage_bind_process (StunMessage *msg,
/* ALTERNATE-SERVER mechanism */
if ((code / 100) == 3) {
if (stun_message_find_addr (msg, STUN_ATTRIBUTE_ALTERNATE_SERVER,
alternate_server, alternate_server_len)) {
stun_debug (" Unexpectedly missing ALTERNATE-SERVER attribute\n");
return STUN_USAGE_BIND_RETURN_ERROR;
if (alternate_server && alternate_server_len) {
if (stun_message_find_addr (msg, STUN_ATTRIBUTE_ALTERNATE_SERVER,
alternate_server, alternate_server_len)) {
stun_debug (" Unexpectedly missing ALTERNATE-SERVER attribute\n");
return STUN_USAGE_BIND_RETURN_ERROR;
}
} else {
if (!stun_message_has_attribute (msg, STUN_ATTRIBUTE_ALTERNATE_SERVER)) {
stun_debug (" Unexpectedly missing ALTERNATE-SERVER attribute\n");
return STUN_USAGE_BIND_RETURN_ERROR;
}
}
stun_debug ("Found alternate server\n");
......
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