Skip to content

Commit

Permalink
Worker does not get jobs if job payload in size ~65480-65510 bytes ve…
Browse files Browse the repository at this point in the history
  • Loading branch information
martynas19942 committed Mar 1, 2017
1 parent f3fa6c9 commit bc6ec80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/gearmanode/job-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit bc6ec80

Please sign in to comment.