From 00408d4ecd62b73ad5a737495095a7dadb10b538 Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 15 Feb 2002 12:47:03 +0000 Subject: [PATCH] - prevent async buffer cache to grow over 400k Changed files: cvs-fixed_buffer.patch -> 1.1 --- cvs-fixed_buffer.patch | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 cvs-fixed_buffer.patch diff --git a/cvs-fixed_buffer.patch b/cvs-fixed_buffer.patch new file mode 100644 index 0000000..7ef63da --- /dev/null +++ b/cvs-fixed_buffer.patch @@ -0,0 +1,40 @@ +diff -ur cvs-1.11.1p1.orig/src/buffer.c cvs-1.11.1p1/src/buffer.c +--- cvs-1.11.1p1.orig/src/buffer.c Thu Apr 19 21:29:05 2001 ++++ cvs-1.11.1p1/src/buffer.c Thu Feb 14 13:22:23 2002 +@@ -1,6 +1,7 @@ + /* Code for the buffer data structure. */ + + #include ++#include + #include "cvs.h" + #include "buffer.h" + +@@ -292,15 +293,28 @@ + + if (nbytes != data->size) + { ++ struct buffer_data *p; ++ int cnt; ++ + /* Not all the data was written out. This is only + permitted in nonblocking mode. Adjust the buffer, + and return. */ + + assert (buf->nonblocking); + ++ cnt = 0; ++ for (p = data; p->next; p = p->next) ++ cnt++; ++ + data->size -= nbytes; + data->bufp += nbytes; + ++ /* Don't allow buffers to grow over 100 pages. */ ++ if (cnt > 100) { ++ usleep(100000); ++ continue; ++ } ++ + return 0; + } + } -- 2.44.0