Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #403 from paularmand/fix/packet_newpacket
Browse files Browse the repository at this point in the history
using newPacket instead of packet for publish
  • Loading branch information
mcollina committed Feb 22, 2016
2 parents 08a5b2c + 5def440 commit 6d5fc48
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,22 +344,22 @@ Server.prototype.publish = function publish(packet, client, callback) {

that.storePacket(newPacket, function() {
if (that.closed) {
logger.debug({ packet: packet }, "not delivering because we are closed");
logger.debug({ packet: newPacket }, "not delivering because we are closed");
return;
}

that.ascoltatore.publish(
packet.topic,
packet.payload,
newPacket.topic,
newPacket.payload,
opts,
function() {
that.published(packet, client, function() {
if( packet.topic.indexOf( '$SYS' ) >= 0 ) {
logger.trace({ packet: packet }, "published packet");
that.published(newPacket, client, function() {
if( newPacket.topic.indexOf( '$SYS' ) >= 0 ) {
logger.trace({ packet: newPacket }, "published packet");
} else {
logger.debug({ packet: packet }, "published packet");
logger.debug({ packet: newPacket }, "published packet");
}
that.emit("published", packet, client);
that.emit("published", newPacket, client);
callback();
});
}
Expand Down

0 comments on commit 6d5fc48

Please sign in to comment.