* Removed excessive trace messages that were slowing the server down
authorArt Cancro <ajc@citadel.org>
Thu, 24 Feb 2005 18:14:24 +0000 (18:14 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 24 Feb 2005 18:14:24 +0000 (18:14 +0000)
* Prepared for handling of setting flags in IMAP APPEND

citadel/ChangeLog
citadel/imap_fetch.c
citadel/imap_misc.c
citadel/serv_imap.c

index a875d261879448811aaa08256cba44dde45a3b73..d5f573a63c4a897b38cee96ef8efd4d9e4fb6668 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 641.2  2005/02/24 18:14:24  ajc
+ * Removed excessive trace messages that were slowing the server down
+ * Prepared for handling of setting flags in IMAP APPEND
+
  Revision 641.1  2005/02/23 04:24:57  ajc
  * When auto-creating Mail>, Sent Items>, etc... set view to VIEW_MAILBOX
 
@@ -6430,3 +6434,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 1672e6e5d0dff2b6b1f87dcbec78f4c2d6efc704..59c64d886675e4207d7868925b1494da8575a822 100644 (file)
@@ -182,8 +182,8 @@ void imap_fetch_rfc822(long msgnum, char *whichfmt) {
        fseek(tmp, 0L, SEEK_END);
        total_size = ftell(tmp);
        text_size = total_size - headers_size;
-       lprintf(CTDL_DEBUG, "RFC822: headers=%ld, text=%ld, total=%ld\n",
-               headers_size, text_size, total_size);
+       /* lprintf(CTDL_DEBUG, "RFC822: headers=%ld, text=%ld, total=%ld\n",
+               headers_size, text_size, total_size); */
 
        if (!strcasecmp(whichfmt, "RFC822.SIZE")) {
                cprintf("RFC822.SIZE %ld", total_size);
@@ -546,7 +546,7 @@ void imap_fetch_body(long msgnum, char *item, int is_peek) {
        if (strchr(section, '[') != NULL) {
                stripallbut(section, '[', ']');
        }
-       lprintf(CTDL_DEBUG, "Section is: %s%s\n", section, ((strlen(section)==0) ? "(empty)" : "") );
+       /* lprintf(CTDL_DEBUG, "Section is: %s%s\n", section, ((strlen(section)==0) ? "(empty)" : "") ); */
 
        /* Burn the cache if we don't have the same section of the 
         * same message again.
@@ -568,7 +568,7 @@ void imap_fetch_body(long msgnum, char *item, int is_peek) {
                is_partial = 1;
        }
        if (is_partial == 0) strcpy(partial, "");
-       if (strlen(partial) > 0) lprintf(CTDL_DEBUG, "Partial is %s\n", partial);
+       /* if (strlen(partial) > 0) lprintf(CTDL_DEBUG, "Partial is %s\n", partial); */
 
        if (IMAP->cached_body == NULL) {
                tmp = tmpfile();
@@ -593,9 +593,9 @@ void imap_fetch_body(long msgnum, char *item, int is_peek) {
 
        else if (!strcmp(section, "")) {
                CtdlRedirectOutput(tmp, -1);
-               lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
+               /* lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
                lprintf(CTDL_DEBUG, "msg %s null\n", ((msg == NULL) ? "is" : "is not") );
-               lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum);
+               lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum); */
                CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
                                                HEADERS_ALL, 0, 1);
                CtdlRedirectOutput(NULL, -1);
@@ -607,9 +607,9 @@ void imap_fetch_body(long msgnum, char *item, int is_peek) {
         */
        else if (!strncasecmp(section, "HEADER", 6)) {
                CtdlRedirectOutput(tmp, -1);
-               lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
+               /* lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
                lprintf(CTDL_DEBUG, "msg %s null\n", ((msg == NULL) ? "is" : "is not") );
-               lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum);
+               lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum); */
                CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
                                                HEADERS_ONLY, 0, 1);
                CtdlRedirectOutput(NULL, -1);
@@ -621,9 +621,9 @@ void imap_fetch_body(long msgnum, char *item, int is_peek) {
         */
        else if (!strncasecmp(section, "TEXT", 4)) {
                CtdlRedirectOutput(tmp, -1);
-               lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
+               /* lprintf(CTDL_DEBUG, "calling CtdlOutputPreLoadedMsg()\n");
                lprintf(CTDL_DEBUG, "msg %s null\n", ((msg == NULL) ? "is" : "is not") );
-               lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum);
+               lprintf(CTDL_DEBUG, "msgnum is %ld\n", msgnum); */
                CtdlOutputPreLoadedMsg(msg, msgnum, MT_RFC822,
                                                HEADERS_NONE, 0, 1);
                CtdlRedirectOutput(NULL, -1);
@@ -896,11 +896,6 @@ void imap_do_fetch_msg(int seq, int num_items, char **itemlist) {
        int i;
        struct CtdlMessage *msg = NULL;
 
-       lprintf(CTDL_DEBUG, "imap_do_fetch_msg(%d, %d)\n", seq, num_items);
-       for (i=0; i<num_items; ++i) {
-               lprintf(CTDL_DEBUG, "                  %s\n", itemlist[i]);
-       }
-
        cprintf("* %d FETCH (", seq);
 
        for (i=0; i<num_items; ++i) {
index 551605f306d9f14c5307b7a8a28d2a5bf6d42eda..bae8851a1317d053b19931d49e451d1577be43a1 100644 (file)
@@ -234,6 +234,14 @@ void imap_append(int num_parms, char *parms[]) {
                return;
        }
 
+       /* if (num_parms >= 5) {
+               FIXME add flags:  parms[3]
+       } */
+
+       /* if (num_parms >= 6) {
+               FIXME add internaldate: parms[4]
+       } */
+
        literal_length = atol(&parms[num_parms-1][1]);
        if (literal_length < 1) {
                cprintf("%s BAD Message length must be at least 1.\r\n",
@@ -250,8 +258,6 @@ void imap_append(int num_parms, char *parms[]) {
        IMAP->transmitted_length = literal_length;
 
        cprintf("+ Transmit message now.\r\n");
-       lprintf(CTDL_DEBUG, "imap_append() expecting %ld bytes\n",
-               literal_length);
 
        bytes_transferred = 0;
 
@@ -267,11 +273,6 @@ void imap_append(int num_parms, char *parms[]) {
                else {
                        bytes_transferred += blksize;           /* keep going */
                }
-               lprintf(CTDL_DEBUG, "Received %ld of %ld bytes (%ld%%)\n",
-                       bytes_transferred,
-                       literal_length,
-                       ((bytes_transferred * 100) / literal_length)
-               );
        } while (bytes_transferred < literal_length);
 
        IMAP->transmitted_message[literal_length] = 0;
@@ -279,7 +280,6 @@ void imap_append(int num_parms, char *parms[]) {
                cprintf("%s NO Read failed.\r\n", parms[0]);
                return;
        }
-       lprintf(CTDL_DEBUG, "imap_append() finished reading message\n");
 
        /* I think there's supposed to be a trailing CRLF after the
         * literal (the message text) is received.  This call to
@@ -287,10 +287,8 @@ void imap_append(int num_parms, char *parms[]) {
         */
        flush_output();
        client_getln(buf, sizeof buf);
-       lprintf(CTDL_DEBUG, "Trailing CRLF: %s\n", buf);
 
        /* Convert RFC822 newlines (CRLF) to Unix newlines (LF) */
-       lprintf(CTDL_DEBUG, "Converting newline format\n");
        stripped_length = 0;
        for (i=0; i<literal_length; ++i) {
                if (strncmp(&IMAP->transmitted_message[i], "\r\n", 2)) {
index 9a8084a4b1b0ff3433823859bc1654258439ed97..086d3591694f0f820a64f87a43ac34f932f340cc 100644 (file)
@@ -184,8 +184,8 @@ void imap_load_msgids(void)
                           imap_add_single_msgid, NULL);
 
        imap_set_seen_flags();
-       lprintf(CTDL_DEBUG, "imap_load_msgids() mapped %d messages\n",
-               IMAP->num_msgs);
+       /* lprintf(CTDL_DEBUG, "imap_load_msgids() mapped %d messages\n",
+               IMAP->num_msgs); */
 }