]> git.pld-linux.org Git - packages/cvs.git/commitdiff
- prevent async buffer cache to grow over 400k
authorMichal Moskal <michal@moskal.me>
Fri, 15 Feb 2002 12:47:03 +0000 (12:47 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cvs-fixed_buffer.patch -> 1.1

cvs-fixed_buffer.patch [new file with mode: 0644]

diff --git a/cvs-fixed_buffer.patch b/cvs-fixed_buffer.patch
new file mode 100644 (file)
index 0000000..7ef63da
--- /dev/null
@@ -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 <assert.h>
++#include <unistd.h>
+ #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;
+           }
+       }
This page took 0.130624 seconds and 4 git commands to generate.