Package rabbit.http

Examples of rabbit.http.HttpHeader


             HttpHeader header,
             Connection.RequestHandler rh) {
  CacheEntry entry = rh.entry;
  if (entry == null)
      return null;
  HttpHeader oldresp = rh.dataHook;
  HttpHeader expfail = checkExpectations (con, header, oldresp);
  if (expfail != null)
      return expfail;
  String im = header.getHeader ("If-Match");
  if (im == null)
      return null;
View Full Code Here


    public boolean checkCachedEntry (Connection con,
             HttpHeader header,
             Connection.RequestHandler rh) {
  con.getCounter ().inc ("Cache hits");
  con.setKeepalive (true);
  HttpHeader resp = checkIfMatch (con, header, rh);
  if (resp == null) {
      NotModifiedHandler nmh = new NotModifiedHandler ();
      resp = nmh.is304 (header, con, rh);
  }
  if (resp != null) {
View Full Code Here

      int port2 = u2.getPort ();
      if (port2 == -1)
    port2 = 80;
      if (port1 != port2)
    return;
      HttpHeader h = new HttpHeader ();
      h.setRequestURI (u2.toString ());
      cache.remove (h);
  } catch (MalformedURLException e) {
      logger.logWarn ("removeCaches got bad url: " +
          request.getRequestURI () + ", " +
          loc + ": " + e);
View Full Code Here

  if (buffer.remaining () > 4 && !matchBuffer (HTTP_IDENTIFIER)) {
      Logger log = getLogger ();
      log.logWarn ("http response header with odd start:" +
       getBufferStartString (5));
      header = new HttpHeader ();
      header.setStatusLine ("HTTP/1.1 200 OK");
      header.setHeader ("Connection", "close");
      return true;
  }
View Full Code Here

      headerRead = header != null;
      return;
  }

  if (header == null) {
      header = new HttpHeader ();
      header.setRequestLine (line);
      headerRead = false;
      return;
  }
View Full Code Here

     * @return null if all is ok, a HttpHeader if this request is blocked.
     */
    public HttpHeader filterHttpIn (Connection con,
            SocketChannel channel, HttpHeader in) {
  for (HttpFilter hf : httpInFilters) {
      HttpHeader badresponse =
    hf.doHttpInFiltering (channel, in, con);
      if (badresponse != null)
    return badresponse;     
  }
  return null;
View Full Code Here

     * @return null if all is ok, a HttpHeader if this request is blocked.
     */
    public HttpHeader filterHttpOut (Connection con,
            SocketChannel channel, HttpHeader in) {
  for (HttpFilter hf : httpOutFilters) {
      HttpHeader badresponse =
    hf.doHttpOutFiltering (channel, in, con);
      if (badresponse != null)
    return badresponse;     
  }
  return null;
View Full Code Here

    if (allowMeta) {
        String metaStart = "http://" +
      con.getProxy ().getHost ().getHostName () + ":" +
      con.getProxy ().getPort () + "/";
        if (!s.startsWith (metaStart)) {
      HttpHeader ret = con.getHttpGenerator ().get403 ();
      return ret;
        }
    }
      }
  }
View Full Code Here

    con.setMayCache (false);
    con.setMayFilter (false);
    if (!userHandler.isValidUser (con.getUserName (),
                con.getPassword ())
        && !isPublic (url)) {
        HttpHeader ret =
      con.getHttpGenerator ().get407 (uhost + ":" +
                urlport, url);
        return ret;
    }
    con.setMeta (true);
View Full Code Here

           String val) {
  try {
      BigInteger bi = new BigInteger (val);
      if (bi.equals (ZERO)) {
    if (header.getMethod ().equals ("TRACE")) {
        HttpHeader ret = con.getHttpGenerator ().get200 ();
        ret.setContent (header.toString ());
        return ret;
    } else {
        HttpHeader ret = con.getHttpGenerator ().get200 ();
        ret.setHeader ("Allow", "GET,HEAD,POST,OPTIONS,TRACE");
        ret.setHeader ("Content-Length", "0");
        return ret;
    }
      } else {
    BigInteger b3 = bi.subtract (ONE);
    header.setHeader ("Max-Forwards", b3.toString ());
View Full Code Here

TOP

Related Classes of rabbit.http.HttpHeader

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.