Update Bot (j'ai plus le repo sur GitHub)
Qui c'est la conne qui a delete le repo sur GitHub? C'EST MOIIIII
This commit is contained in:
35
node_modules/mysql2/lib/base/connection.js
generated
vendored
35
node_modules/mysql2/lib/base/connection.js
generated
vendored
@@ -345,7 +345,9 @@ class BaseConnection extends EventEmitter {
|
||||
});
|
||||
const rejectUnauthorized = this.config.ssl.rejectUnauthorized;
|
||||
const verifyIdentity = this.config.ssl.verifyIdentity;
|
||||
const servername = this.config.host;
|
||||
const servername = Net.isIP(this.config.host)
|
||||
? undefined
|
||||
: this.config.host;
|
||||
|
||||
let secureEstablished = false;
|
||||
this.stream.removeAllListeners('data');
|
||||
@@ -410,6 +412,37 @@ class BaseConnection extends EventEmitter {
|
||||
this.emit('error', err);
|
||||
}
|
||||
|
||||
get state() {
|
||||
// Error state has highest priority
|
||||
if (this._fatalError || this._protocolError) {
|
||||
return 'error';
|
||||
}
|
||||
|
||||
// Closing state has second priority
|
||||
if (this._closing || (this.stream && this.stream.destroyed)) {
|
||||
return 'disconnected';
|
||||
}
|
||||
|
||||
// Authenticated state has third priority
|
||||
if (this.authorized) {
|
||||
return 'authenticated';
|
||||
}
|
||||
|
||||
// Connected state: handshake completed but not yet authorized
|
||||
// This matches the original mysql driver's 'connected' state
|
||||
if (this._handshakePacket) {
|
||||
return 'connected';
|
||||
}
|
||||
|
||||
// Protocol handshake state: connection established, handshake in progress
|
||||
if (this.stream && !this.stream.destroyed) {
|
||||
return 'protocol_handshake';
|
||||
}
|
||||
|
||||
// Default: not connected
|
||||
return 'disconnected';
|
||||
}
|
||||
|
||||
get fatalError() {
|
||||
return this._fatalError;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user