mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Fix padding for error-code attribute
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@288 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
2fa7b79653
commit
a02f26a025
1 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue