Skip to content

Commit

Permalink
Some fixes for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
agsh committed Nov 22, 2021
1 parent 1aed479 commit 61d25c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/yapople.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function onData(data) {
if (sData.substr(0, 3) === '+OK') {
succ = sData.substring(4, sData.indexOf('\r\n'));
} else {
err = new Error(sData);
err = new Error(sData.substring(5, sData.indexOf('\r\n')));
}
// RETR, LIST and TOP are multiline commands
if (
Expand Down Expand Up @@ -134,7 +134,9 @@ function onData(data) {
if (this._command.callback) {
this._command.callback.call(this, null);
}
this._socket.destroy(); // socket connection close
if (this._socket.destroy) {
this._socket.destroy(); // socket connection close
}
}.bind(this));
} else {
if (this._command.cmd === state.PASS && !err) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yapople",
"version": "0.4.6",
"version": "0.4.7",
"author": "Andrew D.Laptev <[email protected]>",
"description": "Yet another POP3 library",
"main": "lib/yapople.js",
Expand Down

0 comments on commit 61d25c0

Please sign in to comment.