]> code.citadel.org Git - citadel.git/commitdiff
* Downloading of attachments was completely broken by the change to the new
authorArt Cancro <ajc@citadel.org>
Wed, 26 Mar 2003 05:17:12 +0000 (05:17 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 26 Mar 2003 05:17:12 +0000 (05:17 +0000)
  protocol library.  Located and fixed bugs.
* html.c: increased the conversion buffer size

citadel/ChangeLog
citadel/citadel_ipc.c
citadel/html.c
citadel/messages.c

index ce40fa5a92282049605bae0106cb04c6a7c4b8f3..76b3446f5786aea1c449a4408c0f8993e4dbcb0f 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 605.28  2003/03/26 05:17:12  ajc
+ * Downloading of attachments was completely broken by the change to the new
+   protocol library.  Located and fixed bugs.
+ * html.c: increased the conversion buffer size
+
  Revision 605.27  2003/03/24 03:42:14  ajc
  * Add the ability to quit out while validating users.  Also added a help
    option listing available access levels.  This closes Bugzilla #37.
@@ -4592,4 +4597,3 @@ 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 5405dbc30a730be81e04dd401e3fcc19be2acbb5..443fae3b40d7921265755bde6204c43eca073680 100644 (file)
@@ -1193,8 +1193,9 @@ int CtdlIPCAttachmentDownload(CtdlIPC *ipc, long msgnum, const char *part,
                ipc->downloading = 1;
                bytes = extract_long(cret, 0);
                last_mod = extract_int(cret, 1);
-               extract(mimetype, cret, 2);
-/*             ret = CtdlIPCReadDownload(ipc, buf, bytes, 0, progress_gauge_callback, cret); */
+               extract(filename, cret, 2);
+               extract(mimetype, cret, 3);
+               /* ret = CtdlIPCReadDownload(ipc, buf, bytes, 0, progress_gauge_callback, cret); */
                ret = CtdlIPCHighSpeedReadDownload(ipc, buf, bytes, 0, progress_gauge_callback, cret);
                ret = CtdlIPCEndDownload(ipc, cret);
                if (ret / 100 == 2)
@@ -2170,7 +2171,6 @@ int CtdlIPCReadDownload(CtdlIPC *ipc, void **buf, size_t bytes, size_t resume,
        return len;
 }
 
-
 /* READ - pipelined */
 int CtdlIPCHighSpeedReadDownload(CtdlIPC *ipc, void **buf, size_t bytes,
               size_t resume,
index af5c6e66b2560c9194a6baf0bda1f95873d2929f..cda8178491cf4fd684f091a331e25278c85fec8e 100644 (file)
@@ -77,7 +77,7 @@ char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
 
        do {
                /* Fill the input buffer */
-               if ( (done_reading == 0) && (strlen(inbuf) < 128) ) {
+               if ( (done_reading == 0) && (strlen(inbuf) < (SIZ-128)) ) {
 
                        ch = *inputmsg++;
                        if (ch > 0) {
@@ -236,9 +236,9 @@ char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
                }
 
                /* Make sure the output buffer is big enough */
-               if ((output_len + strlen(outbuf) + 128)
+               if ((output_len + strlen(outbuf) + SIZ)
                   > outptr_buffer_size) {
-                       outptr_buffer_size += 128;
+                       outptr_buffer_size += SIZ;
                        outptr = realloc(outptr, outptr_buffer_size);
                }
 
index a8cf2d1eb764a35d8eb5b61842ad4c266da110f6..f809aabc4edbf11bb96de45669cb8fa67ee2b59d 100644 (file)
@@ -1542,13 +1542,11 @@ RMSGREAD:       scr_flush();
                                  ((sizeof filename) - 1));
                        r = CtdlIPCAttachmentDownload(ipc, msg_arr[a],
                                        filename, &attachment, progress, cmd);
-                       extract(filename, cmd, 2);
-                       destination_directory(save_to, filename);
-                       r = CtdlIPCAttachmentDownload(ipc, msg_arr[a],
-                               filename, &attachment, progress, cmd);
                        if (r / 100 != 2) {
                                scr_printf("%s\n", cmd);
                        } else {
+                               extract(filename, cmd, 2);
+                               destination_directory(save_to, filename);
                                save_buffer(attachment,
                                                extract_unsigned_long(cmd, 0),
                                                save_to);