#392465 - NextProtoNegoClientConnection does not replace the connection if handshake terminates in onOpen().

Now we check in NextProtoNegoClientConnection.onOpen() if the NPN is completed, and if so, we replace the connection.
This commit is contained in:
Simone Bordet 2012-10-19 17:50:50 +02:00
parent c21a17ea83
commit aa1a6347c1
1 changed files with 4 additions and 2 deletions

View File

@ -60,7 +60,10 @@ public class NextProtoNegoClientConnection extends AbstractConnection implements
try try
{ {
getEndPoint().flush(BufferUtil.EMPTY_BUFFER); getEndPoint().flush(BufferUtil.EMPTY_BUFFER);
fillInterested(); if (completed)
replaceConnection();
else
fillInterested();
} }
catch(IOException e) catch(IOException e)
{ {
@ -126,6 +129,5 @@ public class NextProtoNegoClientConnection extends AbstractConnection implements
endPoint.getConnection().onClose(); endPoint.getConnection().onClose();
endPoint.setConnection(connection); endPoint.setConnection(connection);
connection.onOpen(); connection.onOpen();
completed = true;
} }
} }