byteRead += count; try{ byteBuffer = SSLUtils.unwrapAll(byteBuffer,inputBB,sslEngine); } catch (IOException ex){ Logger logger = SSLSelectorThread.logger();
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){ ; } } } }
if (byteRead > -1){ protocolInfo.byteBuffer = SSLUtils.unwrapAll(byteBuffer,inputBB,sslEngine); protocolInfo.bytesRead = byteBuffer.position();
byteBuffer = SSLUtils.unwrapAll(byteBuffer, workerThread.getInputBB(),workerThread.getSSLEngine()); workerThread.setByteBuffer(byteBuffer);