Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions main.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -142,7 +142,11 @@ function POP3Client(port, host, options) {

var sslcontext = require('crypto').createCredentials(options);
var pair = tls.createSecurePair(sslcontext, false);
var cleartext = pipe(pair);
function onTlsError(e){
self.emit('error',e);
}
pair.on('error', onTlsError);
var cleartext = pipe(pair);

pair.on('secure', function() {

Expand DownExpand Up@@ -840,7 +844,7 @@ POP3Client.prototype.capa = function() {
};

POP3Client.prototype.quit = function() {

try{
var self = this;

if (self.getState() === 0) self.emit("invalid-state", "quit");
Expand All@@ -862,6 +866,9 @@ POP3Client.prototype.quit = function() {
self.write("QUIT", undefined);

}
}catch(e){
self.emit('error',e);
}
};

module.exports = POP3Client;