httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From max...@apache.org
Subject svn commit: r376521 - in /httpd/mod_mbox: branches/surgery/src/libmbox/mbox_mime.c trunk/module-2.0/mod_mbox_mime.c
Date Fri, 10 Feb 2006 01:07:40 GMT
Author: maxime
Date: Thu Feb  9 17:07:39 2006
New Revision: 376521

URL: http://svn.apache.org/viewcvs?rev=376521&view=rev
Log:
Fix mail headers bound search, thus avoiding finding headers in the
mail body.


Modified:
    httpd/mod_mbox/branches/surgery/src/libmbox/mbox_mime.c
    httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c

Modified: httpd/mod_mbox/branches/surgery/src/libmbox/mbox_mime.c
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/branches/surgery/src/libmbox/mbox_mime.c?rev=376521&r1=376520&r2=376521&view=diff
==============================================================================
--- httpd/mod_mbox/branches/surgery/src/libmbox/mbox_mime.c (original)
+++ httpd/mod_mbox/branches/surgery/src/libmbox/mbox_mime.c Thu Feb  9 17:07:39 2006
@@ -35,10 +35,18 @@
         return NULL;
     }
 
-    /* Locate the end of part headers */
-    headers_bound = ap_strstr(body, "\n\n");
-    if (!headers_bound) {
-        return NULL;
+    /* Locate the end of part headers. If no Content-Type is provided,
+       we are in a subpart of a multipart message, thus including part
+       headers: the headers bound is '\n\n'. Otherwise, the headers
+       bound is at the begining of the mail body. */
+    if (!ct) {
+        headers_bound = ap_strstr(body, "\n\n");
+        if (!headers_bound) {
+            return NULL;
+        }
+    }
+    else {
+        headers_bound = body;
     }
 
     /* If no Content-Type is provided, it means that we are parsing a

Modified: httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c?rev=376521&r1=376520&r2=376521&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c Thu Feb  9 17:07:39 2006
@@ -35,9 +35,14 @@
     }
 
     /* Locate the end of part headers */
-    headers_bound = ap_strstr(body, "\n\n");
-    if (!headers_bound) {
-        return NULL;
+    if (!ct) {
+        headers_bound = ap_strstr(body, "\n\n");
+        if (!headers_bound) {
+          return NULL;
+        }
+    }
+    else {
+        headers_bound = body;
     }
 
     /* If no Content-Type is provided, it means that we are parsing a



Mime
View raw message