New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

basic-ftp

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basic-ftp - npm Package Compare versions

Comparing version 2.16.0 to 2.16.1

4

CHANGELOG.md
# Changelog
## 2.16.1
- Fixed: Closing client during task will reject associated promise. (#34)
## 2.16.0

@@ -4,0 +8,0 @@

29

lib/FtpContext.js

@@ -89,12 +89,7 @@ "use strict";

/**
* Close control and data connections.
* Close the context by resetting its state.
*/
close() {
this.log("Closing connections.");
this._stopTrackingTask();
this._partialResponse = "";
this._closeSocket(this._socket);
this._closeSocket(this._dataSocket);
// Set a new socket instance to make reconnecting possible.
this.socket = new Socket();
this._passToHandler({ error: { info: "User closed client during task." }});
this._reset();
}

@@ -278,2 +273,17 @@

/**
* Reset the state of this context.
*
* @private
*/
_reset() {
this.log("Closing connections.");
this._stopTrackingTask();
this._partialResponse = "";
this._closeSocket(this._socket);
this._closeSocket(this._dataSocket);
// Set a new socket instance to make reconnecting possible.
this.socket = new Socket();
}
/**
* Send an error to the current handler and close all connections.

@@ -285,6 +295,5 @@ *

_closeWithError(error) {
this.log("Will close connections because of error:");
this.log(error);
this._passToHandler({ error });
this.close();
this._reset();
}

@@ -291,0 +300,0 @@

{
"name": "basic-ftp",
"version": "2.16.0",
"version": "2.16.1",
"description": "FTP client for Node.js with support for explicit FTPS over TLS.",

@@ -5,0 +5,0 @@ "main": "./lib/ftp",

@@ -20,2 +20,3 @@ const assert = require("assert");

afterEach(function() {
client.ftp._reset();
client.close();

@@ -22,0 +23,0 @@ });

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc