detectAndUpgrade() shortcut on empty buffer

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2020-02-04 10:49:27 +01:00
parent 37edc016d2
commit 58b1db610c
1 changed files with 7 additions and 0 deletions

View File

@ -218,6 +218,13 @@ public class DetectorConnectionFactory extends AbstractConnectionFactory impleme
*/
private boolean detectAndUpgrade()
{
if (BufferUtil.isEmpty(_buffer))
{
if (LOG.isDebugEnabled())
LOG.debug("Detector {} skipping detection on an empty buffer", getProtocol());
return false;
}
if (LOG.isDebugEnabled())
LOG.debug("Detector {} performing detection with {} bytes", getProtocol(), _buffer.remaining());
boolean notRecognized = true;