forked from I2P_Developers/i2p.i2p
fix streaming test take 2
This commit is contained in:
@ -124,8 +124,6 @@ class MessageInputStream extends InputStream {
|
|||||||
public boolean canAccept(long messageId, int payloadSize) {
|
public boolean canAccept(long messageId, int payloadSize) {
|
||||||
if (payloadSize <= 0)
|
if (payloadSize <= 0)
|
||||||
return true;
|
return true;
|
||||||
if (messageId < MIN_READY_BUFFERS)
|
|
||||||
return true;
|
|
||||||
synchronized (_dataLock) {
|
synchronized (_dataLock) {
|
||||||
// ready dup check
|
// ready dup check
|
||||||
// we always allow sequence numbers less than or equal to highest received
|
// we always allow sequence numbers less than or equal to highest received
|
||||||
@ -136,6 +134,8 @@ class MessageInputStream extends InputStream {
|
|||||||
// return true if a not-ready dup, false if not
|
// return true if a not-ready dup, false if not
|
||||||
return _notYetReadyBlocks.containsKey(Long.valueOf(messageId));
|
return _notYetReadyBlocks.containsKey(Long.valueOf(messageId));
|
||||||
}
|
}
|
||||||
|
if (messageId < MIN_READY_BUFFERS)
|
||||||
|
return true;
|
||||||
// shortcut test, assuming all ready and not ready blocks are max size,
|
// shortcut test, assuming all ready and not ready blocks are max size,
|
||||||
// to avoid iterating through all the ready blocks in getTotalReadySize()
|
// to avoid iterating through all the ready blocks in getTotalReadySize()
|
||||||
if ((_readyDataBlocks.size() + _notYetReadyBlocks.size()) * _maxMessageSize < _maxBufferSize)
|
if ((_readyDataBlocks.size() + _notYetReadyBlocks.size()) * _maxMessageSize < _maxBufferSize)
|
||||||
|
Reference in New Issue
Block a user