Comparing version 0.7.0 to 0.7.1
@@ -260,10 +260,13 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
try { | ||
if (this.finished) { | ||
if (!this.ended) { | ||
this.ended = true; | ||
process.nextTick(function () { return _super.prototype.emit.call(_this, 'end'); }); | ||
} | ||
// don't do anyting if already reading data or already ended | ||
if (this.busy || this.ended) | ||
return; | ||
// if finished and no queued data, schedule the 'end' event | ||
if (this.finished && this.queue.length == 0) { | ||
this.ended = true; | ||
process.nextTick(function () { return _super.prototype.emit.call(_this, 'end'); }); | ||
return; | ||
} | ||
if (!this.busy && this.queue.length < 4) { | ||
// read more data unless the queue is full | ||
if (this.queue.length < 4) { | ||
var slice = this.blob.slice(this.pos, this.pos + 0x8000); | ||
@@ -283,8 +286,11 @@ this.pos += slice.size; | ||
BlobDataSource.prototype.read = function () { | ||
this.flush(); | ||
// if not readable, don't return anything | ||
if (!this.readable) | ||
return null; | ||
// get next chunk | ||
var chunk = this.queue.shift(); | ||
if (!chunk) { | ||
chunk = null; | ||
// if no more chunks are available, become unreadable | ||
if (this.queue.length == 0) | ||
this.readable = false; | ||
} | ||
this.flush(); | ||
return chunk; | ||
@@ -291,0 +297,0 @@ }; |
{ | ||
"name": "sftp-ws", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "SFTP over WebSockets - client and server library", | ||
@@ -5,0 +5,0 @@ "main": "./lib/sftp.js", |
@@ -83,6 +83,2 @@ sftp-ws | ||
// url and credentials | ||
var url = "ws://nuane.com/sftp"; | ||
var options = { username: "guest", password: "none" }; | ||
// url, credentials and options | ||
@@ -89,0 +85,0 @@ var url = "ws://nuane.com/sftp"; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
219509
5563
212