Use returned string of monitor.query message if "value" parameter is not set.

Removed an unnecessary string copy.


git-svn-id: http://voip.null.ro/svn/yate@5648 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2013-09-11 12:57:08 +00:00
parent 15908020fd
commit 90112ddece
1 changed files with 5 additions and 3 deletions

View File

@ -2879,9 +2879,11 @@ AsnValue SnmpAgent::makeQuery(const String& query, unsigned int& index, AsnMib*
msg.addParam("name",query);
msg.addParam("index",String(index));
if (Engine::dispatch(msg)) {
String value = msg.getValue("value","");
if (!value.null()) {
val.setValue(value);
const String* value = msg.getParam(YSTRING("value"));
if (!value)
value = &msg.retValue();
if (*value) {
val.setValue(*value);
val.setType(STRING);
}
}