mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2025-11-26 08:16:46 +07:00
node_modules: upgrade
This commit is contained in:
14
node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js
generated
vendored
14
node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js
generated
vendored
@ -44,7 +44,7 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {
|
||||
// Error harness for initial connection. Once connection is established, the responsibility
|
||||
// to handle errors is passed to whoever uses this socket
|
||||
let finished = false;
|
||||
let tempSocketErr = function (err) {
|
||||
let tempSocketErr = err => {
|
||||
if (finished) {
|
||||
return;
|
||||
}
|
||||
@ -57,6 +57,12 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {
|
||||
callback(err);
|
||||
};
|
||||
|
||||
let timeoutErr = () => {
|
||||
let err = new Error('Proxy socket timed out');
|
||||
err.code = 'ETIMEDOUT';
|
||||
tempSocketErr(err);
|
||||
};
|
||||
|
||||
socket = connect(options, () => {
|
||||
if (finished) {
|
||||
return;
|
||||
@ -119,12 +125,18 @@ function httpProxyClient(proxyUrl, destinationPort, destinationHost, callback) {
|
||||
}
|
||||
|
||||
socket.removeListener('error', tempSocketErr);
|
||||
socket.removeListener('timeout', timeoutErr);
|
||||
socket.setTimeout(0);
|
||||
|
||||
return callback(null, socket);
|
||||
}
|
||||
};
|
||||
socket.on('data', onSocketData);
|
||||
});
|
||||
|
||||
socket.setTimeout(httpProxyClient.timeout || 30 * 1000);
|
||||
socket.on('timeout', timeoutErr);
|
||||
|
||||
socket.once('error', tempSocketErr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user