Package com.caucho.server.http

Examples of com.caucho.server.http.HttpServletRequestImpl$DuplexContextImpl


    // 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();
View Full Code Here


      }
    }
    */
   
    if (req instanceof HttpServletRequestImpl) {
      HttpServletRequestImpl requestFacade = (HttpServletRequestImpl) req;

      requestFacade.setSecure(_isSecure);

      // XXX: finally

      _next.doFilter(req, res);
    }
View Full Code Here

    return true;
  }

  private void getClientCertificate()
  {
    HttpServletRequestImpl request = getRequestFacade();

    String cipher = getHeader("SSL_CIPHER");
    if (cipher == null)
      cipher = getHeader("HTTPS_CIPHER");
    if (cipher != null)
      request.setAttribute("javax.servlet.request.cipher_suite", cipher);

    String keySize = getHeader("SSL_CIPHER_USEKEYSIZE");
    if (keySize == null)
      keySize = getHeader("SSL_SECRETKEYSIZE");
    if (keySize != null)
      request.setAttribute("javax.servlet.request.key_size", keySize);

    if (_clientCert.size() == 0)
      return;

    try {
      CertificateFactory cf = CertificateFactory.getInstance("X.509");
      InputStream is = _clientCert.createInputStream();
      X509Certificate cert = (X509Certificate) cf.generateCertificate(is);
      is.close();

      request.setAttribute("javax.servlet.request.X509Certificate",
                           new X509Certificate[]{cert});
      request.setAttribute(com.caucho.security.AbstractLogin.LOGIN_USER_NAME,
                           ((X509Certificate) cert).getSubjectDN());
    } catch (Exception e) {
      log.log(Level.FINE, e.toString(), e);
    }
  }
View Full Code Here

  }

  void flushResponseBuffer()
    throws IOException
  {
    HttpServletRequestImpl request = getRequestFacade();

    if (request != null) {
      AbstractResponseStream stream = request.getResponse().getResponseStream();

      stream.flushNext();
    }
  }
View Full Code Here

    AbstractHttpResponse cauchoResponse = null;

    if (_isRequestSecure == null) {
    }
    else if (request instanceof HttpServletRequestImpl) {
      HttpServletRequestImpl req = (HttpServletRequestImpl) request;

      req.setSecure(_isRequestSecure);
    }
    else {
      CauchoRequest cauchoRequest
        = new SetRequestSecureFilterChain.SecureServletRequestWrapper((HttpServletRequest) request,
                                                                      _isRequestSecure);
View Full Code Here

   * Service handling
   */
  public void service(ServletRequest request, ServletResponse response)
    throws IOException, ServletException
  {
    HttpServletRequestImpl req = (HttpServletRequestImpl) request;
    HttpServletResponseImpl res = (HttpServletResponseImpl) response;

    String upgrade = req.getHeader("Upgrade");

    if (! "WebSocket".equals(upgrade)) {
      // eventually can use alt method
      res.sendError(400, "Upgrade denied:" + upgrade);
      return;
    }
   
    String ipAddress = req.getRemoteAddr();
   
    WebSocketHandler handler
      = new WebSocketHandler(ipAddress);
   
    WebSocketContext webSocket = req.startWebSocket(handler);

    webSocket.setTimeout(30 * 60 * 1000L);
  }
View Full Code Here

    }

    @Override
    public boolean isClosed()
    {
      HttpServletRequestImpl request = _request;
     
      return request == null || request.isClosed() || ! isActive();
    }
View Full Code Here

                             HttpServletResponse response,
                             Invocation invocation)
    throws ServletException, IOException
  {
    HttpServletRequestWrapper parentRequest = null;
    HttpServletRequestImpl bottomRequest = null;
    HttpServletResponseImpl bottomResponse = null;
   
    HttpServletRequest req = request;
    while (req != null && req instanceof HttpServletRequestWrapper) {
      parentRequest = (HttpServletRequestWrapper) req;
View Full Code Here

   * Service handling
   */
  public void service(ServletRequest request, ServletResponse response)
    throws IOException, ServletException
  {
    HttpServletRequestImpl req = (HttpServletRequestImpl) request;
    HttpServletResponseImpl res = (HttpServletResponseImpl) response;

    String upgrade = req.getHeader("Upgrade");

    if (! "WebSocket".equals(upgrade)) {
      // eventually can use alt method
      res.sendError(400, "Upgrade denied:" + upgrade);
      return;
    }
   
    String ipAddress = req.getRemoteAddr();
   
    WebSocketHandler handler
      = new WebSocketHandler(ipAddress);
   
    WebSocketContext webSocket = req.startWebSocket(handler);

    webSocket.setTimeout(30 * 60 * 1000L);
  }
View Full Code Here

    }

    @Override
    public boolean isClosed()
    {
      HttpServletRequestImpl request = _request;
     
      return request == null || request.isClosed() || ! isActive();
    }
View Full Code Here

TOP

Related Classes of com.caucho.server.http.HttpServletRequestImpl$DuplexContextImpl

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.