aboutsummaryrefslogtreecommitdiffstats
path: root/mail/procmail
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1998-05-16 07:23:45 +0800
committerache <ache@FreeBSD.org>1998-05-16 07:23:45 +0800
commit2fc3df68b4077ab1f361088b3b428c37a0da30bf (patch)
treed39174eaa80250efa5c4c195bef6a411816c493c /mail/procmail
parent7fcf3cfaa32c92c98141a7b64229f6569d0c9eac (diff)
downloadfreebsd-ports-gnome-2fc3df68b4077ab1f361088b3b428c37a0da30bf.tar.gz
freebsd-ports-gnome-2fc3df68b4077ab1f361088b3b428c37a0da30bf.tar.zst
freebsd-ports-gnome-2fc3df68b4077ab1f361088b3b428c37a0da30bf.zip
Fix big messages realloc strategy
Diffstat (limited to 'mail/procmail')
-rw-r--r--mail/procmail/files/patch-ae32
1 files changed, 32 insertions, 0 deletions
diff --git a/mail/procmail/files/patch-ae b/mail/procmail/files/patch-ae
new file mode 100644
index 000000000000..21a510ef7ccb
--- /dev/null
+++ b/mail/procmail/files/patch-ae
@@ -0,0 +1,32 @@
+*** src/pipes.c.bak Mon Apr 28 04:27:47 1997
+--- src/pipes.c Sat May 16 03:22:43 1998
+***************
+*** 234,239 ****
+--- 234,240 ----
+
+ char*readdyn(bf,filled)char*bf;long*const filled;
+ { int i;long oldsize;
++ long fetched = *filled;
+ oldsize= *filled;
+ goto jumpin;
+ do
+***************
+*** 243,249 ****
+ if((size_t)*filled>=(size_t)(*filled+BLKSIZ))
+ lcking|=lck_MEMORY,nomemerr();
+ #endif
+! bf=realloc(bf,*filled+BLKSIZ); /* dynamically adjust the buffer size */
+ jumpback:;
+ }
+ while(0<(i=rread(STDIN,bf+*filled,BLKSIZ))); /* read mail */
+--- 244,253 ----
+ if((size_t)*filled>=(size_t)(*filled+BLKSIZ))
+ lcking|=lck_MEMORY,nomemerr();
+ #endif
+! if( fetched - *filled < BLKSIZ ) {
+! fetched += 4194304;
+! bf=realloc(bf,fetched); /* dynamically adjust the buffer size */
+! }
+ jumpback:;
+ }
+ while(0<(i=rread(STDIN,bf+*filled,BLKSIZ))); /* read mail */