Add length check of UDP packet to UDPNetSyslogServer#run()

Fixes #5
This commit is contained in:
Jochen Schalanda 2016-02-18 14:41:58 +01:00
parent c318fd0867
commit 401b7d07fa

View File

@ -81,10 +81,10 @@ public class UDPNetSyslogServer extends AbstractSyslogServer {
this.ds.receive(dp);
SyslogServerEventIF event = createEvent(this.getConfig(), receiveData, dp.getLength(), dp.getAddress());
handleEvent(null, this, dp, event);
if(dp.getLength() > 0) {
SyslogServerEventIF event = createEvent(this.getConfig(), receiveData, dp.getLength(), dp.getAddress());
handleEvent(null, this, dp, event);
}
} catch (SocketException se) {
int i = se.getMessage() == null ? -1 : se.getMessage().toLowerCase().indexOf("socket closed");