node_modules: update (#362)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurlaanddawidd6 authored and GitHub committed 2026-11-11 07:38:40 +01:00
1 parent 4a48500d96
commit aefdaa6a6c
49 files changed
+1316 -295

No files matched your search

+26 -4
View File
@@ -48,6 +48,7 @@ export default class PoolResource extends EventEmitter {
}
this._connection = false;
this._connected = false;
this._closed = false;
this.messages = 0;
this.available = true;
this._failed = false;
@@ -75,6 +76,10 @@ export default class PoolResource extends EventEmitter {
// the proxy handshake, if any, counts against connectionTimeout as well
const connectStartedAt = Date.now();
this.pool.getSocket(Object.assign({}, this.options, { connectStartedAt }), (err, socketOptions) => {
if (this._closed) {
socketOptions && socketOptions.connection?.destroy();
return;
}
if (err) {
// nothing was connected, so no 'close' event is coming that would free the
// slot this resource holds in the pool, report the failure the way a failed
@@ -98,7 +103,7 @@ export default class PoolResource extends EventEmitter {
this.connection = new SMTPConnection(options);
this.connection._connectStartedAt = connectStartedAt;
this.connection.on('error', (err) => {
if (this._sending) {
if (this._closed || this._sending) {
// the send callback gets the same error and decides what it means for the message
return;
}
@@ -112,7 +117,7 @@ export default class PoolResource extends EventEmitter {
return;
}
this._fail(err);
if (returned) {
if (returned || this._closed) {
return;
}
returned = true;
@@ -123,7 +128,7 @@ export default class PoolResource extends EventEmitter {
returned = true;
});
this.connection.connect(err => {
if (returned) {
if (returned || this._closed) {
return;
}
if (err) {
@@ -134,7 +139,7 @@ export default class PoolResource extends EventEmitter {
}
if (this.auth && (this.connection.allowsAuth || options.forceAuth)) {
this.connection.login(this.auth, err => {
if (returned) {
if (returned || this._closed) {
return;
}
returned = true;
@@ -162,6 +167,9 @@ export default class PoolResource extends EventEmitter {
* @param callback Callback function
*/
send(mail, callback) {
if (this._closed) {
return;
}
if (!this._connected) {
return this.connect(err => {
if (err) {
@@ -193,6 +201,9 @@ export default class PoolResource extends EventEmitter {
const reused = this.messages > 0;
const messageStream = mail.message.createReadStream();
this.connection.send(envelope, messageStream, (err, info) => {
if (mail.data.signal?.aborted) {
return;
}
this._sending = false;
this.messages++;
if (err) {
@@ -239,6 +250,9 @@ export default class PoolResource extends EventEmitter {
* @internal
*/
_release() {
if (this._closed) {
return;
}
if (this.messages >= this.options.maxMessages) {
const err = new Error('Resource exhausted');
err.code = errors.EMAXLIMIT;
@@ -247,6 +261,9 @@ export default class PoolResource extends EventEmitter {
return;
}
this.pool._checkRateLimit(() => {
if (this._closed) {
return;
}
this.available = true;
this._startIdleTimer();
this.emit('available');
@@ -289,6 +306,11 @@ export default class PoolResource extends EventEmitter {
* Closes the connection
*/
close() {
if (this._closed) {
return;
}
this._closed = true;
this.available = false;
this._connected = false;
this._stopIdleTimer();
if (this.auth && this.auth.oauth2) {