nghttp2_buffer: Set minimum buffer size to 8

This commit is contained in:
Tatsuhiro Tsujikawa 2014-01-27 00:47:27 +09:00
parent fbffd2c923
commit 58cbecbf95
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ int nghttp2_buffer_reserve(nghttp2_buffer *buffer, size_t len)
} }
if(buffer->capacity < len) { if(buffer->capacity < len) {
uint8_t *new_buf; uint8_t *new_buf;
size_t new_cap = buffer->capacity == 0 ? 32 : buffer->capacity * 3 / 2; size_t new_cap = buffer->capacity == 0 ? 8 : buffer->capacity * 3 / 2;
new_cap = nghttp2_min(buffer->max_capacity, nghttp2_max(new_cap, len)); new_cap = nghttp2_min(buffer->max_capacity, nghttp2_max(new_cap, len));
new_buf = realloc(buffer->buf, new_cap); new_buf = realloc(buffer->buf, new_cap);
if(new_buf == NULL) { if(new_buf == NULL) {