Package com.caucho.server.http

Examples of com.caucho.server.http.AbstractHttpRequest


  {
    // server/1kk7
    CauchoRequest cRequest = (CauchoRequest) req;
    HttpServletResponseImpl responseImpl = (HttpServletResponseImpl) res;

    AbstractHttpRequest absRequest = cRequest.getAbstractHttpRequest();
    HttpServletRequestImpl request = absRequest.getRequestFacade();
    AbstractHttpResponse response = responseImpl.getAbstractHttpResponse();

    // skip excluded urls
    if (_excludes.length > 0) {
      byte []data = absRequest.getUriBuffer();
      int sublen = absRequest.getUriLength();

      String uri = new String(data, 0, sublen);

      for (Pattern pattern : _excludes) {
        if (pattern.matcher(uri).find()) {
View Full Code Here


                  HttpServletResponseImpl responseFacade,
                  AbstractHttpResponse response,
                  byte []buffer, int offset, int length)
    throws IOException
  {
    AbstractHttpRequest absRequest = request.getAbstractHttpRequest();

    int len = _segments.length;
    for (int i = 0; i < len; i++) {
      Segment segment = _segments[i];
      String value = null;
      CharSegment csValue = null;

      switch (segment._code) {
      case Segment.TEXT:
        int sublen = segment._data.length;
        byte []data = segment._data;
        for (int j = 0; j < sublen; j++)
          buffer[offset++] = data[j];
        break;

      case Segment.CHAR:
        buffer[offset++] = segment._ch;
        break;

      case 'b':
        if (responseFacade.getStatus() == 304)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, response.getContentLength());
        break;

        // cookie
      case 'c':
        Cookie cookie = request.getCookie(segment._string);
        if (cookie == null)
          cookie = responseFacade.getCookie(segment._string);
        if (cookie == null)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, cookie.getValue());
        break;

        // set cookie
      case Segment.SET_COOKIE:
        ArrayList<Cookie> cookies = responseFacade.getCookies();
        if (cookies == null || cookies.size() == 0)
          buffer[offset++] = (byte) '-';
        else {
          _cb.clear();
          response.fillCookie(_cb, (Cookie) cookies.get(0), 0, 0, false);

          offset = print(buffer, offset, _cb.getBuffer(), 0, _cb.getLength());
        }
        break;

      case 'h':
        if (isHostnameDnsLookup()) {
          String addrName = request.getRemoteAddr();
          InetAddress addr = InetAddress.getByName(addrName);

          offset = print(buffer, offset, addr.getHostName());
        }
        else
          offset = absRequest.printRemoteAddr(buffer, offset);
        break;

        // input header
      case 'i':
        csValue = absRequest.getHeaderBuffer(segment._string);
        if (csValue == null)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, csValue);
        break;

      case 'l':
        buffer[offset++] = (byte) '-';
        break;

        // request attribute
      case 'n':
        Object oValue = request.getAttribute(segment._string);
        if (oValue == null)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, String.valueOf(oValue));
        break;

        // output header
      case 'o':
        value = response.getHeader(segment._string);
        if (value == null)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, value);
        break;

      case 'r':
        offset = print(buffer, offset, request.getMethod());

        buffer[offset++] = (byte) ' ';

        data = absRequest.getUriBuffer();
        sublen = absRequest.getUriLength();

        // server/02e9
        if (buffer.length - offset - 128 < sublen) {
          sublen = buffer.length - offset - 128;
          System.arraycopy(data, 0, buffer, offset, sublen);
View Full Code Here

  public void doFilter(ServletRequest request, ServletResponse response)
    throws ServletException, IOException
  {
    if (request instanceof AbstractHttpRequest) {
      AbstractHttpRequest httpRequest = (AbstractHttpRequest) request;

      SocketLink connection = httpRequest.getConnection();

      if (connection instanceof TcpSocketLink) {
        TcpSocketLink tcpConnection = (TcpSocketLink) connection;

        long time = Alarm.getExactTime();
View Full Code Here

  public void doFilter(ServletRequest request, ServletResponse response)
    throws ServletException, IOException
  {
    if (request instanceof AbstractHttpRequest) {
      AbstractHttpRequest httpRequest = (AbstractHttpRequest) request;

      SocketLink connection = httpRequest.getConnection();

      if (connection instanceof TcpSocketLink) {
        TcpSocketLink tcpConnection = (TcpSocketLink) connection;

        long time = Alarm.getExactTime();
View Full Code Here

  {
    // server/1kk7
    CauchoRequest cRequest = (CauchoRequest) req;
    HttpServletResponseImpl responseImpl = (HttpServletResponseImpl) res;

    AbstractHttpRequest absRequest = cRequest.getAbstractHttpRequest();
    HttpServletRequestImpl request = absRequest.getRequestFacade();
    AbstractHttpResponse response = responseImpl.getAbstractHttpResponse();

    // skip excluded urls
    if (_excludes.length > 0) {
      byte []data = absRequest.getUriBuffer();
      int sublen = absRequest.getUriLength();

      String uri = new String(data, 0, sublen);

      for (Pattern pattern : _excludes) {
        if (pattern.matcher(uri).find()) {
View Full Code Here

                  HttpServletResponseImpl responseFacade,
                  AbstractHttpResponse response,
                  byte []buffer, int offset, int length)
    throws IOException
  {
    AbstractHttpRequest absRequest = request.getAbstractHttpRequest();

    int len = _segments.length;
    for (int i = 0; i < len; i++) {
      Segment segment = _segments[i];
      String value = null;
      CharSegment csValue = null;

      switch (segment._code) {
      case Segment.TEXT:
        int sublen = segment._data.length;
        byte []data = segment._data;
        for (int j = 0; j < sublen; j++)
          buffer[offset++] = data[j];
        break;

      case Segment.CHAR:
        buffer[offset++] = segment._ch;
        break;

      case 'b':
        if (responseFacade.getStatus() == 304)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, response.getContentLength());
        break;

        // cookie
      case 'c':
        Cookie cookie = request.getCookie(segment._string);
        if (cookie == null)
          cookie = responseFacade.getCookie(segment._string);
        if (cookie == null)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, cookie.getValue());
        break;

        // set cookie
      case Segment.SET_COOKIE:
        ArrayList<Cookie> cookies = responseFacade.getCookies();
        if (cookies == null || cookies.size() == 0)
          buffer[offset++] = (byte) '-';
        else {
          _cb.clear();
          response.fillCookie(_cb, (Cookie) cookies.get(0), 0, 0, false);

          offset = print(buffer, offset, _cb.getBuffer(), 0, _cb.getLength());
        }
        break;

      case 'h':
        if (isHostnameDnsLookup()) {
          String addrName = request.getRemoteAddr();
          InetAddress addr = InetAddress.getByName(addrName);

          offset = print(buffer, offset, addr.getHostName());
        }
        else
          offset = absRequest.printRemoteAddr(buffer, offset);
        break;

        // input header
      case 'i':
        csValue = absRequest.getHeaderBuffer(segment._string);
        if (csValue == null)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, csValue);
        break;

      case 'l':
        buffer[offset++] = (byte) '-';
        break;

        // request attribute
      case 'n':
        Object oValue = request.getAttribute(segment._string);
        if (oValue == null)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, String.valueOf(oValue));
        break;

        // output header
      case 'o':
        value = response.getHeader(segment._string);
        if (value == null)
          buffer[offset++] = (byte) '-';
        else
          offset = print(buffer, offset, value);
        break;

      case 'r':
        offset = print(buffer, offset, request.getMethod());

        buffer[offset++] = (byte) ' ';

        data = absRequest.getUriBuffer();
        sublen = absRequest.getUriLength();

        // server/02e9
        if (buffer.length - offset - 128 < sublen) {
          sublen = buffer.length - offset - 128;
          System.arraycopy(data, 0, buffer, offset, sublen);
View Full Code Here

TOP

Related Classes of com.caucho.server.http.AbstractHttpRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.