Commit 0f1fcb5b authored by Fabrice Marsaud's avatar Fabrice Marsaud Committed by GitHub

Merge pull request #6 from Wescoeur/fix-code-documentation

SMB Create request code documentation.
parents d0ddead4 d86cc29b
......@@ -52,7 +52,7 @@ class SmbWritableStream extends Writable {
const offset = new Bigint(this.offset)
this.offset = this.offset.add(packetSize)
const fiboGen = fibonacci()
const retryInterval = fibonacci()
let pending = true
while (pending) {
......@@ -67,7 +67,7 @@ class SmbWritableStream extends Writable {
} catch (error) {
if (error.code === 'STATUS_PENDING') {
await new Promise((resolve, reject) => {
setTimeout(resolve, fiboGen.next().value)
setTimeout(resolve, retryInterval.next().value)
})
} else {
throw error
......
......@@ -9,6 +9,8 @@ module.exports = message({
var buffer = new Buffer(params.path, 'ucs2');
var createDisposition = params.createDisposition
/* See: https://msdn.microsoft.com/en-us/library/cc246502.aspx
6 values for CreateDisposition. */
if (!(createDisposition >= 0 && createDisposition <= 5)) {
createDisposition = FILE_OVERWRITE_IF
}
......
/* Documentation https://msdn.microsoft.com/en-us/library/cc246497.aspx */
module.exports = {
/* 2.2.13 SMB2 CREATE Request:
https://msdn.microsoft.com/en-us/library/cc246502.aspx */
FILE_SUPERSEDE: 0x00000000,
FILE_OPEN: 0x00000001,
FILE_CREATE: 0x00000002,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment