]>
Commit | Line | Data |
---|---|---|
00408d4e MM |
1 | diff -ur cvs-1.11.1p1.orig/src/buffer.c cvs-1.11.1p1/src/buffer.c |
2 | --- cvs-1.11.1p1.orig/src/buffer.c Thu Apr 19 21:29:05 2001 | |
3 | +++ cvs-1.11.1p1/src/buffer.c Thu Feb 14 13:22:23 2002 | |
4 | @@ -1,6 +1,7 @@ | |
5 | /* Code for the buffer data structure. */ | |
6 | ||
7 | #include <assert.h> | |
8 | +#include <unistd.h> | |
9 | #include "cvs.h" | |
10 | #include "buffer.h" | |
11 | ||
12 | @@ -292,15 +293,28 @@ | |
13 | ||
14 | if (nbytes != data->size) | |
15 | { | |
16 | + struct buffer_data *p; | |
17 | + int cnt; | |
18 | + | |
19 | /* Not all the data was written out. This is only | |
20 | permitted in nonblocking mode. Adjust the buffer, | |
21 | and return. */ | |
22 | ||
23 | assert (buf->nonblocking); | |
24 | ||
25 | + cnt = 0; | |
26 | + for (p = data; p->next; p = p->next) | |
27 | + cnt++; | |
28 | + | |
29 | data->size -= nbytes; | |
30 | data->bufp += nbytes; | |
31 | ||
32 | + /* Don't allow buffers to grow over 100 pages. */ | |
33 | + if (cnt > 100) { | |
34 | + usleep(100000); | |
35 | + continue; | |
36 | + } | |
37 | + | |
38 | return 0; | |
39 | } | |
40 | } |