Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Marsaud Smb2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Marsaud Smb2
Commits
0be24899
Commit
0be24899
authored
Mar 02, 2016
by
wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start/end options are supported by writable/readable streams.
parent
a9d7fd11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
lib/api/src/createReadStream.js
lib/api/src/createReadStream.js
+14
-3
lib/api/src/createWriteStream.js
lib/api/src/createWriteStream.js
+9
-3
No files found.
lib/api/src/createReadStream.js
View file @
0be24899
...
...
@@ -8,12 +8,19 @@ const requestAsync = Bluebird.promisify(request)
const
maxPacketSize
=
0x00010000
class
SmbReadableStream
extends
Readable
{
constructor
(
connection
,
file
,
options
)
{
constructor
(
connection
,
file
,
options
=
{}
)
{
super
(
options
)
const
{
start
=
0
,
end
,
encoding
}
=
options
this
.
connection
=
connection
this
.
encoding
=
options
&&
options
.
encoding
this
.
encoding
=
encoding
this
.
file
=
file
this
.
offset
=
new
Bigint
(
8
)
this
.
offset
=
new
Bigint
(
8
,
start
)
let
fileLength
=
0
for
(
let
i
=
0
;
i
<
file
.
EndofFile
.
length
;
i
++
)
{
...
...
@@ -21,6 +28,10 @@ class SmbReadableStream extends Readable {
}
this
.
fileLength
=
fileLength
this
.
wait
=
false
if
(
end
>=
0
&&
end
<
fileLength
)
{
this
.
fileLength
=
end
+
1
}
}
async
_read
(
size
)
{
...
...
lib/api/src/createWriteStream.js
View file @
0be24899
...
...
@@ -8,12 +8,18 @@ const requestAsync = Bluebird.promisify(request)
const
maxPacketSize
=
new
Bigint
(
8
,
0x00010000
-
0x71
)
class
SmbWritableStream
extends
Writable
{
constructor
(
connection
,
file
,
options
)
{
constructor
(
connection
,
file
,
options
=
{}
)
{
super
(
options
)
const
{
encoding
=
'
utf8
'
,
start
=
0
}
=
options
this
.
connection
=
connection
this
.
encoding
=
options
.
encoding
||
'
utf8
'
this
.
encoding
=
encoding
this
.
file
=
file
this
.
offset
=
new
Bigint
(
8
)
this
.
offset
=
new
Bigint
(
8
,
start
)
}
async
_write
(
chunk
,
encoding
,
next
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment