You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@apache.org on 2005/08/31 13:17:40 UTC

svn commit: r265015 - in /httpd/mod_mbox/branches/httpd-mbox-if: STATUS module-2.0/mod_mbox.h module-2.0/mod_mbox_mime.c module-2.0/mod_mbox_out.c

Author: maxime
Date: Wed Aug 31 04:17:33 2005
New Revision: 265015

URL: http://svn.apache.org/viewcvs?rev=265015&view=rev
Log:
Next mod_mbox release gets close.

 * module-2.0/mod_mbox.h, module-2.0/mod_mbox_mime.c:
    More flexible mbox_mime_decode_body function.

 * module-2.0/mod_mbox_out.c:
    (mbox_raw_message): use the new version of the
mbox_mime_decode_body function when displaying raw mail body.
    (mbox_ajax_browser, mbox_static_msglist): added list index link.

 * STATUS:
    Fixed some^Wa lot of typos ;-)

Fixed some typos in the STATUS file.


Modified:
    httpd/mod_mbox/branches/httpd-mbox-if/STATUS
    httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox.h
    httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_mime.c
    httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_out.c

Modified: httpd/mod_mbox/branches/httpd-mbox-if/STATUS
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/branches/httpd-mbox-if/STATUS?rev=265015&r1=265014&r2=265015&view=diff
==============================================================================
--- httpd/mod_mbox/branches/httpd-mbox-if/STATUS (original)
+++ httpd/mod_mbox/branches/httpd-mbox-if/STATUS Wed Aug 31 04:17:33 2005
@@ -18,10 +18,10 @@
       - For users       : usage, interface description, ...
 
     * Charset conversions (to UTF-8). APR-Xlate features are nice, but
-      the conversion are easy only from APR v1.1.0. Multibyte
+      the conversion is easy only from APR v1.1.0. Multibyte
       characters conversion with APR v0.x is a pain.
 
-    * Better page selector (usefull for 10+ pages archives)
+    * Better page selector (useful for 10+ pages archives)
 
 Wish list:
 
@@ -45,7 +45,7 @@
 
     Internet Explorer:
 
-      * _msglist is not considered as definied in the
+      * _msglist is not considered as defined in the
         drawFullMsgList() function. Still, it should have been set by
 	getMsgList() just before the call to drawFullMsgList().
       * local variable scope is not supported. the
@@ -56,7 +56,7 @@
       * Browser crashes when calling toggleMessage(). Some debugging
         did not help locating the bug (sometimes in the
         toggleMessage() function, sometimes in the
-        buildMessageListEntry() function ...
+        buildMessageListEntry() function ...)
 
     Konqueror:
 

Modified: httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox.h
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox.h?rev=265015&r1=265014&r2=265015&view=diff
==============================================================================
--- httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox.h (original)
+++ httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox.h Wed Aug 31 04:17:33 2005
@@ -128,7 +128,7 @@
 mbox_mime_message_t *mbox_mime_decode_multipart(apr_pool_t *p, char *body,
 						char *ct, mbox_cte_e cte,
 						char *boundary);
-char *mbox_mime_decode_body(apr_pool_t *p, mbox_mime_message_t *m);
+char *mbox_mime_decode_body(apr_pool_t *p, mbox_cte_e cte, char *body, apr_size_t len);
 char *mbox_mime_get_body(apr_pool_t *p, mbox_mime_message_t *m);
 void mbox_mime_display_static_structure(request_rec *r, mbox_mime_message_t *m,
 					char *link);

Modified: httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_mime.c
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_mime.c?rev=265015&r1=265014&r2=265015&view=diff
==============================================================================
--- httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_mime.c (original)
+++ httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_mime.c Wed Aug 31 04:17:33 2005
@@ -268,27 +268,19 @@
 }
 
 /* Decode a MIME part body, according to its CTE. */
