Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pass initial offset to unmarshall to be able to calculate alignment

  • Loading branch information...
commit 539dc46091a7147e38ba413fa7cafcecadfd4003 1 parent 195b09c
@sidorares authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/message.js
  2. +2 −2 lib/unmarshall.js
View
4 lib/message.js
@@ -8,7 +8,7 @@ var constants = require('./constants');
var read = module.exports.read = function(dbus, opts) {
var binarystream = this;
- unmarshall.call(binarystream, constants.messageSignature, function(err, data) {
+ unmarshall.call(binarystream, constants.messageSignature, 0, function(err, data) {
if (err)
return dbus.emit('error', err);
@@ -53,7 +53,7 @@ var read = module.exports.read = function(dbus, opts) {
binarystream.buffer('bodyBuffer', bodyLength).tap(function(vars) {
var bodyStream = binary(vars.bodyBuffer);
- unmarshall.call(bodyStream, message.signature, function(err, data) {
+ unmarshall.call(bodyStream, message.signature, binarystream.globalOffset+4, function(err, data) {
if (err)
dbus.emit('error', err); // TODO: throw error instead of firing event?
message.body = data;
View
4 lib/unmarshall.js
@@ -4,12 +4,12 @@ var parseSignature = require('./signature');
var assert = require('assert');
//var constants = require('./constants');
-var exports = module.exports = function (signature, callback) {
+var exports = module.exports = function (signature, offset, callback) {
var bs = this;
if (signature === "")
return callback(null, null);
var args = parseSignature(signature);
- bs.globalOffset = 0;
+ bs.globalOffset = offset;
readStruct(bs, args, callback);
};
Please sign in to comment.
Something went wrong with that request. Please try again.