httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r160693 - httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
Date Sat, 09 Apr 2005 16:34:34 GMT
Author: mturk
Date: Sat Apr  9 09:34:33 2005
New Revision: 160693

URL: http://svn.apache.org/viewcvs?view=rev&rev=160693
Log:
Simplify canon_handler. There is no thing like ajps:
protocol.

Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?view=diff&r1=160692&r2=160693
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Sat Apr  9 09:34:33 2005
@@ -30,23 +30,15 @@
 {
     char *host, *path, *search, sport[7];
     const char *err;
-    const char *scheme;
-    apr_port_t port, def_port;
+    apr_port_t port = AJP13_DEF_PORT;
 
     /* ap_port_of_scheme() */
     if (strncasecmp(url, "ajp:", 4) == 0) {
         url += 4;
-        scheme = "ajp";
     }    
-    /* XXX This is probably faulty */ 
-    else if (strncasecmp(url, "ajps:", 5) == 0) {
-        url += 5;
-        scheme = "ajps";
-    }
     else {
         return DECLINED;
     }
-    def_port = apr_uri_port_of_scheme(scheme);
 
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
              "proxy: AJP: canonicalising URL %s", url);
@@ -54,7 +46,6 @@
     /* do syntatic check.
      * We break the URL into host, port, path, search
      */
-    port = def_port;
     err = ap_proxy_canon_netloc(r->pool, &url, NULL, NULL, &host, &port);
     if (err) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
@@ -81,15 +72,12 @@
     if (path == NULL)
         return HTTP_BAD_REQUEST;
 
-    if (port != def_port)
-        apr_snprintf(sport, sizeof(sport), ":%d", port);
-    else
-        sport[0] = '\0';
+    apr_snprintf(sport, sizeof(sport), ":%d", port);
 
     if (ap_strchr_c(host, ':')) { /* if literal IPv6 address */
         host = apr_pstrcat(r->pool, "[", host, "]", NULL);
     }
-    r->filename = apr_pstrcat(r->pool, "proxy:", scheme, "://", host, sport, 
+    r->filename = apr_pstrcat(r->pool, "proxy:ajp://", host, sport, 
             "/", path, (search) ? "?" : "", (search) ? search : "", NULL);
     return OK;
 }



Mime
View raw message