Commit 15cde4b6 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

When resizin the proxy buffers, do not start from 0 size...

parent 2e9eaaf9
......@@ -683,6 +683,7 @@ void proxy_parts_exchange_second(struct proxy *p) {
error("Failed to re-allocate parts_in buffers.");
}
if (p->nr_gparts_in > p->size_gparts_in) {
if (p->size_gparts_in == 0) p->size_gparts_in = proxy_buffinit;
do {
p->size_gparts_in *= proxy_buffgrow;
} while (p->nr_gparts_in > p->size_gparts_in);
......@@ -802,6 +803,7 @@ void proxy_gparts_load(struct proxy *p, const struct gpart *gparts, int N) {
/* Is there enough space in the buffer? */
if (p->nr_gparts_out + N > p->size_gparts_out) {
if (p->size_gparts_out == 0) p->size_gparts_out = proxy_buffinit;
do {
p->size_gparts_out *= proxy_buffgrow;
} while (p->nr_gparts_out + N > p->size_gparts_out);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment