* sysdep.c: change the algorithm for dynamically expanding the redirect
authorArt Cancro <ajc@citadel.org>
Thu, 3 Mar 2005 18:10:28 +0000 (18:10 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 3 Mar 2005 18:10:28 +0000 (18:10 +0000)
  buffer's size.  Large writes were overflowing it.

citadel/ChangeLog
citadel/sysdep.c

index c8d9ecedf6d2af01c60c856fd5b82f6aec16a3e5..0a15365901b9af5ada960ad6cb668be75bb26373 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 641.18  2005/03/03 18:10:27  ajc
+ * sysdep.c: change the algorithm for dynamically expanding the redirect
+   buffer's size.  Large writes were overflowing it.
+
  Revision 641.17  2005/03/03 17:56:53  ajc
  * Finished removing the use of temp files in IMAP.
    WARNING: DON'T USE THIS ON A PRODUCTION SYSTEM, IT HAS NOT BEEN
@@ -6496,3 +6500,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 917cb16537285ab6a887ae39116fcd08d6419b9f..c4d255f790985e55337b763d8a811e87f12220f0 100644 (file)
@@ -548,7 +548,7 @@ void client_write(char *buf, int nbytes)
 
        if (CC->redirect_buffer != NULL) {
                if ((CC->redirect_len + nbytes + 2) >= CC->redirect_alloc) {
-                       CC->redirect_alloc = CC->redirect_alloc * 2;
+                       CC->redirect_alloc = (CC->redirect_alloc * 2) + nbytes;
                        CC->redirect_buffer = realloc(CC->redirect_buffer,
                                                CC->redirect_alloc);
                }