You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Julien Vermillard (JIRA)" <ji...@apache.org> on 2008/06/06 10:38:45 UTC

[jira] Closed: (DIRMINA-603) AprIoProcessor.state should check for file descriptor != 0 instead of > 0

     [ https://issues.apache.org/jira/browse/DIRMINA-603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Vermillard closed DIRMINA-603.
-------------------------------------

    Resolution: Fixed
      Assignee: Julien Vermillard

never thought fd could be negatives
thanks for the patch !

> AprIoProcessor.state should check for file descriptor != 0 instead of > 0
> -------------------------------------------------------------------------
>
>                 Key: DIRMINA-603
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-603
>             Project: MINA
>          Issue Type: Bug
>          Components: Transport
>         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
>            Reporter: Geoff Cadien
>            Assignee: Julien Vermillard
>             Fix For: 2.0.0-M2
>
>
> 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 ?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.