<commit_before>'use strict'

var Packet = require('aedes-packet')
var util = require('util')

function QoSPacket (original, client) {
  Packet.call(this, original, client.broker)

  this.writeCallback = nop

  if (!original.messageId) {
    this.messageId = client._nextId
    if (client._nextId === 65535) {
      client._nextId = 0
    } else {
      client._nextId++
    }
  } else {
    this.messageId = original.messageId
  }
}

util.inherits(QoSPacket, Packet)

function nop () {}

module.exports = QoSPacket
<commit_msg>Non-Zero MessageID when QoS > 0 (#251)<commit_after>'use strict'

var Packet = require('aedes-packet')
var util = require('util')

function QoSPacket (original, client) {
  Packet.call(this, original, client.broker)

  this.writeCallback = nop

  if (!original.messageId) {
    this.messageId = client._nextId
    if (client._nextId === 65535) {
      client._nextId = 1
    } else {
      client._nextId++
    }
  } else {
    this.messageId = original.messageId
  }
}

util.inherits(QoSPacket, Packet)

function nop () {}

module.exports = QoSPacket

{'fraction_non_alphanumeric': 0.13067655236329936, 'fraction_numerical': 0.014828544949026877, 'mean_word_length': 3.3548387096774195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4693431', 'n_tokens_mistral': 394, 'n_tokens_neox': 367, 'n_words': 79}