Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _safe_decode_message_body(fullMessageBody: Buffer, objMessage: any, binaryStream: BinaryStream) {
try {
// de-serialize the object from the binary stream
const options = this.objectFactory;
objMessage.decode(binaryStream, options);
} catch (err) {
console.log(err);
console.log(err.stack);
console.log(hexDump(fullMessageBody));
analyseExtensionObject(fullMessageBody, 0, 0);
console.log(" ---------------- block");
let i = 0;
this.messageChunks.forEach((messageChunk) => {
console.log(" ---------------- chunk i=", i++);
console.log(hexDump(messageChunk));
});
return false;
}
return true;
}
}
}
assert(replies.length >= 1, " expecting at least one reply " + JSON.stringify(reply));
replies.forEach((reply1: any) => {
debugLog("\nFAKE SERVER SEND");
debugLog(chalk.red(hexDump(reply1)));
this._mockTransport.server.write(reply1);
});
} else {
const msg = " MockServerTransport has no more packets to send to client to" +
" emulate server responses.... ";
console.log(chalk.red.bold(msg));
console.log(chalk.blue.bold(hexDump(data)));
display_trace_from_this_projet_only();
analyseExtensionObject(data, 0, 0, {});
this.emit("done");
}
});
}
messageBuilder.on("full_message_body", (fullMessageBody: Buffer) => {
console.log("full_message_body received:");
analyseExtensionObject(fullMessageBody, 0, 0);
});
messageBuilder.on("start_chunk", (info) => {