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

Emmanuel Lecharny commented on DIRMINA-1083:
--------------------------------------------

Ok, after a good discussion with Jonathan, and a further debugging session, my 
previous comments are just baseless.

There are things we can improve in the way MINA handle {{startTLS}}, especially 
there is no need to call {{beginHandshake}} right away, if we take care of the 
{{NOT_HANDSHAKING}} state in a different way than the {{FINISHED}} state in the 
{{handshake}} method, but this is just a slight improvement.

There is also some potential improvement : we probably can get rid of the 
{{messageReceivedEventQueue}}, which is only used to keep a track of a 
notification message, that can be sent in a different way (ie, without putting 
it in a queue).

Last, we use a flag stored in the session to avoid encrypting a message, and I 
do believe this is unecessary, but I have to double check.

In any case, the 'regression' I saw was something different, namely a bug in 
the LDAP API. We were sending a {{startTLS}} message, and when we received the 
response from the server, the handshake was started, but the client didn't wait 
for this handshake to complete, and started to send other messages to the 
server, which of course generated some errors.

I'll close this ticket as 'Not a problem'.

> Regression on SSL connection
> ----------------------------
>
>                 Key: DIRMINA-1083
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-1083
>             Project: MINA
>          Issue Type: Bug
>    Affects Versions: 2.0.17
>            Reporter: Emmanuel Lecharny
>            Priority: Major
>             Fix For: 2.0.18
>
>
> We are using MINA in Apache Directory. After having moved to MINA 2.0.17, we 
> now have failures like :
> {noformat}
> Running org.apache.directory.shared.client.api.LdapSSLConnectionTest
> java.io.IOException: Broken pipe
>     at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
>     at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
>     at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
>     at sun.nio.ch.IOUtil.write(IOUtil.java:65)
>     at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
>     at 
> org.apache.mina.transport.socket.nio.NioProcessor.write(NioProcessor.java:384)
>     at 
> org.apache.mina.transport.socket.nio.NioProcessor.write(NioProcessor.java:47)
>     at 
> org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.writeBuffer(AbstractPollingIoProcessor.java:1107)
>     at 
> org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.flushNow(AbstractPollingIoProcessor.java:994)
>     at 
> org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.flush(AbstractPollingIoProcessor.java:921)
>     at 
> org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:688)
>     at 
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
>     at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>     at java.lang.Thread.run(Thread.java:748)
> {noformat}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to