just in case
This commit is contained in:
@@ -119,9 +119,7 @@ class WTVIRC {
|
|||||||
cert: certBuffer,
|
cert: certBuffer,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
socket.push(firstChunk);
|
socket.push(firstChunk);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
secureSocket.on('error', (err) => {
|
secureSocket.on('error', (err) => {
|
||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
@@ -132,9 +130,7 @@ class WTVIRC {
|
|||||||
|
|
||||||
secureSocket.on('close', () => {
|
secureSocket.on('close', () => {
|
||||||
this.terminateSession(secureSocket, false);
|
this.terminateSession(secureSocket, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Only start processing after handshake is complete
|
// Only start processing after handshake is complete
|
||||||
secureSocket.on('secure', () => {
|
secureSocket.on('secure', () => {
|
||||||
@@ -180,8 +176,7 @@ class WTVIRC {
|
|||||||
secureSocket.on('end', () => {
|
secureSocket.on('end', () => {
|
||||||
this.terminateSession(secureSocket, false);
|
this.terminateSession(secureSocket, false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
secureSocket.resume();
|
secureSocket.resume();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@@ -241,6 +236,16 @@ class WTVIRC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processSocketData(socket, data) {
|
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);
|
const lines = data.split(/\r\n|\n/).filter(Boolean);
|
||||||
for (let line of lines) {
|
for (let line of lines) {
|
||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
|
|||||||
Reference in New Issue
Block a user