Details
Description
AprIoSession.state only returns SessionState.OPEN if the file descriptor for the socket is > 0. I belive the fd can be < 0 (I have see values < 0) and if value is < 0 the incorrect SessionState is returned.
Index: src/main/java/org/apache/mina/transport/socket/apr/AprIoProcessor.java
===================================================================
— src/main/java/org/apache/mina/transport/socket/apr/AprIoProcessor.java (revision 656872)
+++ src/main/java/org/apache/mina/transport/socket/apr/AprIoProcessor.java (working copy)
@@ -248,7 +252,7 @@
@Override
protected SessionState state(AprSession session) {
long socket = session.getDescriptor();
- if (socket > 0) {
+ if (socket != 0) { return SessionState.OPEN; }else if (allSessions.get(socket) != null) {
return SessionState.PREPARING; // will occur ?