/**
* {@inheritDoc}
*/
public IFutureResponse send(IHttpRequest request) throws IOException, ConnectException {
FutureResponseHandler responseHandler;
// continue expected?
if (request.hasBody() && HttpUtils.isContainsExpect100ContinueHeader(request)) {
// do not auto continue for network requests
if (HttpClientConnection.isNetworkendpoint(request.getNonBlockingBody())) {
request.setAttribute(HttpClientConnection.IS_AUTOCONTINUE_DEACTIVATED, true);
}
if ((request.getAttribute(HttpClientConnection.IS_AUTOCONTINUE_DEACTIVATED) == null) || ((Boolean) request.getAttribute(HttpClientConnection.IS_AUTOCONTINUE_DEACTIVATED) != true)) {
responseHandler = new FutureContinueResponseHandler(request.getRequestHeader(), request.getNonBlockingBody(), getId());
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("sending header (body will send after receiving the 100 continue response)");
}
BodyDataSink dataSink = send(request.getRequestHeader(), responseHandler);
dataSink.setFlushmode(FlushMode.ASYNC);
((FutureContinueResponseHandler) responseHandler).setBodyDataSink(dataSink);
dataSink.flush(); //writes the header
return responseHandler;
}
}
// ... no
responseHandler = new FutureResponseHandler();
send(request, responseHandler);
return responseHandler;
}