Commit 071da345 authored by Youness Alaoui's avatar Youness Alaoui

do not send BANDWIDTH and LIFETIME when value is -1, not 0 since 0 is valid

parent a3eb3147
......@@ -68,7 +68,7 @@ size_t stun_usage_turn_create (StunAgent *agent, StunMessage *msg,
uint8_t *buffer, size_t buffer_len,
StunMessage *previous_response,
uint32_t request_props,
uint32_t bandwidth, uint32_t lifetime,
int32_t bandwidth, int32_t lifetime,
uint8_t *username, size_t username_len,
uint8_t *password, size_t password_len,
StunUsageTurnCompatibility compatibility)
......@@ -79,7 +79,7 @@ size_t stun_usage_turn_create (StunAgent *agent, StunMessage *msg,
if (stun_message_append32 (msg, STUN_ATTRIBUTE_REQUESTED_TRANSPORT,
TURN_REQUESTED_TRANSPORT_UDP) != 0)
return 0;
if (bandwidth > 0) {
if (bandwidth >= 0) {
if (stun_message_append32 (msg, STUN_ATTRIBUTE_BANDWIDTH, bandwidth) != 0)
return 0;
}
......
......@@ -75,7 +75,7 @@ size_t stun_usage_turn_create (StunAgent *agent, StunMessage *msg,
uint8_t *buffer, size_t buffer_len,
StunMessage *previous_request,
uint32_t request_ports,
uint32_t bandwidth, uint32_t lifetime,
int32_t bandwidth, int32_t lifetime,
uint8_t *username, size_t username_len,
uint8_t *password, size_t password_len,
StunUsageTurnCompatibility compatibility);
......
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