-char *mbox_mime_decode_body(apr_pool_t *p, mbox_mime_message_t *m)
+char *mbox_mime_decode_body(apr_pool_t *p, mbox_cte_e cte, char *body, apr_size_t len)
 {
-    apr_size_t len = m->body_len;
-    char *new_body = NULL;
+    char *new_body = apr_pstrndup(p, body, len);
 
-    if (m->cte == CTE_BASE64) {
-        new_body = apr_pstrndup(p, m->body, m->body_len);
-	len = mbox_cte_decode_b64(new_body);
-
-	new_body[len] = 0;
-	m->body = new_body;
+    if (cte == CTE_BASE64) {
+        len = mbox_cte_decode_b64(new_body);
     }
-    else if (m->cte == CTE_QP) {
-        new_body = apr_pstrndup(p, m->body, m->body_len);
+    else if (cte == CTE_QP) {
 	len = mbox_cte_decode_qp(new_body);
-
-	new_body[len] = 0;
-	m->body = new_body;
     }
 
-    return m->body;
+    new_body[len] = 0;
+    return new_body;
 }
 
 
@@ -304,10 +296,10 @@
     }
 
     if (strncasecmp(m->content_type, "text/", strlen("text/")) == 0) {
-        char *new_body = mbox_mime_decode_body(p, m);
+        char *new_body;
 
-	m->body_len = mbox_cte_escape_html(p, m->body, m->body_len, &new_body);
-	m->body = new_body;
+	new_body = mbox_mime_decode_body(p, m->cte, m->body, m->body_len);
+	m->body_len = mbox_cte_escape_html(p, new_body, m->body_len, &(m->body));
 
 	return apr_pstrndup(p, m->body, m->body_len);
     }

Modified: httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_out.c
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_out.c?rev=265015&r1=265014&r2=265015&view=diff
==============================================================================
--- httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_out.c (original)
+++ httpd/mod_mbox/branches/httpd-mbox-if/module-2.0/mod_mbox_out.c Wed Aug 31 04:17:33 2005
@@ -624,12 +624,17 @@
 					      strlen(".mbox") - 2), 2)) - 1][1],
 	       baseURI + (strlen(baseURI) - strlen(".mbox") - 6));
 
+    ap_rputs("  <h5>\n", r);
+
     if (conf->root_path) {
-        ap_rprintf(r, "  <h5><a href=\"%s\" title=\"Back to the archives depot\">"
-		   "Site index</a></h5>\n\n",
+        ap_rprintf(r, "<a href=\"%s\" title=\"Back to the archives depot\">"
+		   "Site index</a> &middot; ",
 		   conf->root_path);
     }
 
+    ap_rprintf(r, "<a href=\"%s\" title=\"Back to the list index\">"
+	       "List index</a></h5>", get_base_path(r));
+
     ap_rputs("  <table id=\"msglist\">\n", r);
     ap_rputs("   <thead><tr><th class=\"title\"><a href=\"browser\">Message list</a></th>", r);
 
@@ -746,12 +751,17 @@
     ap_rprintf(r, " <body id=\"archives\" onload=\"javascript:loadBrowser ('%s');\">\n", baseURI);
     ap_rputs("  <h1>Mailing list archives</h1>\n\n", r);
 
+    ap_rputs("  <h5>\n", r);
+
     if (conf->root_path) {
-        ap_rprintf(r, "  <h5><a href=\"%s\" title=\"Back to the archives depot\">"
-		   "Site index</a></h5>\n\n",
+        ap_rprintf(r, "<a href=\"%s\" title=\"Back to the archives depot\">"
+		   "Site index</a> &middot; ",
 		   conf->root_path);
     }
 
+    ap_rprintf(r, "<a href=\"%s\" title=\"Back to the list index\">"
+	       "List index</a></h5>", get_base_path(r));
+
     /* Output a small notice if no MboxScriptPath configuration
        directive was specified. */
     if (!conf->script_path) {
@@ -799,8 +809,11 @@
 
     /* Empty MIME part : we want only mail's body */
     if (part && !*part) {
+        apr_size_t len = m->body_end - m->body_start;
+
         ap_set_content_type(r, "text/plain");
-	ap_rprintf(r, "%s", m->raw_body);
+	ap_rprintf(r, "%s", mbox_mime_decode_body(r->pool, m->cte,
+						  m->raw_body, len));
 	return OK;
     }
 
@@ -845,7 +858,10 @@
     }
 
     mime_part->body[mime_part->body_len] = 0;
-    ap_rprintf(r, "%s", mbox_mime_decode_body(r->pool, mime_part));
+    ap_rprintf(r, "%s", mbox_mime_decode_body(r->pool,
+					      mime_part->cte,
+					      mime_part->body,
+					      mime_part->body_len));
 
     return OK;
 }