Skip to content

Commit

Permalink
Check if packet is type 'publish'. Also, remove from the outgoing que…
Browse files Browse the repository at this point in the history
…ue only when the client is not clean
  • Loading branch information
cristi authored and cristi committed Apr 27, 2016
1 parent 9d97374 commit 473a33f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ function Client (broker, conn) {
}

this.deliverQoS = function deliverQoS (_packet, cb) {
var _toForward = _packet;
if(_packet.cmd === 'publish'){
var _toForward = _packet
if (_packet.cmd === 'publish') {
_toForward = that.broker.authorizeForward(that, _packet)
if (!_toForward) {
if(that.clean === false){
if (that.clean === false) {
that.broker.persistence.outgoingClearMessageId(that, _packet, nop)
}
// we consider this to be an error, since the packet is undefined, so there's nothing to send
Expand Down

0 comments on commit 473a33f

Please sign in to comment.