diff --git a/lib/gearmanode/job-server.js b/lib/gearmanode/job-server.js index ce05688..e6da4cb 100644 --- a/lib/gearmanode/job-server.js +++ b/lib/gearmanode/job-server.js @@ -300,12 +300,12 @@ JobServer.prototype._processData = function (chunk) { return; } - if (chunk.length < protocol.CONSTANTS.HEADER_LEN) { // it's only header fragment, the rest should come in next packet + if (chunk.length < protocol.CONSTANTS.HEADER_LEN && chunk[0] == '00') { // it's only header fragment, the rest should come in next packet this.headerfrag = chunk; return; } - if (chunk.readUInt32BE(0) !== protocol.CONSTANTS.HEADER_RESP) { + if (chunk[0] != '00' || chunk.readUInt32BE(0) !== protocol.CONSTANTS.HEADER_RESP) { if (this.hasOwnProperty('segmentedPacket')) { chunk = Buffer.concat([this.segmentedPacket, chunk]); } else if (this.hasOwnProperty('headerfrag')) {