Warn about failing to encode hexified string.

Do not encode the element into the ASN.1 payload if the encoding of the hexified string fails.



git-svn-id: http://yate.null.ro/svn/yate/trunk@5424 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
oana 2013-03-21 12:36:15 +00:00
parent 210494aa15
commit f3a7c8f061
1 changed files with 4 additions and 1 deletions

View File

@ -992,7 +992,10 @@ static bool encodeHex(const Parameter* param, MapCamelType* type, DataBlock& dat
return false;
XDebug(&__plugin,DebugAll,"encodeHexparam=%s[%p],elem=%s[%p])",param->name.c_str(),param,elem->getTag().c_str(),elem);
const String& text = elem->getText();
data.unHexify(text.c_str(),text.length(),' ');
if (!data.unHexify(text.c_str(),text.length(),' ')) {
Debug(&__plugin,DebugWarn,"Failed to parse hexified string '%s'",text.c_str());
return false;
}
data.insert(ASNLib::buildLength(data));
data.insert(param->tag.coding());;
return true;