[ 
https://issues.apache.org/jira/browse/DIRMINA-603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603510#action_12603510
 ] 

Julien Vermillard commented on DIRMINA-603:
-------------------------------------------

thanks for the precision, I think I need to check if I didn't made the same 
mistake somewhere else in this code.

> 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.

Reply via email to