@@ -248,8 +248,8 @@ public void run() {
248
248
_socket .receive (dpacket );
249
249
//}
250
250
int size = dpacket .getLength ();
251
- if (_log .shouldLog ( Log . INFO ))
252
- _log .info ("After blocking socket.receive: packet is " + size + " bytes on " + System .identityHashCode (packet ));
251
+ // if (_log.shouldDebug( ))
252
+ // _log.debug ("After blocking socket.receive: packet is " + size + " bytes on " + System.identityHashCode(packet));
253
253
packet .resetBegin ();
254
254
255
255
// and block after we know how much we read but before
@@ -261,7 +261,7 @@ public void run() {
261
261
if (_context .commSystem ().isDummy ()) {
262
262
// testing
263
263
packet .release ();
264
- } else if (size > 0 ) {
264
+ } else if (size >= SSU2Util . MIN_DATA_LEN ) {
265
265
//FIFOBandwidthLimiter.Request req = _context.bandwidthLimiter().requestInbound(size, "UDP receiver");
266
266
//_context.bandwidthLimiter().requestInbound(req, size, "UDP receiver");
267
267
FIFOBandwidthLimiter .Request req =
@@ -280,11 +280,9 @@ public void run() {
280
280
receive (packet );
281
281
//_context.statManager().addRateData("udp.receivePacketSize", size);
282
282
} else {
283
- _context .statManager ().addRateData ("udp.receiveHolePunch" , 1 );
284
- // nat hole punch packets are 0 bytes
285
- if (_log .shouldLog (Log .INFO ))
286
- _log .info ("Received a 0 byte udp packet from " + dpacket .getAddress () + ":" + dpacket .getPort ());
287
- _transport .getEstablisher ().receiveHolePunch (dpacket .getAddress (), dpacket .getPort ());
283
+ // SSU1 had 0 byte hole punch, SSU2 does not
284
+ if (_log .shouldWarn ())
285
+ _log .warn ("Dropping short " + size + " byte udp packet from " + dpacket .getAddress () + ":" + dpacket .getPort ());
288
286
packet .release ();
289
287
}
290
288
} catch (IOException ioe ) {
0 commit comments