From 90112ddece2f4a662e8344a71887979394008032 Mon Sep 17 00:00:00 2001 From: paulc Date: Wed, 11 Sep 2013 12:57:08 +0000 Subject: [PATCH] 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 --- modules/server/ysnmpagent.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/server/ysnmpagent.cpp b/modules/server/ysnmpagent.cpp index b8bbf536..2cdfaa41 100644 --- a/modules/server/ysnmpagent.cpp +++ b/modules/server/ysnmpagent.cpp @@ -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); } }