]> code.citadel.org Git - citadel.git/commitdiff
Tests and preparation for another mime parser update
authorArt Cancro <ajc@citadel.org>
Wed, 21 Mar 2007 21:49:55 +0000 (21:49 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 21 Mar 2007 21:49:55 +0000 (21:49 +0000)
webcit/messages.c
webcit/webcit.c

index 65a322e28e67fc6db5d69d3610cc5c69b28d54f3..51a3d827ed8eb45b1674429769c31a57316ff7c7 100644 (file)
@@ -2594,7 +2594,7 @@ void post_mime_to_server(void) {
        }
 
        if (is_multipart) {
-               sprintf(boundary, "=_Citadel_Multipart_%s_%04x%04x",
+               sprintf(boundary, "Citadel--Multipart--%s--%04x--%04x",
                        serv_info.serv_fqdn,
                        getpid(),
                        ++seq
@@ -2670,6 +2670,7 @@ void post_message(void)
 
        if (WC->upload_length > 0) {
 
+               lprintf(9, "%s:%d: we are uploading %d bytes\n", __FILE__, __LINE__, WC->upload_length);
                /** There's an attachment.  Save it to this struct... */
                att = malloc(sizeof(struct wc_attachment));
                memset(att, 0, sizeof(struct wc_attachment));
@@ -2712,12 +2713,15 @@ void post_message(void)
        }
 
        if (strlen(bstr("cancel_button")) > 0) {
+               lprintf(9, "%s:%d: cancel button was pressed\n", __FILE__, __LINE__);
                sprintf(WC->ImportantMessage, 
                        _("Cancelled.  Message was not posted."));
        } else if (strlen(bstr("attach_button")) > 0) {
+               lprintf(9, "%s:%d: attach button was pressed\n", __FILE__, __LINE__);
                display_enter();
                return;
        } else if (atol(bstr("postseq")) == dont_post) {
+               lprintf(9, "%s:%d: postseq does not match\n", __FILE__, __LINE__);
                sprintf(WC->ImportantMessage, 
                        _("Automatically cancelled because you have already "
                        "saved this message."));
@@ -2747,6 +2751,7 @@ void post_message(void)
                        }
                        dont_post = atol(bstr("postseq"));
                } else {
+                       lprintf(9, "%s:%d: server post error\n", __FILE__, __LINE__);
                        sprintf(WC->ImportantMessage, "%s", &buf[4]);
                        display_enter();
                        return;
index eeed42acca84a9f7ad9a4cd3475abb7df4283d7b..a94644940657ec029c61e54d285f1d79d8f5fcf0 100644 (file)
@@ -848,8 +848,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
 {
        struct urlcontent *u;
 
-       /* lprintf(9, "upload_handler() name=%s, type=%s, len=%d\n",
-               name, cbtype, length); */
+       lprintf(9, "upload_handler() name=%s, type=%s, len=%d\n", name, cbtype, length);
 
        /* Form fields */
        if ( (length > 0) && (strlen(cbtype) == 0) ) {
@@ -1127,16 +1126,13 @@ void session_loop(struct httprequest *req)
                body_start = strlen(content);
 
                /** Read the entire input data at once. */
-               client_read(WC->http_sock, &content[BytesRead+body_start],
-                       ContentLength);
+               client_read(WC->http_sock, &content[BytesRead+body_start], ContentLength);
 
-               if (!strncasecmp(ContentType,
-                             "application/x-www-form-urlencoded", 33)) {
+               if (!strncasecmp(ContentType, "application/x-www-form-urlencoded", 33)) {
                        addurls(&content[body_start]);
                } else if (!strncasecmp(ContentType, "multipart", 9)) {
                        content_end = content + ContentLength + body_start;
-                       mime_parser(content, content_end, *upload_handler,
-                                       NULL, NULL, NULL, 0);
+                       mime_parser(content, content_end, *upload_handler, NULL, NULL, NULL, 0);
                }
        } else {
                content = NULL;