-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: STATUS_PENDING #78
Comments
I've got the same issue, but reading a file.
|
I've resolved with a hack, I don't sure if this is the right way to do it but maybe could help to resolve the problem. SMB2Forge.response = function (c) {
c.responses = {}
c.responsesCB = {}
c.responseBuffer = Buffer.allocUnsafe(0)
return function (response) {
// concat new response
c.responseBuffer = Buffer.concat([c.responseBuffer, response])
// extract complete messages
var extract = true
while (extract) {
extract = false
// has a message header
if (c.responseBuffer.length >= 4) {
// message is complete
var msgLength = (c.responseBuffer.readUInt8(1) << 16) + c.responseBuffer.readUInt16BE(2)
if (c.responseBuffer.length >= msgLength + 4) {
// set the flags
extract = true
// parse message
var r = c.responseBuffer.slice(4, msgLength + 4)
var message = new SMB2Message()
message.parseBuffer(r)
// debug
if (c.debug) {
console.log('--response') // eslint-disable-line no-console
console.log(r.toString('hex')) // eslint-disable-line no-console
}
// get the message id
var mId = message.getHeaders().MessageId.toString('hex')
// check if the message can be dispatched
// or store it
if (c.responsesCB[mId]) { const Status = message.getHeaders().Status.toString('hex')
// Check the error, in case of STATUS_PENDING skip the parsing function
if (Status != '03010000') {
c.responsesCB[mId](message)
delete c.responsesCB[mId]
} } else {
c.responses[mId] = message
}
// remove from response buffer
c.responseBuffer = c.responseBuffer.slice(msgLength + 4)
}
}
}
}
} |
I agree, it appears that this node has issues being executed multiple times, while it's still in use. Therefore I added a delay node before it and change the delay node to limit the rate of messages of 1 per second. Not thrilled that I have to cause a delay, but it works for now. |
I found out the reason is async request. But I don't know how to do.
The text was updated successfully, but these errors were encountered: