zengjie created DIRMINA-970:
-------------------------------
Summary: ProtocolEncoderOutputImpl.flush() occur a
IllegalArgumentException
Key: DIRMINA-970
URL: https://issues.apache.org/jira/browse/DIRMINA-970
Project: MINA
Issue Type: Bug
Components: Core
Affects Versions: 2.0.7, 2.0.6
Environment: anywhere
Reporter: zengjie
Priority: Critical
Fix For: 2.0.6
public WriteFuture flush() {
Queue<Object> bufferQueue = getMessageQueue();
WriteFuture future = null;
while (!bufferQueue.isEmpty()) {
Object encodedMessage = bufferQueue.poll();
if (encodedMessage == null) {
break;
}
// Flush only when the buffer has remaining.
if (!(encodedMessage instanceof IoBuffer) || ((IoBuffer)
encodedMessage).hasRemaining()) {
future = new DefaultWriteFuture(session);
nextFilter.filterWrite(session, new
EncodedWriteRequest(encodedMessage, future, destination));
}
}
if (future == null) {
// Creates an empty writeRequest containing the destination
WriteRequest writeRequest = new DefaultWriteRequest(null, null,
destination);
future = DefaultWriteFuture.newNotWrittenFuture(session, new
NothingWrittenException(writeRequest));
}
return future;
}
if there are nothing in message queue ,this method try to return a future to
represent a NotWritten operation with DefaultWriteRequest, but a
IllegalArgumentException was throw while constructing a DefaultWriteRequest
with a null message
--
This message was sent by Atlassian JIRA
(v6.1#6144)