httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roy Fielding <field...@hyperreal.com>
Subject cvs commit: apache/src util_script.c
Date Sun, 11 May 1997 23:13:23 GMT
fielding    97/05/11 16:13:23

  Modified:    src       util_script.c
  Log:
  Just in case, added comments and fixed assumption about the_request
  in original_uri().
  
  Revision  Changes    Path
  1.58      +12 -5     apache/src/util_script.c
  
  Index: util_script.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/util_script.c,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -C3 -r1.57 -r1.58
  *** util_script.c	1997/05/08 07:32:32	1.57
  --- util_script.c	1997/05/11 23:13:22	1.58
  ***************
  *** 238,253 ****
        return lu;
    }
    
    static char *original_uri(request_rec *r)
    {
  !     char *last;
  !     char *first = r->the_request;
    
  !     while (*first && !isspace(*first)) ++first;
  !     while (isspace(*first)) ++first;
    
        last = first;
  !     while (*last && !isspace(*last)) ++last;
        
        return pstrndup(r->pool, first, last - first);
    }
  --- 238,260 ----
        return lu;
    }
    
  + /* Obtain the Request-URI from the original request-line, returning
  +  * a new string from the request pool containing the URI or "".
  +  */
    static char *original_uri(request_rec *r)
    {
  !     char *first, *last;
    
  !     if (r->the_request == NULL)
  !         return (char *)pcalloc(r->pool, 1);
  ! 
  !     first = r->the_request;                      /* use the request-line */
  ! 
  !     while (*first && !isspace(*first)) ++first;  /* skip over the method */
  !     while (isspace(*first)) ++first;             /*   and the space(s)   */
    
        last = first;
  !     while (*last && !isspace(*last)) ++last;     /* end at next whitespace */
        
        return pstrndup(r->pool, first, last - first);
    }
  
  
  

Mime
View raw message