diff src/org/eclipse/jetty/server/AbstractHttpConnection.java @ 1070:a44fc6b53757

fix use of HttpGenerator._buffer
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 10 Nov 2016 01:23:37 -0700
parents 9d357b9e4bcb
children 6b7ff30bb990
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Thu Nov 10 00:42:51 2016 -0700
+++ b/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Thu Nov 10 01:23:37 2016 -0700
@@ -838,18 +838,15 @@
 			{
 				ReadableByteChannel chan = Channels.newChannel(in);
 				JBuffer buffer = _generator.getUncheckedBuffer();
-				ByteBuffer dup = buffer.getByteBuffer().duplicate();
-				dup.limit(dup.capacity());
+				ByteBuffer bb = buffer.getByteBuffer();
 
 				while (true)
 				{
 					_generator.prepareUncheckedAddContent();
 
-					dup.position(buffer.limit());
-					int n = chan.read(dup);
+					int n = chan.read(bb);
 					if( n == -1 )
 						break;
-					buffer.limit(dup.position());
 
 					_generator.completeUncheckedAddContent();
 					_out.flush();