#define BUFFER_MAX_CHUNK 0x100000
#define BUFFER_MAX_LEN 0xa00000
-/* try increasing to 256k in hpnxfers */
-#define BUFFER_ALLOCSZ 0x008000 /* 32k */
-#define BUFFER_ALLOCSZ_HPN 0x040000 /* 256k */
+#define BUFFER_ALLOCSZ 0x008000
/* Initializes the buffer structure. */
buffer_append_space(Buffer *buffer, u_int len)
{
u_int newlen;
- u_int buf_max;
- u_int buf_alloc_sz;
void *p;
if (len > BUFFER_MAX_CHUNK)
if (buffer_compact(buffer))
goto restart;
- /* if hpn is disabled use the smaller buffer size */
- buf_max = BUFFER_MAX_LEN_HPN;
- buf_alloc_sz = BUFFER_ALLOCSZ_HPN;
-
/* Increase the size of the buffer and retry. */
- newlen = roundup(buffer->alloc + len, buf_alloc_sz);
-
-
- if (newlen > buf_max)
+ newlen = roundup(buffer->alloc + len, BUFFER_ALLOCSZ);
+ if (newlen > BUFFER_MAX_LEN_HPN)
fatal("buffer_append_space: alloc %u not supported",
newlen);
buffer->buf = xrealloc(buffer->buf, 1, newlen);
int
buffer_check_alloc(Buffer *buffer, u_int len)
{
- u_int buf_max;
- u_int buf_alloc_sz;
-
if (buffer->offset == buffer->end) {
buffer->offset = 0;
buffer->end = 0;
return (1);
if (buffer_compact(buffer))
goto restart;
-
- /* if hpn is disabled use the smaller buffer size */
- buf_max = BUFFER_MAX_LEN_HPN;
- buf_alloc_sz = BUFFER_ALLOCSZ_HPN;
-
- if (roundup(buffer->alloc + len, buf_alloc_sz) <= buf_max)
+ if (roundup(buffer->alloc + len, BUFFER_ALLOCSZ) <= BUFFER_MAX_LEN)
return (1);
return (0);
}