Mercurial Hosting > luan
diff src/org/eclipse/jetty/http/AbstractGenerator.java @ 1038:b71ad168fe34
rename Buffer.length() to remaining()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 03 Nov 2016 22:16:11 -0600 |
parents | b87f97f6418a |
children | a7319f14ba1e |
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/AbstractGenerator.java Thu Nov 03 21:54:34 2016 -0600 +++ b/src/org/eclipse/jetty/http/AbstractGenerator.java Thu Nov 03 22:16:11 2016 -0600 @@ -235,7 +235,7 @@ } else { - _contentWritten+=_buffer.length(); + _contentWritten+=_buffer.remaining(); if (_head) _buffer.clear(); } @@ -245,12 +245,12 @@ { if (_buffer != null && _buffer.space()==0) { - if (_buffer.length()==0 && !_buffer.isImmutable()) + if (_buffer.remaining()==0 && !_buffer.isImmutable()) _buffer.compact(); return _buffer.space()==0; } - return _content!=null && _content.length()>0; + return _content!=null && _content.remaining()>0; } public final boolean isWritten() @@ -296,11 +296,11 @@ long end=now+maxIdleTime; Buffer content = _content; Buffer buffer = _buffer; - if (content!=null && content.length()>0 || buffer!=null && buffer.length()>0 || isBufferFull()) + if (content!=null && content.remaining()>0 || buffer!=null && buffer.remaining()>0 || isBufferFull()) { flushBuffer(); - while (now<end && (content!=null && content.length()>0 ||buffer!=null && buffer.length()>0) && _endp.isOpen()&& !_endp.isOutputShutdown()) + while (now<end && (content!=null && content.remaining()>0 ||buffer!=null && buffer.remaining()>0) && _endp.isOpen()&& !_endp.isOutputShutdown()) { blockForOutput(end-now); now=System.currentTimeMillis();