Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from martynsmith/master

Fixed multiple-messages per packet parsing failure
  • Loading branch information...
commit 5230b53e1098358524d9f286643cfe87ab2e998f 2 parents 1cb0bf9 + a2fc60a
@slyons authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/collectd/protocol.js
View
10 lib/collectd/protocol.js
@@ -205,13 +205,21 @@ function interpret_results(results){
break;
case TYPE_VALUES:
v.data = obj[1];
- val_objects.push(v);
+ val_objects.push(clone(v));
break;
};
});
return [val_objects, notifications];
}
+function clone(obj) {
+ var new_obj = {};
+ Object.keys(obj).forEach(function(key) {
+ new_obj[key] = obj[key];
+ });
+ return new_obj;
+}
+
exports.collectd_parse = function decode_network_packet(buf){
var results = new Array();
var current_object = null;
Please sign in to comment.
Something went wrong with that request. Please try again.