/** * If the associated response has the Expect header set to 100 Continue, * then accessing the input stream indicates that the handler/servlet * is ready for the request body and thus a 100 Continue response is sent. * * @throws IOException if the InputStream cannot be created */ @Override public void continue100(int available) throws IOException { // If the client is expecting 100 CONTINUE, then send it now. // TODO: consider using an AtomicBoolean ? if (isExpecting100Continue()) { _expect100Continue = false; // is content missing? if (available == 0) { if (getResponse().isCommitted()) throw new IOException("Committed before 100 Continues"); boolean committed = sendResponse(HttpGenerator.CONTINUE_100_INFO, null, false); if (!committed) throw new IOException("Concurrent commit while trying to send 100-Continue"); } } }
/** * If the associated response has the Expect header set to 100 Continue, * then accessing the input stream indicates that the handler/servlet * is ready for the request body and thus a 100 Continue response is sent. * * @throws IOException if the InputStream cannot be created */ @Override public void continue100(int available) throws IOException { // If the client is expecting 100 CONTINUE, then send it now. // TODO: consider using an AtomicBoolean ? if (isExpecting100Continue()) { _expect100Continue = false; // is content missing? if (available == 0) { if (getResponse().isCommitted()) throw new IOException("Committed before 100 Continues"); boolean committed = sendResponse(HttpGenerator.CONTINUE_100_INFO, null, false); if (!committed) throw new IOException("Concurrent commit while trying to send 100-Continue"); } } }
@Override public void send(MetaData.Response info, boolean head, ByteBuffer content, boolean lastContent, Callback callback) { if (info == null) { if (!lastContent && BufferUtil.isEmpty(content)) { callback.succeeded(); return; } } else { // If we are still expecting a 100 continues when we commit if (_channel.isExpecting100Continue()) // then we can't be persistent _generator.setPersistent(false); } if(_sendCallback.reset(info,head,content,lastContent,callback)) _sendCallback.iterate(); }
@Override public void send(MetaData.Response info, boolean head, ByteBuffer content, boolean lastContent, Callback callback) { if (info == null) { if (!lastContent && BufferUtil.isEmpty(content)) { callback.succeeded(); return; } } else { // If we are still expecting a 100 continues when we commit if (_channel.isExpecting100Continue()) // then we can't be persistent _generator.setPersistent(false); } if(_sendCallback.reset(info,head,content,lastContent,callback)) { _sendCallback.iterate(); } }
if (_channel.isExpecting100Continue())
if (_channel.isExpecting100Continue())
&& !isExpecting100Continue() && !isCommitted() && _httpConnection.isRequestBufferEmpty());
_delayedForContent = (getHttpConfiguration().isDelayDispatchUntilContent() && _httpConnection.getParser().getContentLength()>0 && !isExpecting100Continue() && !isCommitted() && _httpConnection.isRequestBufferEmpty());