From: Art Cancro Date: Thu, 3 Mar 2005 18:10:28 +0000 (+0000) Subject: * sysdep.c: change the algorithm for dynamically expanding the redirect X-Git-Tag: v7.86~4995 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=07478c0c53e90d47955167a45f7399617758e86c;p=citadel.git * sysdep.c: change the algorithm for dynamically expanding the redirect buffer's size. Large writes were overflowing it. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index c8d9ecedf..0a1536590 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 917cb1653..c4d255f79 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -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); }