From bc6ec807186b331b01701bd16d5a7b19b02ba4db Mon Sep 17 00:00:00 2001 From: martynas19942 Date: Wed, 1 Mar 2017 17:40:28 +0200 Subject: [PATCH] Worker does not get jobs if job payload in size ~65480-65510 bytes #55 --- lib/gearmanode/job-server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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')) {