Commit a02f26a0 authored by aymeric's avatar aymeric

Fix padding for error-code attribute

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@288 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 2fa7b796
......@@ -844,12 +844,24 @@ encodeAtrChangeRequest(char* ptr, const StunAtrChangeRequest *atr)
static char*
encodeAtrError(char* ptr, const StunAtrError *atr)
{
int padding;
int i;
ptr = encode16(ptr, SA_ERRORCODE);
ptr = encode16(ptr, 4 + atr->sizeReason);
ptr = encode16(ptr, atr->pad);
*ptr++ = atr->errorClass;
*ptr++ = atr->number;
ptr = encode(ptr, atr->reason, atr->sizeReason);
padding = (atr->sizeReason+4) % 4;
if (padding>0)
{
for (i=0;i<4-padding;i++)
{
*ptr++ = 0;
}
}
return ptr;
}
......
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