just in case

This commit is contained in:
zefie
2025-06-14 19:01:02 -04:00
parent 9d18df4af1
commit 6566de4986

View File

@@ -121,8 +121,6 @@ class WTVIRC {
});
socket.push(firstChunk);
secureSocket.on('error', (err) => {
if (this.debug) {
console.error('TLS error:', err);
@@ -134,8 +132,6 @@ class WTVIRC {
this.terminateSession(secureSocket, false);
});
// Only start processing after handshake is complete
secureSocket.on('secure', () => {
if (this.debug) {
@@ -181,7 +177,6 @@ class WTVIRC {
this.terminateSession(secureSocket, false);
});
});
secureSocket.resume();
return;
} else {
@@ -241,6 +236,16 @@ class WTVIRC {
}
processSocketData(socket, data) {
// Ensure data is a string
if (typeof data !== 'string') {
if (Buffer.isBuffer(data)) {
data = data.toString('utf8');
} else if (data && typeof data.toString === 'function') {
data = data.toString();
} else {
return; // Invalid data, ignore
}
}
const lines = data.split(/\r\n|\n/).filter(Boolean);
for (let line of lines) {
if (this.debug) {