private int doRead(ByteBuffer inputBB){ int count = -1; try{ // Read first bytes to avoid continuing if the client // closed the connection. count = ((SocketChannel)key.channel()).read(inputBB); if (count != -1){ // Decrypt the bytes we just read. byteBuffer = SSLUtils.unwrapAll(byteBuffer,inputBB,sslEngine); final SSLWorkerThread workerThread = (SSLWorkerThread)Thread.currentThread(); workerThread.setByteBuffer(byteBuffer); workerThread.setInputBB(inputBB); } return count; } catch(IOException ex){ return -1; } finally { if (count == -1){ try{ sslEngine.closeInbound(); } catch (SSLException ex){ ; } } } }
byteBuffer = origBB; handshake= false; workerThread.setByteBuffer(byteBuffer); inputStream.setByteBuffer(byteBuffer); byteBuffer.clear();
workerThread.setByteBuffer(byteBuffer);
byteBuffer = SSLUtils.unwrapAll(byteBuffer, workerThread.getInputBB(),workerThread.getSSLEngine()); workerThread.setByteBuffer(byteBuffer); if (currentRead == -1 && byteBuffer.position() == initialPosition) {