X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/blobdiff_plain/33ffb56699279fbe303872628e5aa8c60a7a92a1..HEAD:/openssh/buffer.c diff --git a/openssh/buffer.c b/openssh/buffer.c index 705155c..cb0b620 100644 --- a/openssh/buffer.c +++ b/openssh/buffer.c @@ -26,9 +26,7 @@ #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. */ @@ -105,8 +103,6 @@ void * 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) @@ -129,15 +125,9 @@ restart: 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); @@ -153,9 +143,6 @@ restart: 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; @@ -165,12 +152,7 @@ buffer_check_alloc(Buffer *buffer, u_int len) 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); }