httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: httpd-2.0/modules/dav/main util.c
Date Tue, 25 Nov 2003 13:54:39 GMT
jorton      2003/11/25 05:54:39

  Modified:    modules/dav/main util.c
  Log:
  * modules/dav/main/util.c (dav_validate_resource_state): Simplify weak
  etag comparison to avoid unnecessary tests and pstrdup calls.
  
  Revision  Changes    Path
  1.49      +4 -11     httpd-2.0/modules/dav/main/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/dav/main/util.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -u -r1.48 -r1.49
  --- util.c	22 Apr 2003 21:52:46 -0000	1.48
  +++ util.c	25 Nov 2003 13:54:39 -0000	1.49
  @@ -1073,28 +1073,21 @@
               case dav_if_etag:
               {
                   const char *given_etag, *current_etag;
  -                char *new_etag;
                   int mismatch;
   
                   /* Do a weak entity comparison function as defined in
                    * RFC 2616 13.3.3.
                    */
                   if (state_list->etag[0] == 'W' &&
  -                    state_list->etag[1] == '/' &&
  -                    state_list->etag[2] == '"') {
  -                    new_etag = apr_pstrdup(p, state_list->etag);
  -                    new_etag += 2;
  -                    given_etag = new_etag;
  +                    state_list->etag[1] == '/') {
  +                    given_etag = state_list->etag + 2;
                   }
                   else {
                       given_etag = state_list->etag;
                   }
                   if (etag[0] == 'W' &&
  -                    etag[1] == '/' &&
  -                    etag[2] == '"') {
  -                    new_etag = apr_pstrdup(p, etag);
  -                    new_etag += 2;
  -                    current_etag = new_etag;
  +                    etag[1] == '/') {
  +                    current_etag = etag + 2;
                   }
                   else {
                       current_etag = etag;
  
  
  

Mime
View raw message