httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@manyfish.co.uk>
Subject [PATCH] fix mod_dav If: weak etag comparison
Date Sat, 15 Mar 2003 11:36:03 GMT
Hi, the change in r1.45 of dav/main/util.c doesn't seem to work, since
weak etags look like W/"etag" not "W/etag" as the code expects.  Here is
a fix:

Index: modules/dav/main/util.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/dav/main/util.c,v
retrieving revision 1.47
diff -u -r1.47 util.c
--- modules/dav/main/util.c	3 Feb 2003 17:52:58 -0000	1.47
+++ modules/dav/main/util.c	15 Mar 2003 11:29:04 -0000
@@ -1079,24 +1079,15 @@
                 /* Do a weak entity comparison function as defined in
                  * RFC 2616 13.3.3.
                  */
-                if (state_list->etag[0] == '"' &&
-                    state_list->etag[1] == 'W' &&
-                    state_list->etag[2] == '/') {
-                    new_etag = apr_pstrdup(p, state_list->etag);
-                    new_etag += 2;
-                    new_etag[0] = '"';
-                    given_etag = new_etag;
+                if (state_list->etag[0] == 'W' &&
+                    state_list->etag[1] == '/') {
+                    given_etag = apr_pstrdup(p, state_list->etag + 2);
                 }
                 else {
                     given_etag = state_list->etag;
                 }
-                if (etag[0] == '"' &&
-                    etag[1] == 'W' &&
-                    etag[2] == '/') {
-                    new_etag = apr_pstrdup(p, etag);
-                    new_etag += 2;
-                    new_etag[0] = '"';
-                    current_etag = new_etag;
+                if (etag[0] == 'W' && etag[1] == '/') {
+                    current_etag = apr_pstrdup(p, etag + 2);
                 }
                 else {
                     current_etag = etag;

Mime
View raw message