PadMessageHandler: Improve logging of pre-CLIENT_READY drops

This should make it easier to see what is emitting the the messages so
it can be fixed.
This commit is contained in:
Richard Hansen 2020-09-02 20:50:19 -04:00 committed by webzwo0i
parent 91e99c84ca
commit 1ad134a538
1 changed files with 5 additions and 2 deletions

View File

@ -210,8 +210,11 @@ exports.handleMessage = async (socket, message) => {
const auth = thisSession.auth;
if (!auth) {
console.error('Auth was never applied to a session. If you are using the ' +
'stress-test tool then restart Etherpad and the Stress test tool.');
const ip = settings.disableIPlogging ? 'ANONYMOUS' : (socket.request.ip || '<unknown>');
const msg = JSON.stringify(message, null, 2);
messageLogger.error(`Dropping pre-CLIENT_READY message from IP ${ip}: ${msg}`);
messageLogger.debug(
'If you are using the stress-test tool then restart Etherpad and the Stress test tool.');
return;
}