diff src/org/eclipse/jetty/io/nio/SslConnection.java @ 1037:3c4c7cc7904f

rename Buffer.hasContent() to hasRemaining()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 21:54:34 -0600
parents 21910079096e
children b71ad168fe34
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/nio/SslConnection.java	Thu Nov 03 21:42:41 2016 -0600
+++ b/src/org/eclipse/jetty/io/nio/SslConnection.java	Thu Nov 03 21:54:34 2016 -0600
@@ -230,7 +230,7 @@
 				boolean progress=process(null,toFlush);
 
 				// if we received any data,
-				if (_unwrapBuf!=null && _unwrapBuf.hasContent())
+				if (_unwrapBuf!=null && _unwrapBuf.hasRemaining())
 				{
 					// transfer from temp buffer to fill buffer
 					_unwrapBuf.skip(toFill.put(_unwrapBuf));
@@ -241,7 +241,7 @@
 					return progress;
 			}
 			// Else if there is some temporary data
-			else if (_unwrapBuf!=null && _unwrapBuf.hasContent())
+			else if (_unwrapBuf!=null && _unwrapBuf.hasRemaining())
 			{
 				// transfer from temp buffer to fill buffer
 				_unwrapBuf.skip(toFill.put(_unwrapBuf));
@@ -269,7 +269,7 @@
 						progress = true;
 
 					// flush any output data
-					if (_outbound.hasContent() && (flushed=_endp.flush(_outbound))>0)
+					if (_outbound.hasRemaining() && (flushed=_endp.flush(_outbound))>0)
 						progress = true;
 				}
 				catch (IOException e)
@@ -291,11 +291,11 @@
 					case NOT_HANDSHAKING:
 					{
 						// Try unwrapping some application data
-						if (toFill.space()>0 && _inbound.hasContent() && unwrap(toFill))
+						if (toFill.space()>0 && _inbound.hasRemaining() && unwrap(toFill))
 							progress=true;
 
 						// Try wrapping some application data
-						if (toFlush.hasContent() && _outbound.space()>0 && wrap(toFlush))
+						if (toFlush.hasRemaining() && _outbound.space()>0 && wrap(toFlush))
 							progress=true;
 					}
 					break;
@@ -328,7 +328,7 @@
 						// The SSL needs to receive some handshake data from the other side
 						if (_handshook && !_allowRenegotiate)
 							_endp.close();
-						else if (!_inbound.hasContent()&&filled==-1)
+						else if (!_inbound.hasRemaining()&&filled==-1)
 						{
 							// No more input coming
 							_endp.shutdownInput();
@@ -340,10 +340,10 @@
 				}
 
 				// pass on ishut/oshut state
-				if (_endp.isOpen() && _endp.isInputShutdown() && !_inbound.hasContent())
+				if (_endp.isOpen() && _endp.isInputShutdown() && !_inbound.hasRemaining())
 					closeInbound();
 
-				if (_endp.isOpen() && _engine.isOutboundDone() && !_outbound.hasContent())
+				if (_endp.isOpen() && _engine.isOutboundDone() && !_outbound.hasRemaining())
 					_endp.shutdownOutput();
 
 				// remember if any progress has been made
@@ -351,7 +351,7 @@
 			}
 
 			// If we are reading into the temp buffer and it has some content, then we should be dispatched.
-			if (toFill==_unwrapBuf && _unwrapBuf.hasContent() && !_connection.isSuspended())
+			if (toFill==_unwrapBuf && _unwrapBuf.hasRemaining() && !_connection.isSuspended())
 				_aEndp.dispatch();
 		}
 		finally
@@ -450,7 +450,7 @@
 
 	private synchronized boolean unwrap(final Buffer buffer) throws IOException
 	{
-		if (!_inbound.hasContent())
+		if (!_inbound.hasRemaining())
 			return false;
 
 		ByteBuffer bbuf=extractByteBuffer(buffer);
@@ -592,8 +592,8 @@
 			synchronized (SslConnection.this)
 			{
 				return _endp.isInputShutdown() &&
-				!(_unwrapBuf!=null&&_unwrapBuf.hasContent()) &&
-				!(_inbound!=null&&_inbound.hasContent());
+				!(_unwrapBuf!=null&&_unwrapBuf.hasRemaining()) &&
+				!(_inbound!=null&&_inbound.hasRemaining());
 			}
 		}
 
@@ -624,11 +624,11 @@
 
 		public int flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException
 		{
-			if (header!=null && header.hasContent())
+			if (header!=null && header.hasRemaining())
 				return flush(header);
-			if (buffer!=null && buffer.hasContent())
+			if (buffer!=null && buffer.hasRemaining())
 				return flush(buffer);
-			if (trailer!=null && trailer.hasContent())
+			if (trailer!=null && trailer.hasRemaining())
 				return flush(trailer);
 			return 0;
 		}