comparison 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
comparison
equal deleted inserted replaced
1069:7dd6ec499000 1070:a44fc6b53757
836 836
837 try 837 try
838 { 838 {
839 ReadableByteChannel chan = Channels.newChannel(in); 839 ReadableByteChannel chan = Channels.newChannel(in);
840 JBuffer buffer = _generator.getUncheckedBuffer(); 840 JBuffer buffer = _generator.getUncheckedBuffer();
841 ByteBuffer dup = buffer.getByteBuffer().duplicate(); 841 ByteBuffer bb = buffer.getByteBuffer();
842 dup.limit(dup.capacity());
843 842
844 while (true) 843 while (true)
845 { 844 {
846 _generator.prepareUncheckedAddContent(); 845 _generator.prepareUncheckedAddContent();
847 846
848 dup.position(buffer.limit()); 847 int n = chan.read(bb);
849 int n = chan.read(dup);
850 if( n == -1 ) 848 if( n == -1 )
851 break; 849 break;
852 buffer.limit(dup.position());
853 850
854 _generator.completeUncheckedAddContent(); 851 _generator.completeUncheckedAddContent();
855 _out.flush(); 852 _out.flush();
856 } 853 }
857 /* 854 /*