Skip to content

Commit

Permalink
fix(multi-transfer): fix issue with sending multi transfer frames
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Feb 16, 2016
1 parent 26e6939 commit 6376e9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/receiver_link.js
Expand Up @@ -175,8 +175,7 @@ ReceiverLink.prototype._messageReceived = function(transferFrame) {
}

// optionally decode message based on policy
var payload = message.body;
message.body = this.policy.decoder ? this.policy.decoder(payload) : payload;
message.body = this.policy.decoder ? this.policy.decoder(message.body) : message.body;
debug('received from (' + this.name + '): ' + message.body);

this.emit(Link.MessageReceived, message);
Expand Down
3 changes: 2 additions & 1 deletion lib/sender_link.js
Expand Up @@ -172,14 +172,15 @@ SenderLink.prototype._sendMessage = function(message, options) {
transferOptions.more = (i !== messageCount - 1) ? true : false;
frame = new frames.TransferFrame(transferOptions);
frame.payload = messageBuffer.slice(bufferIdx, bufferIdx + idealMessageSize);
this.session.connection.sendFrame(frame);
bufferIdx += idealMessageSize;
}
} else {
frame = new frames.TransferFrame(transferOptions);
frame.payload = messageBuffer;
this.session.connection.sendFrame(frame);
}

this.session.connection.sendFrame(frame);
this.linkCredit--;
return messageId;
};
Expand Down

0 comments on commit 6376e9d

Please sign in to comment.