org.apache.coyote.Request.setSendfile()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(212)

本文整理了Java中org.apache.coyote.Request.setSendfile方法的一些代码示例,展示了Request.setSendfile的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setSendfile方法的具体详情如下:
包路径:org.apache.coyote.Request
类名称:Request
方法名:setSendfile

Request.setSendfile介绍

暂无

代码示例

代码示例来源:origin: org.jboss.web/jbossweb

public Http11AprProcessor(int headerBufferSize, AprEndpoint endpoint) {
  this.endpoint = endpoint;
  
  request = new Request();
  inputBuffer = new InternalAprInputBuffer(request, headerBufferSize, endpoint);
  request.setInputBuffer(inputBuffer);
  if (endpoint.getUseSendfile()) {
    request.setSendfile(true);
  }
  response = new Response();
  response.setHook(this);
  outputBuffer = new InternalAprOutputBuffer(response, headerBufferSize, endpoint);
  response.setOutputBuffer(outputBuffer);
  request.setResponse(response);
  ssl = endpoint.isSSLEnabled();
  initializeFilters();
  Http11AbstractProcessor.containerThread.set(Boolean.FALSE);
  // Cause loading of HexUtils
  int foo = HexUtils.DEC[0];
  // Cause loading of FastHttpDateFormat
  FastHttpDateFormat.getCurrentDate();
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Create a new instance of {@code Http11NioProcessor}
 * 
 * @param headerBufferSize
 * @param endpoint
 */
public Http11NioProcessor(int headerBufferSize, NioEndpoint endpoint) {
  this.endpoint = endpoint;
  request = new Request();
  inputBuffer = new InternalNioInputBuffer(this, request, headerBufferSize, endpoint);
  request.setInputBuffer(inputBuffer);
  if (endpoint.getUseSendfile()) {
    request.setSendfile(true);
  }
  response = new Response();
  response.setHook(this);
  outputBuffer = new InternalNioOutputBuffer(this, response, headerBufferSize, endpoint);
  response.setOutputBuffer(outputBuffer);
  request.setResponse(response);
  sslEnabled = endpoint.getSSLEnabled();
  initializeFilters();
  // Cause loading of HexUtils
  int foo = HexUtils.DEC[0];
  // Cause loading of FastHttpDateFormat
  FastHttpDateFormat.getCurrentDate();
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

Stream(Integer identifier, Http2UpgradeHandler handler, Request coyoteRequest) {
  super(identifier);
  this.handler = handler;
  handler.addChild(this);
  setWindowSize(handler.getRemoteSettings().getInitialWindowSize());
  state = new StreamStateMachine(this);
  if (coyoteRequest == null) {
    // HTTP/2 new request
    this.coyoteRequest = new Request();
    this.inputBuffer = new StreamInputBuffer();
    this.coyoteRequest.setInputBuffer(inputBuffer);
  } else {
    // HTTP/1.1 upgrade
    this.coyoteRequest = coyoteRequest;
    this.inputBuffer = null;
    // Headers have been populated by this point
    state.receivedStartOfHeaders();
    // TODO Assuming the body has been read at this point is not valid
    state.receivedEndOfStream();
  }
  this.coyoteRequest.setSendfile(handler.hasAsyncIO() && handler.getProtocol().getUseSendfile());
  this.coyoteResponse.setOutputBuffer(http2OutputBuffer);
  this.coyoteRequest.setResponse(coyoteResponse);
  this.coyoteRequest.protocol().setString("HTTP/2.0");
  if (this.coyoteRequest.getStartTime() < 0) {
    this.coyoteRequest.setStartTime(System.currentTimeMillis());
  }
}

相关文章

Request类方法