Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-603

AprIoProcessor.state should check for file descriptor != 0 instead of > 0

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-M2
    • Component/s: Transport
    • Labels:
      None
    • Environment:
      Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
      Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

      Linux jellikit 2.6.24-17-generic #1 SMP Thu May 1 14:31:33 UTC 2008 i686 GNU/Linux

      MINA trunk

      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 ?

        Attachments

          Activity

            People

            • Assignee:
              vrm Julien Vermillard
              Reporter:
              gcadien Geoff Cadien
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: