/** * End request. * * @throws IOException an underlying I/O error occurred */ @Override public void endRequest() throws IOException { super.endRequest(); flushBuffer(); }
/** * Flush the response. * * @throws IOException an underlying I/O error occurred * */ @Override public void flush() throws IOException { super.flush(); // Flush the current buffer flushBuffer(); }
/** * Recycle the output buffer. This should be called when closing the * connection. */ public void recycle() { // Sub-classes may wish to do more than this. nextRequest(); }
OutputFilter[] outputFilters = getOutputBuffer().getFilters(); getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); return; getOutputBuffer().addActiveFilter (outputFilters[Constants.VOID_FILTER]); entityBody = false; getOutputBuffer().addActiveFilter (outputFilters[Constants.VOID_FILTER]); contentDelimitation = true; if (contentLength != -1) { headers.setValue("Content-Length").setLong(contentLength); getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); contentDelimitation = true; } else { if (entityBody && http11) { getOutputBuffer().addActiveFilter (outputFilters[Constants.CHUNKED_FILTER]); contentDelimitation = true; headers.addValue(Constants.TRANSFERENCODING).setString(Constants.CHUNKED); } else { getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]);
getOutputBuffer().endRequest(); } catch (IOException e) { getOutputBuffer().commit(); } catch (IOException e) { getOutputBuffer().sendAck(); } catch (IOException e) { getOutputBuffer().flush(); } catch (IOException e) { getOutputBuffer().reset();
/** * Recycle the output buffer. This should be called when closing the * connection. */ @Override public void recycle() { super.recycle(); outputStream = null; }
getOutputBuffer().init(socketWrapper, endpoint); getOutputBuffer().nextRequest();
asyncStateMachine.asyncOperation(); try { if (outputBuffer.hasDataToWrite()) { if (outputBuffer.flushBuffer(false)) { } else { getInputBuffer().nextRequest(); getOutputBuffer().nextRequest(); return SocketState.OPEN;
/** * Initialize standard input and output filters. */ protected void initializeFilters(int maxTrailerSize) { // Create and add the identity filters. getInputBuffer().addFilter(new IdentityInputFilter()); getOutputBuffer().addFilter(new IdentityOutputFilter()); // Create and add the chunked filters. getInputBuffer().addFilter(new ChunkedInputFilter(maxTrailerSize)); getOutputBuffer().addFilter(new ChunkedOutputFilter()); // Create and add the void filters. getInputBuffer().addFilter(new VoidInputFilter()); getOutputBuffer().addFilter(new VoidOutputFilter()); // Create and add buffered input filter getInputBuffer().addFilter(new BufferedInputFilter()); // Create and add the chunked filters. //getInputBuffer().addFilter(new GzipInputFilter()); getOutputBuffer().addFilter(new GzipOutputFilter()); pluggableFilterIndex = getInputBuffer().getFilters().length; }
@Override protected boolean prepareSendfile(OutputFilter[] outputFilters) { String fileName = (String) request.getAttribute( org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR); if (fileName != null) { // No entity body sent here outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]); contentDelimitation = true; sendfileData = new AprEndpoint.SendfileData(); sendfileData.fileName = fileName; sendfileData.start = ((Long) request.getAttribute( org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue(); sendfileData.end = ((Long) request.getAttribute( org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue(); return true; } return false; }
OutputFilter[] outputFilters = getOutputBuffer().getFilters(); getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); return; getOutputBuffer().addActiveFilter (outputFilters[Constants.VOID_FILTER]); entityBody = false; getOutputBuffer().addActiveFilter (outputFilters[Constants.VOID_FILTER]); contentDelimitation = true; if (contentLength != -1) { headers.setValue("Content-Length").setLong(contentLength); getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); contentDelimitation = true; } else { if (entityBody && http11) { getOutputBuffer().addActiveFilter (outputFilters[Constants.CHUNKED_FILTER]); contentDelimitation = true; headers.addValue(Constants.TRANSFERENCODING).setString(Constants.CHUNKED); } else { getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]);
/** * Recycle the output buffer. This should be called when closing the * connection. */ @Override public void recycle() { super.recycle(); outputStream = null; }
getOutputBuffer().init(socketWrapper, endpoint); getOutputBuffer().nextRequest();
/** * Initialize standard input and output filters. */ protected void initializeFilters(int maxTrailerSize) { // Create and add the identity filters. getInputBuffer().addFilter(new IdentityInputFilter()); getOutputBuffer().addFilter(new IdentityOutputFilter()); // Create and add the chunked filters. getInputBuffer().addFilter(new ChunkedInputFilter(maxTrailerSize)); getOutputBuffer().addFilter(new ChunkedOutputFilter()); // Create and add the void filters. getInputBuffer().addFilter(new VoidInputFilter()); getOutputBuffer().addFilter(new VoidOutputFilter()); // Create and add buffered input filter getInputBuffer().addFilter(new BufferedInputFilter()); // Create and add the chunked filters. //getInputBuffer().addFilter(new GzipInputFilter()); getOutputBuffer().addFilter(new GzipOutputFilter()); pluggableFilterIndex = getInputBuffer().getFilters().length; }
@Override protected boolean prepareSendfile(OutputFilter[] outputFilters) { String fileName = (String) request.getAttribute( org.apache.coyote.Constants.SENDFILE_FILENAME_ATTR); if (fileName != null) { // No entity body sent here outputBuffer.addActiveFilter(outputFilters[Constants.VOID_FILTER]); contentDelimitation = true; sendfileData = new NioEndpoint.SendfileData(); sendfileData.fileName = fileName; sendfileData.pos = ((Long) request.getAttribute( org.apache.coyote.Constants.SENDFILE_FILE_START_ATTR)).longValue(); sendfileData.length = ((Long) request.getAttribute( org.apache.coyote.Constants.SENDFILE_FILE_END_ATTR)).longValue() - sendfileData.pos; return true; } return false; }
OutputFilter[] outputFilters = getOutputBuffer().getFilters(); getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); return; getOutputBuffer().addActiveFilter (outputFilters[Constants.VOID_FILTER]); entityBody = false; getOutputBuffer().addActiveFilter (outputFilters[Constants.VOID_FILTER]); contentDelimitation = true; if (contentLength != -1) { headers.setValue("Content-Length").setLong(contentLength); getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); contentDelimitation = true; getOutputBuffer().addActiveFilter (outputFilters[Constants.CHUNKED_FILTER]); contentDelimitation = true; headers.addValue(Constants.TRANSFERENCODING).setString(Constants.CHUNKED); } else { getOutputBuffer().addActiveFilter (outputFilters[Constants.IDENTITY_FILTER]); getOutputBuffer().addActiveFilter(outputFilters[Constants.GZIP_FILTER]);
getOutputBuffer().endRequest(); } catch (IOException e) { getOutputBuffer().commit(); } catch (IOException e) { getOutputBuffer().sendAck(); } catch (IOException e) { getOutputBuffer().flush(); } catch (IOException e) { getOutputBuffer().reset();
/** * Recycle the output buffer. This should be called when closing the * connection. */ @Override public void recycle() { super.recycle(); outputStream = null; }
/** * Recycle the output buffer. This should be called when closing the * connection. */ public void recycle() { // Sub-classes may wish to do more than this. nextRequest(); }