dgaudet     98/02/18 03:59:21

  Modified:    src/main http_protocol.c
  Log:
  Fix absoluteURI problem introduced by the http_method() stuff... do a little
  cleanup.  This isn't everything needed to get absoluteURIs working properly,
  they're still at least as broken as they were a week or two ago.  I'm hoping
  Martin can get his uri parsing patch into the server, and when he does that
  I can finish the fixes for absoluteURIs.
  
  Revision  Changes    Path
  1.189     +21 -10    apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.188
  retrieving revision 1.189
  diff -u -r1.188 -r1.189
  --- http_protocol.c   1998/02/09 01:09:40     1.188
  +++ http_protocol.c   1998/02/18 11:59:20     1.189
  @@ -625,8 +625,8 @@
   
   const char *check_fulluri(request_rec *r, const char *uri)
   {
  -    char *name, *host, *proto;
  -    int i, plen;
  +    char *host, *proto, *slash, *colon;
  +    int plen;
       unsigned port;
   
       /* This routine parses full URLs, if they match the server */
  @@ -635,18 +635,29 @@
       
       if (strncasecmp(uri, proto, plen) || strncasecmp(uri + plen, "://", 3))
           return uri;
  -    name = pstrdup(r->pool, uri + plen);
  +    host = pstrdup(r->pool, uri + plen + 3);
   
       /* Find the hostname, assuming a valid request */
  -    i = ind(name, '/');
  -    name[i] = '\0';
  +    slash = strchr(host, '/');
  +    if (slash) {
  +        *slash = 0;
  +    }
  +    else {
  +        slash = host + strlen(host);
  +    }
   
       /* Find the port */
  -    host = getword_nc(r->pool, &name, ':');
  -    if (*name)
  -        port = atoi(name);
  -    else
  +    colon = strchr(host, ':');
  +    if (colon) {
  +        *colon = '\0';
  +        port = atoi(colon+1);
  +        if (port == 0) {
  +            return uri;
  +        }
  +    }
  +    else {
           port = default_port(r);
  +    }
   
       /* Make sure ports patch */
       if (port != r->server->port)
  @@ -654,7 +665,7 @@
   
       /* Save it for later use */
       r->hostname = pstrdup(r->pool, host);
  -    r->hostlen = plen + 3 + i;
  +    r->hostlen = plen + 3 + slash - host;
   
       /* The easy cases first */
       if (!strcasecmp(host, r->server->server_hostname)) {
  
  
  

Reply via email to