Author: sayer
Date: 2009-02-10 23:42:05 +0100 (Tue, 10 Feb 2009)
New Revision: 1267
Modified:
trunk/apps/monitoring/Monitoring.cpp
Log:
convert into array if necessary on logAdd
Modified: trunk/apps/monitoring/Monitoring.cpp
===================================================================
--- trunk/apps/monitoring/Monitoring.cpp 2009-02-10 15:35:11 UTC (rev
1266)
+++ trunk/apps/monitoring/Monitoring.cpp 2009-02-10 22:42:05 UTC (rev
1267)
@@ -123,10 +123,14 @@
LogBucket& bucket = getLogBucket(args[0].asCStr());
bucket.log_lock.lock();
try {
- bucket.log[args[0].asCStr()].info[args[1].asCStr()].push(AmArg(args[2]));
+ AmArg& val = bucket.log[args[0].asCStr()].info[args[1].asCStr()];
+ if (!isArgArray(val)) {
+ AmArg v1 = val;
+ val = AmArg();
+ val.push(v1);
+ }
+ val.push(AmArg(args[2]));
} catch (...) {
- ret.push(-1);
- ret.push("ERROR while converting value");
bucket.log_lock.unlock();
throw;
}
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev