HttpContext context = conn.getContext();
HttpRequest request = conn.getHttpRequest();
context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
try {
ContentInputBuffer inputBuffer = new SharedInputBuffer(cfg.getBufferSize(), conn, allocator);
ContentOutputBuffer outputBuffer = new SharedOutputBuffer(cfg.getBufferSize(), conn, allocator);
context.setAttribute(REQUEST_SINK_BUFFER, inputBuffer);
context.setAttribute(RESPONSE_SOURCE_BUFFER, outputBuffer);
// create the default response to this request