You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dg...@hyperreal.org on 1998/03/04 09:54:33 UTC

cvs commit: apache-1.3/src/modules/proxy mod_proxy.c

dgaudet     98/03/04 00:54:33

  Modified:    src/modules/proxy mod_proxy.c
  Log:
  Dean messed up ProxyPass, Mark fixed it.
  
  Submitted by:	Mark J Cox <ma...@awe.com>
  
  Revision  Changes    Path
  1.43      +25 -30    apache-1.3/src/modules/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/mod_proxy.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- mod_proxy.c	1998/03/02 06:51:15	1.42
  +++ mod_proxy.c	1998/03/04 08:54:32	1.43
  @@ -126,45 +126,40 @@
       void *sconf = r->server->module_config;
       proxy_server_conf *conf =
       (proxy_server_conf *) get_module_config(sconf, &proxy_module);
  +    int i, len;
  +    struct proxy_alias *ent = (struct proxy_alias *) conf->aliases->elts;
   
  -    if (conf->req) {
  -	if (!r->parsed_uri.scheme) {
  -	    return DECLINED; /* definately not a proxy request */
  -	}
  +    if (conf->req && r->parsed_uri.scheme) {
   	/* but it might be something vhosted */
  -	if (r->parsed_uri.hostname
  +       if (!(r->parsed_uri.hostname
   	    && !strcasecmp(r->parsed_uri.scheme, http_method(r))
   	    && matches_request_vhost(r, r->parsed_uri.hostname,
  -		r->parsed_uri.port_str ? r->parsed_uri.port : default_port(r))) {
  -	    return DECLINED; /* it's a vhost request */
  -	}
  -	r->proxyreq = 1;
  -	r->uri = r->unparsed_uri;
  -	r->filename = pstrcat(r->pool, "proxy:", r->uri, NULL);
  -	r->handler = "proxy-server";
  -	return OK;
  +               r->parsed_uri.port_str ? r->parsed_uri.port : default_port(r)))) {
  +           r->proxyreq = 1;
  +           r->uri = r->unparsed_uri;
  +           r->filename = pstrcat(r->pool, "proxy:", r->uri, NULL);
  +           r->handler = "proxy-server";
  +           return OK;
  +        }
       }
  -    else {
  -	/* XXX: since r->uri has been manipulated already we're not really
  -	 * compliant with RFC1945 at this point.  But this probably isn't
  -	 * an issue because this is a hybrid proxy/origin server.
  -	 */
  -	int i, len;
  -	struct proxy_alias *ent = (struct proxy_alias *) conf->aliases->elts;
   
  -	for (i = 0; i < conf->aliases->nelts; i++) {
  -	    len = alias_match(r->uri, ent[i].fake);
  +    /* XXX: since r->uri has been manipulated already we're not really
  +     * compliant with RFC1945 at this point.  But this probably isn't
  +     * an issue because this is a hybrid proxy/origin server.
  +     */
  +
  +    for (i = 0; i < conf->aliases->nelts; i++) {
  +        len = alias_match(r->uri, ent[i].fake);
   	    
  -	    if (len > 0) {
  -		r->filename = pstrcat(r->pool, "proxy:", ent[i].real,
  -				      r->uri + len, NULL);
  -		r->handler = "proxy-server";
  -		r->proxyreq = 1;
  -		return OK;
  -	    }
  +       if (len > 0) {
  +           r->filename = pstrcat(r->pool, "proxy:", ent[i].real,
  +                                 r->uri + len, NULL);
  +           r->handler = "proxy-server";
  +           r->proxyreq = 1;
  +           return OK;
   	}
  -	return DECLINED;
       }
  +    return DECLINED;
   }
   
   /* -------------------------------------------------------------- */