]> code.citadel.org Git - citadel.git/commitdiff
* Changes to mime parser ... still something wrong
authorArt Cancro <ajc@citadel.org>
Wed, 30 May 2001 01:06:57 +0000 (01:06 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 30 May 2001 01:06:57 +0000 (01:06 +0000)
webcit/ChangeLog
webcit/mime_parser.c
webcit/webcit.c

index 98f2da669567447945960291f23690a8b960aa74..df478c028dc4e7c166bacbf22d9e940a901bc22c 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 213.18  2001/05/30 01:06:57  ajc
+* Changes to mime parser ... still something wrong
+
 Revision 213.17  2001/05/28 19:27:29  ajc
 * Fixed bug which marked all messages in Lobby as old before reading at login
 
@@ -559,4 +562,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index d197c5cac88feeb3e270478bc7f0fbe579bf6cad..69873ef14ad8b3c3e95738ae8af3f07f9f1a70a6 100644 (file)
@@ -314,8 +314,8 @@ void the_mime_parser(char *partnum,
        strcpy(header, "");
        do {
                ptr = memreadline(ptr, buf, sizeof buf);
-               if (*ptr == 0)
-                       return; /* premature end of message */
+               /* if (*ptr == 0)
+                       return;  premature end of message */
                if (content_end != NULL)
                        if (ptr >= content_end)
                                return;
@@ -408,7 +408,7 @@ void the_mime_parser(char *partnum,
                                }
                                part_start = ptr;
                        }
-               } while ( (strcasecmp(buf, endary)) && (ptr != 0) );
+               } while ( (strcasecmp(buf, endary)) && (ptr <= content_end) );
 END_MULTI:     if (PostMultiPartCallBack != NULL) {
                        PostMultiPartCallBack("", "", partnum, "", NULL,
                                content_type, 0, encoding, userdata);
@@ -418,10 +418,11 @@ END_MULTI:        if (PostMultiPartCallBack != NULL) {
 
        /* If it's not a multipart message, then do something with it */
        if (!is_multipart) {
+               fprintf(stderr, "doing non-multipart thing\n");
                part_start = ptr;
                length = 0;
-               while ((*ptr != 0)
-                     && ((content_end == NULL) || (ptr < content_end))) {
+               while ( ( (*ptr != 0) && (content_end != NULL) )
+                     || (ptr < content_end) ) {
                        ++length;
                        part_end = ptr++;
                }
index 0f06876bc6b559b18dc012bffa0c79b3c0f09bf7..6cb40a0cfea647526d6e6c059ffcd6406464e272 100644 (file)
@@ -601,6 +601,7 @@ void session_loop(struct httprequest *req)
        struct httprequest *hptr;
        char browser_host[256];
        char user_agent[256];
+       FILE *fp;
 
        /* We stuff these with the values coming from the client cookies,
         * so we can use them to reconnect a timed out session if we have to.
@@ -665,6 +666,9 @@ void session_loop(struct httprequest *req)
                              "application/x-www-form-urlencoded", 33)) {
                        addurls(content);
                } else if (!strncasecmp(ContentType, "multipart", 9)) {
+                       fp = fopen("mime.out", "wb");
+                       fwrite(content, ContentLength, 1, fp);
+                       fclose(fp);
                        content_end = content + ContentLength;
                        mime_parser(content, content_end, *upload_handler,
                                        NULL, NULL, NULL, 0);